apt module failing on Ubuntu 14.04 LTS

946 views
Skip to first unread message

Mike Titus

unread,
Apr 18, 2014, 4:18:14 PM4/18/14
to ansible...@googlegroups.com
Anisble 1.5.4 running from Ubuntu 13.10,  "virgin" install of Ubuntu 14.04 LTS, the very first task of my playbook fails:

- name: apt-get update
  apt:  update_cache=yes


TASK: [common | apt-get update] *********************************************** 
<1xx.xx.xx.xx> ESTABLISH CONNECTION FOR USER: ubuntu
<1xx.xx.xx.xx> REMOTE_MODULE apt update_cache=yes
<1xx.xx.xx.xx> EXEC ['ssh', '-C', '-tt', '-vvv', '-o', 'ControlMaster=auto', '-o', 'ControlPersist=60s', '-o', 'ControlPath=/home/miketitus/.ansible/cp/ansible-ssh-%h-%p-%r', '-o', 'StrictHostKeyChecking=no', '-o', 'Port=22', '-o', 'IdentityFile=creds/phantom-test', '-o', 'KbdInteractiveAuthentication=no', '-o', 'PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey', '-o', 'PasswordAuthentication=no', '-o', 'User=ubuntu', '-o', 'ConnectTimeout=10', '1xx.xx.xx.xx', "/bin/sh -c 'mkdir -p $HOME/.ansible/tmp/ansible-tmp-1397851850.37-160665359287307 && chmod a+rx $HOME/.ansible/tmp/ansible-tmp-1397851850.37-160665359287307 && echo $HOME/.ansible/tmp/ansible-tmp-1397851850.37-160665359287307'"]
<1xx.xx.xx.xx> PUT /tmp/tmprbQMHK TO /home/ubuntu/.ansible/tmp/ansible-tmp-1397851850.37-160665359287307/apt
<1xx.xx.xx.xx> EXEC ['ssh', '-C', '-tt', '-vvv', '-o', 'ControlMaster=auto', '-o', 'ControlPersist=60s', '-o', 'ControlPath=/home/miketitus/.ansible/cp/ansible-ssh-%h-%p-%r', '-o', 'StrictHostKeyChecking=no', '-o', 'Port=22', '-o', 'IdentityFile=creds/phantom-test', '-o', 'KbdInteractiveAuthentication=no', '-o', 'PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey', '-o', 'PasswordAuthentication=no', '-o', 'User=ubuntu', '-o', 'ConnectTimeout=10', '1xx.xx.xx.xx', '/bin/sh -c \'sudo -k && sudo -H -S -p "[sudo via ansible, key=jdrwkofumuslbxgkogxvwgixuhloymos] password: " -u root /bin/sh -c \'"\'"\'echo SUDO-SUCCESS-jdrwkofumuslbxgkogxvwgixuhloymos; /usr/bin/python /home/ubuntu/.ansible/tmp/ansible-tmp-1397851850.37-160665359287307/apt; rm -rf /home/ubuntu/.ansible/tmp/ansible-tmp-1397851850.37-160665359287307/ >/dev/null 2>&1\'"\'"\'\'']
failed: [1xx.xx.xx.xx] => {"failed": true, "item": ""}
msg: Could not import python modules: apt, apt_pkg. Please install python-apt package.


Matt Martz

unread,
Apr 18, 2014, 4:47:01 PM4/18/14
to ansible...@googlegroups.com, Mike Titus
This issue has been fixed in the 'devel' branch, and will appear in 1.6


In the interim you may have to use the 'raw' module to install python-apt:

- name: install python-apt
  raw: apt-get update && apt-get install python-apt -y -q

-- 
Matt Martz
ma...@sivel.net
--
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 ansible-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/817024e2-05ba-42eb-8c87-3212881b204e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages