5 ms·
You're confusing declarative with idempotent. Ansible is both, it won't change anything if the state is already what you declared. The nitpicked case you chose,
by Anarch157a 2y ago
You're confusing declarative with idempotent. Ansible is both, it won't change anything if the state is already what you declared. The nitpicked case you chose, you want the file to have the latest timestamp, this is a valid state to declare.
- verdverm 2y agoThe shell task breaks the declarative nature a bit, along with registering task results and then writing conditional whens based on them. Interpolating values based on the registered results does too imho
- aflukasz 2y agoPlus, what your are declaring is often times not the state you desire but... action you want to take. Say you use `apt.name: [pkg1, pkg2]`, run it, then remove `pkg2` from the list. Running this again won't remove `pkg2` from your system. So it's declarative, but not necessarily on the optimal level all the times.
- goodpoint 2y agoAnsible is neither.
- otabdeveloper4 2y agoAnsible tries to be declarative and idempotent, but fails at being both.
- gtirloni 2y agoansible-core succeeds pretty well in being both. ansible modules (built-in and community) are a different matter. generally, quality will vary.
- soraminazuki 2y agoAnsible is neither and it shows. For example, deleting a configuration in Ansible doesn't revert the system back to its original state. That's the definition of statefulness.