With ansible you need to change the relevant step to use apt remove instead of apt install and to change the config file step in a step that removes the file.
Wait until you have 2 services that use the same resource. Now you need:
When both are enabled the resource is set up.
When either one is enabled the resource is still set up.
When neither is configured the resource is removed.
Doing this with Ansible is a nightmare. And 99% of the time you don’t even realize that you have this problem until your configs don’t work for some reason.
Yeah, ansible is just full of these scenarios. Even in the best of times it demands an awful amount of verbosity.
Half the time I see people land with no more idempotency than they had before, which is supposed to be one of the big draws. A lot of the things they are frontending are inherently idempotent, and a lot of other times the modules themselves fail to be safe to run multiple times for the admins input. I’ve been shocked how fragile some modules have been given its regard in the industry.
Wait until you have 2 services that use the same resource. Now you need:
Doing this with Ansible is a nightmare. And 99% of the time you don’t even realize that you have this problem until your configs don’t work for some reason.
Yeah, ansible is just full of these scenarios. Even in the best of times it demands an awful amount of verbosity.
Half the time I see people land with no more idempotency than they had before, which is supposed to be one of the big draws. A lot of the things they are frontending are inherently idempotent, and a lot of other times the modules themselves fail to be safe to run multiple times for the admins input. I’ve been shocked how fragile some modules have been given its regard in the industry.