在服务器上执行和执行apt-get update; apt-get upgrade -y时,我遇到了以下消息:
Setting up sudo (1.8.16-0ubuntu1.5) ...
Configuration file '/etc/sudoers'
==> Modified (by you or by a script) since installation.
==> Package distributor has shipped an updated version.
What would you like to do about it ? Your options are:
Y or I : install the package maintainer's version
N or O : keep your currently-installed version
D : show the differences between the versions
Z : start a shell to examine the situation
The default action is to keep your current version.
*** sudoers (Y/I/N/O/D/Z) [default=N] ?
Setting up ubuntu-minimal (1.361.1) ...我知道debconf可以用来配置包,比如MySQL,来回答提示的问题。
我应该使用哪个Linux程序/模块/函数/等来准备对这个提示的答复?
我真的很想知道一个通过Ansilbe执行的解决方案,如果存在的话。除了一个BASH脚本。
请注意:我的所有发行版都是通过IaC完成的,因此自动化至关重要。
发布于 2018-09-06 08:21:46
有些选项可以通过apt-get来处理配置选项。我们通常做的事情是:
apt-get install -y --no_install_recommends -o Dpkg::Options::='--force-confdef' -o Dpkg::Options::='--force-confold' <package_name>
当使用ansible时,您可以:
apt:
pkg: "{{ item }}"
only_upgrade: yes
install_recommends: no
force: yes
dpkg_options: 'force-confdef,force-confold'
state: latest
with_items:
- <package_name>有关ansible apt模块选项的详细信息,请参阅这里
https://devops.stackexchange.com/questions/4912
复制相似问题