About the author


System Engineer – LFCS – Devops – Linux fanatic, Open Source enthusiast and technology blogger.

Related Articles

  • dwec

    Unfortunately Ubuntu 16.04 now asks about a billion questions when you install postfix so it’s probably simpler to just use debconf to choose “no configuration” and then use the ansible template module for the actual configuration.

    Why Ubuntu can’t just choose sensible defaults for this package I don’t know.

    • dwec

      Further to my previous comment, here’s a debconf-only way of dealing with Ubuntu >= 16.04’s many many postfix install wizard questions:

      Make yourself a file containing the required configuration variables e.g:

      name: postfix
      destinations: “$myhostname, mywebsite.com, localhost, localhost.localdomain, localhost”
      mailname: “mywebsite.com”
      recipient_delim: “+”
      mynetworks: “ [::ffff:]/104 [::1]/128”
      protocols: “all”
      main_mailer_type: “Internet Site”
      mailbox_limit: “0”
      chattr: “true”
      root_address: “”

      In your playbook tasks section, load that variable file into your playbook and run debconf for each of the vars:

      – include_vars:
      file: vars/postfix.yml
      name: postfix

      – name: Pre-configure postfix
      name: “{{ postfix.debconf.name }}”
      question: “{{ postfix.debconf.name }}/{{ item.key }}”
      value: “{{ item.value }}”
      vtype: select
      with_dict: “{{ postfix.debconf.vars }}”

      Do this BEFORE installing the postfix package.

      Job done.

      I found out what questions and answers postfix needed by installing the package and suffering the wizard’s interrogation manually, and then running “debconf-show postfix” and grabbing only the configuration strings marked with an asterisk. So this process could be easily adapted to other debian/ubuntu packages.

Creative Commons License