我正在尝试构建 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
Run Code Online (Sandbox Code Playgroud)