Tente usar debconf-set-selections
para definir o valor antes de instalar o pacote:
echo iptables-persistent iptables-persistent/autosave_v4 boolean true | sudo debconf-set-selections
echo iptables-persistent iptables-persistent/autosave_v6 boolean true | sudo debconf-set-selections
Ou, via ansible
- name: prevent the iptables-peristent install dialog
debconf: name=iptables-persistent question={{ item }} vtype=boolean value=true
with_items:
- iptables-persistent/autosave_v4
- iptables-persistent/autosave_v6
- name: install iptables-persistent
apt: name=iptables-persistent