标签: debconf

自动化 dpkg-reconfigure tzdata

我正在使用 puppet 来管理一组 debian 服务器。我需要更改集群上每台机器的时区。执行此操作的正确 debian 方法是使用dpkg-reconfigure tzdata. 但是如果我使用对话框,我似乎只能改变它。有什么方法可以从 shell 自动执行此操作,以便我可以编写一个 Exec 来简化此操作?

如果没有,我认为下一个最好的方法可能是让 puppet 分发/etc/timezone/etc/localtime在整个集群中使用正确的数据。

任何输入表示赞赏!

debian puppet dpkg timezone debconf

66
推荐指数
2
解决办法
4万
查看次数

如何让 Ansible 实际编译一个配置文件,并更改了应用程序的 debconf 设置?

我正在使用 Ansible 尝试配置与特定项目相关的所有工作站,以便能够使用标准配置的 BitTorrent 同步(这实际上只是我想要做的事情的一个例子)。

当我执行 playbook 时,我可以确认远程 PC 上的 debconf 设置已更新,但是应用程序的配置文件尚未更新。

有没有办法让工作顺利完成 - 提供了一堆配置数据,我只想重新编译实际的配置文件,然后重新启动服务。

我在 Ubuntu 14.10 64 位主机上使用最新的 Ansible(来自 PyPi)。

- hosts: btsync
  sudo: True
  tasks:
    - apt_repository: repo='ppa:tuxpoldo/btsync' update_cache=yes state=present
    - apt: name=btsync state=present
    - apt: name=debconf-utils state=present
    - apt: name=btsync-gui state=present
    - file: name='create a directory for BT Sync' path=/home/sal/bittorrent_sync state=directory owner=sal group=users mode=0755
    - debconf: name='btsync' question='btsync/runas' value='sal' vtype='string'
    - debconf: name='btsync' question='btsync/directory_root' value='/home/sal/bittorrent_sync' vtype='string'
    - debconf: name='btsync' question='btsync/webgui-bindaddr' value='0.0.0.0' vtype='string'
    - debconf: name='btsync' question='btsync/folder_defaults-use_lan_broadcast' …
Run Code Online (Sandbox Code Playgroud)

ubuntu ansible debconf

7
推荐指数
1
解决办法
2594
查看次数

为键盘配置设置 debconf 选择失败......布局最终为阿富汗语

我有一台我网络安装的机器,设置了德语键盘,但它忽略了我的设置,并且安装了美式键盘。我确定我设置了它,因为如果我不设置它,它会以交互方式询问,但我想要无人值守安装。

这是 Ubuntu 12.04.3

所以现在之后,我想编写一个修复程序以使其成为德语键盘。

因此,首先我在一台机器上以交互方式设置设置,然后读取设置以查看它们的值,然后在另一台机器上,我设置选项:

debconf-set-selections <<< "keyboard-configuration keyboard-configuration/altgr select The default for the keyboard layout"
debconf-set-selections <<< "keyboard-configuration keyboard-configuration/compose select No compose key"
debconf-set-selections <<< "keyboard-configuration keyboard-configuration/ctrl_alt_bksp boolean false"
debconf-set-selections <<< "keyboard-configuration keyboard-configuration/layoutcode string de"
debconf-set-selections <<< "keyboard-configuration keyboard-configuration/layout select German"
debconf-set-selections <<< "keyboard-configuration keyboard-configuration/modelcode string pc105"
debconf-set-selections <<< "keyboard-configuration keyboard-configuration/model select Generic 105-key (Intl) PC"
debconf-set-selections <<< "keyboard-configuration keyboard-configuration/optionscode string "
debconf-set-selections <<< "keyboard-configuration keyboard-configuration/store_defaults_in_debconf_db boolean true"
debconf-set-selections <<< "keyboard-configuration keyboard-configuration/switch select No temporary switch"
debconf-set-selections <<< …
Run Code Online (Sandbox Code Playgroud)

keyboard-layout ubuntu-12.04 debconf

6
推荐指数
1
解决办法
7813
查看次数

dpkg-reconfigure:对话框前端成功设置 postfix;非交互式前端失败

(注意,在这个问题中,前导#表示根提示符,而不是注释。此外,我已将实际主机名替换为<myhostname>。)

正如debconf (7)手册页所述,dpkg-reconfigure可以使用多个前端中的任何一个来调用,包括默认(“对话框”)交互式前端和“非交互式”前端。

我的想法正确吗?

# dpkg-reconfigure postfix
Run Code Online (Sandbox Code Playgroud)

调用对话框前端,并按Enter回答每个问题,应该相当于运行以下命令?

# dpkg-reconfigure -f noninteractive postfix
Run Code Online (Sandbox Code Playgroud)

如果是这样,那么我不明白以下差异。

差异

在从我的网络主机映像(已安装 postfix)中新填充 Debian 9“Stretch”的 VPS 上,我使用以下命令进行预置debconf-set-selections

# debconf-set-selections <<< "postfix postfix/destinations string <myhostname>"
# debconf-set-selections <<< "postfix postfix/mailbox_limit string 51200000"              
# debconf-set-selections <<< "postfix postfix/mailname string <myhostname>"    
# debconf-set-selections <<< "postfix postfix/main_mailer_type select Internet Site"      
# debconf-set-selections <<< "postfix postfix/protocols select ipv4"                      
# debconf-set-selections <<< "postfix postfix/root_address …
Run Code Online (Sandbox Code Playgroud)

automation dpkg preseed debconf debian-stretch

6
推荐指数
1
解决办法
2916
查看次数

debconf 忽略我的默认答案

我正在尝试设置默认答案以debconf自动执行 exim 配置。我正在设置新值debconf-set-selections,但debconf忽略它。我很困惑。这是我的问题的简短复制/粘贴:

root@vm-iwd:/var/cache/debconf# debconf-get-selections | grep exim4/dc_eximconfig_configtype
exim4-config    exim4/dc_eximconfig_configtype  select  mail sent by smarthost; no local mail
root@vm-iwd:/var/cache/debconf# echo "exim4-config exim4/dc_eximconfig_configtype select internet site; mail is sent and received directly using SMTP" | debconf-set-selections
root@vm-iwd:/var/cache/debconf# debconf-get-selections | grep exim4/dc_eximconfig_configtype
exim4-config    exim4/dc_eximconfig_configtype  select  internet site; mail is sent and received directly using SMTP
root@vm-iwd:/var/cache/debconf# dpkg-reconfigure exim4-config -fnoninteractive
[ ok ] Stopping MTA for restart: exim4_listener.
[ ok ] Restarting MTA: exim4.
root@vm-iwd:/var/cache/debconf# debconf-get-selections | …
Run Code Online (Sandbox Code Playgroud)

debian debconf

5
推荐指数
1
解决办法
1704
查看次数