Everytime I run a playbook, ansible will install the packages again and again, even thought it is installed, so how does it work actually?
ansible-playbook -i hosts site.yml
GATHERING FACTS ***************************************************************
ok: [192.168.0.2]
TASK: [Install via apt] ***************************************
changed: [192.168.0.2] => (item=build-essential,python-dev,python-software-properties,python-setuptools)
My cookbook (Tasks):
name: Install via apt
action: apt pkg=$item
with_items:
- build-essential
- python-dev
- python-software-properties
Best Answer
I can't reproduce your error with this playbook:
As expected, consecutive executions of the playbook are idempotent: