How to write Ansible YAML for tasks done using dpkg-reconfigure
command that ask question during the process?
Example
sudo dpkg-reconfigure slapd
I was trying to write an Ansible playbook to automate reconfiguring slapd
with default values.
Since Ansible is mainly a Configuration Management Tool with which one declared a Desired State, a Version Control System should be used in general, a non-interactive approach should be the main goal and any interaction should be prevented.
To do so, the within the comments mentioned debconf
module – Configure a .deb package could come in place and which can then be used like in How do I make Ansible actually compile a config file having changed my debconf
settings for an application?.
Further Similar Q&A