What is the difference between two “state” option values, “present” and “installed”, available in Ansible’s yum module?

Question:

I have the following task in my ansible playbook:

Another value I can pass to state is “installed”. What is the difference between the two? Some documentation available here: http://docs.ansible.com/ansible/yum_module.html

Answer:

They do the same thing, i.e. they are aliases to each other, see this comment in the source code of the yum module:

# removed==absent, installed==present, these are accepted as aliases

And how they are used in the code:

https://github.com/ansible/ansible-modules-core/blob/devel/packaging/os/yum.py

Leave a Reply