我正在尝试构建Ansible Playbook,以在Linode上部署一些Ubuntu 12.04服务器,但是我的问题似乎是Ubuntu。当我运行apt-get或aptitude的不同组合时,总是得到以下我必须响应的对话框。
我希望在命令行中回答此问题,以便它不会中断自动部署。有任何想法吗?
我当前的命令如下。请注意,我正在尝试设置DEBIAN_FRONTEND:
#!/bin/bash
echo 'DEBIAN_FRONTEND="noninteractive"' >> /etc/profile
echo 'DEBIAN_FRONTEND="noninteractive"' >> ~/.profile
source /etc/profile
source ~/.profile
# This next line is the one that pops up the dialog
sudo aptitude -y install iptables-persistent
# Need this to fix an issue with the package post-install (this works fine.)
sudo sed \
-i 's/\(modprobe -q ip6\?table_filter\)/\1 || true/g' \
/var/lib/dpkg/info/iptables-persistent.postinst; \
sudo aptitude install iptables-persistent