In my Git <https://galaxy.ansible.com/list#/roles/431> role on Galaxy, I 
have the following task to install certain packages on Debian hosts:

- name: Ensure git's dependencies are installed (Debian).
  apt: "pkg={{ item }} state=installed"
  with_items:
    - libcurl4-gnutls-dev
    - libexpat1-dev
    - gettext
    - libz-dev
    - libssl-dev
    - build-essential

This task always reports a change, even when no new packages are 
installed... below is the full output when running the playbook with -vvvv 
(you can see the full playbook run, twice, on an Ubuntu 12.04 host, over on 
Travis CI <https://travis-ci.org/geerlingguy/ansible-role-git/jobs/33459628>
):

TASK: [ansible-role-git | Ensure git's dependencies are installed (Debian).] 
*** 

<localhost> REMOTE_MODULE apt 
pkg=libcurl4-gnutls-dev,libexpat1-dev,gettext,libz-dev,libssl-dev,build-essential
 state=installed

<localhost> EXEC ['/bin/sh', '-c', 'mkdir -p 
$HOME/.ansible/tmp/ansible-tmp-1408937381.71-7455986615578 && chmod a+rx 
$HOME/.ansible/tmp/ansible-tmp-1408937381.71-7455986615578 && echo 
$HOME/.ansible/tmp/ansible-tmp-1408937381.71-7455986615578']

<localhost> PUT /tmp/tmpUu6LUb TO 
/home/travis/.ansible/tmp/ansible-tmp-1408937381.71-7455986615578/apt

<localhost> EXEC /bin/sh -c 'sudo -k && sudo -H -S -p "[sudo via ansible, 
key=ptpgbfvujharlyicgqvfprtxbyzstkfo] password: " -u root /bin/sh -c '"'"'echo 
SUDO-SUCCESS-ptpgbfvujharlyicgqvfprtxbyzstkfo; LANG=en_US.UTF-8 
LC_CTYPE=en_US.UTF-8 /usr/bin/python 
/home/travis/.ansible/tmp/ansible-tmp-1408937381.71-7455986615578/apt; rm -rf 
/home/travis/.ansible/tmp/ansible-tmp-1408937381.71-7455986615578/ >/dev/null 
2>&1'"'"''

changed: [localhost] => 
(item=libcurl4-gnutls-dev,libexpat1-dev,gettext,libz-dev,libssl-dev,build-essential)
 => {"changed": true, "item": 
"libcurl4-gnutls-dev,libexpat1-dev,gettext,libz-dev,libssl-dev,build-essential",
 "stderr": "", "stdout": "Reading package lists...\nBuilding dependency 
tree...\nReading state information...\nzlib1g-dev is already the newest 
version.\nThe following packages were automatically installed and are no longer 
required:\n  git-man rsync liberror-perl libgeos-3.2.2\nUse 'apt-get 
autoremove' to remove them.\n0 upgraded, 0 newly installed, 0 to remove and 128 
not upgraded.\n"}


Any ideas as to why Ansible would be setting "changed" to true for this? 
Nothing was upgraded/installed/removed... Other apt tasks seem to work just 
fine.

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/e83c6b06-6200-48b8-b5ae-b2c3d0a413e0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to