I use Ansible to build configuration files in ini format. When I use the ini_file
module with option and value pair it works as expected, for example:
- name: Create configuration file
ini_file:
path: /tmp/test.conf
state: present
section: lol
option: foo
value: bar
Would result with:
[lol]
foo = bar
However I want a specific section to exist without options in it, like so:
- name: Create configuration file
ini_file:
path: /tmp/test.conf
state: present
section: lol
But all it does is reporting ok
on the task and moves on to the next one.
When I use verbose mode I can see: ok: [localhost] => {"changed": false, "msg": "OK", "path": "/tmp/test.conf", "state": "absent"}
How can I use the module to create option-less sections?