I have this in a playbook
name: Install needed packages 
libxml2-dev 
libxslt-dev 
memcached 
uwsgi 
 
Every single time it runs, it reports changed…
TASK: [Install needed packages] ***********************************************
 
Any ideas why it keeps reporting “changed”.
I tried checking if apt upgrade even reports anything in the target machine and it doesn’t.
             
            
              
            
           
          
            
            
              
I have this in a playbook
name: Install needed packages 
libxml2-dev 
libxslt-dev 
memcached 
uwsgi 
 
 
I can see same behaviour for following play which is quite similar
name: Install dev ubuntu packages for jenkins 
 
funny thing is that it doesn’t happen for other packages. only for these 3.
             
            
              
            
           
          
            
            
              After some troubleshooting problem looks to be in libxslt-dev package
caracal:rsd_env_setup (master*) $ ansible -m apt -a ‘pkg=libxslt-dev state=present’ opsci-server -s -vvvopsci.rsd.com > ESTABLISH CONNECTION FOR USER: rsdopsci.rsd.com > REMOTE_MODULE apt pkg=libxslt-dev state=presentopsci.rsd.com > EXEC ssh -C -tt -q -o ControlPersist=15m -F /Users/haad/.ansible/ssh_config -o ControlPath=“/Users/haad/.ansible/cp/ansible-ssh-%h-%p-%r” -o StrictHostKeyChecking=no -o Port=22 -o IdentityFile=“/Users/haad/.ssh/id_rsa” -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=rsd -o ConnectTimeout=19 opsci.rsd.com  /bin/sh -c ‘mkdir -p $HOME/.ansible/tmp/ansible-tmp-1424265035.78-99667925086072 && chmod a+rx $HOME/.ansible/tmp/ansible-tmp-1424265035.78-99667925086072 && echo $HOME/.ansible/tmp/ansible-tmp-1424265035.78-99667925086072’opsci.rsd.com > PUT /var/folders/yq/_h9bmb6x1qxb7p4_w5xhkgx80000gn/T/tmpg9KHmA TO /home/rsd/.ansible/tmp/ansible-tmp-1424265035.78-99667925086072/aptopsci.rsd.com > EXEC ssh -C -tt -q -o ControlPersist=15m -F /Users/haad/.ansible/ssh_config -o ControlPath=“/Users/haad/.ansible/cp/ansible-ssh-%h-%p-%r” -o StrictHostKeyChecking=no -o Port=22 -o IdentityFile=“/Users/haad/.ssh/id_rsa” -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=rsd -o ConnectTimeout=19 opsci.rsd.com  /bin/sh -c ‘sudo -k && sudo -H -S -p “[sudo via ansible, key=cljxvustcsbxbaozbgaskderzvnjkymy] password: " -u root /bin/sh -c '”’“‘echo SUDO-SUCCESS-cljxvustcsbxbaozbgaskderzvnjkymy; LANG=C LC_CTYPE=C /usr/bin/python /home/rsd/.ansible/tmp/ansible-tmp-1424265035.78-99667925086072/apt; rm -rf /home/rsd/.ansible/tmp/ansible-tmp-1424265035.78-99667925086072/ >/dev/null 2>&1’”‘"’’
caracal:rsd_env_setup (master*) $ ansible -m apt -a ‘pkg=libxml2-dev state=present’ opsci-server -s -vvvopsci.rsd.com > ESTABLISH CONNECTION FOR USER: rsdopsci.rsd.com > REMOTE_MODULE apt pkg=libxml2-dev state=presentopsci.rsd.com > EXEC ssh -C -tt -q -o ControlPersist=15m -F /Users/haad/.ansible/ssh_config -o ControlPath=“/Users/haad/.ansible/cp/ansible-ssh-%h-%p-%r” -o StrictHostKeyChecking=no -o Port=22 -o IdentityFile=“/Users/haad/.ssh/id_rsa” -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=rsd -o ConnectTimeout=19 opsci.rsd.com  /bin/sh -c ‘mkdir -p $HOME/.ansible/tmp/ansible-tmp-1424265055.72-134679118481702 && chmod a+rx $HOME/.ansible/tmp/ansible-tmp-1424265055.72-134679118481702 && echo $HOME/.ansible/tmp/ansible-tmp-1424265055.72-134679118481702’opsci.rsd.com > PUT /var/folders/yq/_h9bmb6x1qxb7p4_w5xhkgx80000gn/T/tmpR6qy_K TO /home/rsd/.ansible/tmp/ansible-tmp-1424265055.72-134679118481702/aptopsci.rsd.com > EXEC ssh -C -tt -q -o ControlPersist=15m -F /Users/haad/.ansible/ssh_config -o ControlPath=“/Users/haad/.ansible/cp/ansible-ssh-%h-%p-%r” -o StrictHostKeyChecking=no -o Port=22 -o IdentityFile=“/Users/haad/.ssh/id_rsa” -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=rsd -o ConnectTimeout=19 opsci.rsd.com  /bin/sh -c ‘sudo -k && sudo -H -S -p “[sudo via ansible, key=dlcbjvxflyxkbuoiaomhxeyyczmpstws] password: " -u root /bin/sh -c '”’“‘echo SUDO-SUCCESS-dlcbjvxflyxkbuoiaomhxeyyczmpstws; LANG=C LC_CTYPE=C /usr/bin/python /home/rsd/.ansible/tmp/ansible-tmp-1424265055.72-134679118481702/apt; rm -rf /home/rsd/.ansible/tmp/ansible-tmp-1424265055.72-134679118481702/ >/dev/null 2>&1’”‘"’’
             
            
              
            
           
          
            
            
              So I’m sorry for spaming but I cracked it problem is that there is no package called libxslt-dev that’s just an alias to libxslt1-dev and if you use former name it will print a node to stdout. Which will trigger the change.
opsci:~ $ sudo apt-get install libxslt-dev
opsci:~ $ sudo apt-get install libxslt1-dev
             
            
              
            
           
          
            
              
                Brian_Coca  
              
                  
                    February 18, 2015,  2:50pm
                   
                  5 
               
             
            
              this happens with virtual packages, as they do not appear  as