For unattended installations in Debian Linux environments
for unattended installations
Ansible module: http://docs.ansible.com/ansible/debconf_module.html
query the debconf database
$ debconf-show postfix
* postfix/main_mailer_type: 'Internet Site'
postfix/chattr: false
* postfix/mailname: your.hostname.com
...
output contents of debconf database
$ debconf-get-selections | grep postfix
postfix postfix/mailname string your.hostname.com
postfix postfix/main_mailer_type string 'Internet Site'
...
insert new values into the debconf database
$ echo "postfix postfix/mailname string your.hostname.com" | debconf-set-selections
$ echo "postfix postfix/main_mailer_type string 'Internet Site'" | debconf-set-selections
$ apt-get -y install postfix
$ DEBIAN_FRONTEND=noninteractive apt-get install postfix
reconfigure an already installed package
$ dpkg-reconfigure debconf