Hi,
I’m writing a custom Ansible module to mange configuration on remote servers. The actions include: create, update and delete.
[playbook]
port table:
parameter1:
parameter2:
parameter3:
As the playbook above, ‘create’ means removing port table if it exist before adding new port table with parameters1-3. ‘update’ means only update the given parameters 1-3 in port table, while keep other parameters in port table. ‘delete’ means remove the port table.
- What is the ansible tradition way of handling configuration if it exists? Does it do ‘update’ or ‘create’?
- How can I present create/update/delete all three actions in the playbook? Ansible “state” parameter has ‘present’ and ‘absent’ choices, where ‘present’ captures both ‘create’ and ‘update’ actions. How do I determine the way of merging new configuration and existing configuration?
Thanks,
Ying