I'm attempting to automate exim4 configuration on Debian in Ansible -- we have been manually configuring up until this point -- but I'm stuck at the stage where I'd run normally dpkg-reconfigure exim4-config
.
I can automate these steps easily enough:
- Update the conf file at
/etc/exim4/exim4-config.conf.conf
- Run
dpkg-reconfigure --frontend noninteractive exim4-config
They run fine in the playbook, however the issue is that not all the options that I see in the interactive prompt are in this conf file. For example, the second setting, System mail name
is not specified anywhere in the conf file. Nor is the last setting, Root and postmaster mail recipient
, which also stops showing up in the interactive prompt after the first configuration (why is that?)
I then saw that some people have suggested using debconf-set-selections
(here), and I tried looking into that - I installed the debconf-utils
package and then ran debconf-get-selections
- I then saw all the options there, but now I'm wondering if there is a way to use debconf-set-selections
without having to use a file that sets all of the settings all at once, since I just want to change the values associated with exim4. I'm trying to avoid overwriting any other values (not associated with exim4) that might be set if I need to run the playbook again.
Short of writing the output of debconf-get-selections
to a file and then using Ansible's lineinfile
/template
modules to replace the values I want to change, is there perhaps a simpler way of going about this? I'd prefer to avoid this method.