News for hackers. Stuff that matters.
Re:Pyinfra: Automate Infrastructure Using Python by Anarch157a on Tuesday April 30, 2024 @08:32PM (#40218175)
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.
Re:Pyinfra: Automate Infrastructure Using Python by verdverm on Tuesday April 30, 2024 @10:36PM (#40218929)
The 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
Re:Pyinfra: Automate Infrastructure Using Python by aflukasz on Wednesday May 01, 2024 @02:02AM (#40220031)
Plus, 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.
Re:Pyinfra: Automate Infrastructure Using Python by goodpoint on Wednesday May 01, 2024 @04:05AM (#40220720)
Ansible is neither.
Re:Pyinfra: Automate Infrastructure Using Python by otabdeveloper4 on Wednesday May 01, 2024 @05:24AM (#40221118)
Ansible tries to be declarative and idempotent, but fails at being both.
Re:Pyinfra: Automate Infrastructure Using Python by gtirloni on Wednesday May 01, 2024 @11:24AM (#40224596)
ansible-core succeeds pretty well in being both.

ansible modules (built-in and community) are a different matter. generally, quality will vary.

Re:Pyinfra: Automate Infrastructure Using Python by soraminazuki on Wednesday May 01, 2024 @10:50PM (#40232248)
Ansible 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.