sunlightlabs / ansible-common-roles

Useful (somewhat) general-purpose ansible tasks.
GNU General Public License v3.0
2 stars 4 forks source link

Ansible doesn't know about python3-apt #5

Open fgregg opened 8 years ago

fgregg commented 8 years ago

On a 15.04 ubuntu base image, can't run ansible common tasks because ansible doesn't know about python3-apt

TASK: [common-roles/common | install base packages] ***************************
​failed: [opencivicdata-db] => (item=build-essential,git,mercurial,python-pycurl,python-boto) => {"failed": true, "item": "build-essential,git,mercurial,python-pycurl,python-boto"}
​msg: Could not import python modules: apt, apt_pkg. Please install python-apt package.
​
FATAL: all hosts have already failed -- aborting
paultag 10:05 AM ok, so it's missing a file
erm package
​python-apt must have been replaced with python3-apt
​which hilariously is likely my fault
​so perhaps install python-apt in the common roles somewhere before that line

tagging @paultag

jamesturk commented 8 years ago

I think this is an ansible version issue.. https://github.com/ansible/ansible/issues/4079

Oddly enough I'm not getting it, using ansible 1.9.4

On Mon, Nov 23, 2015 at 9:14 PM, Forest Gregg notifications@github.com wrote:

On a 15.04 ubuntu base image, can't run ansible common tasks because ansible doesn't know about python3-apt

TASK: [common-roles/common | install base packages] *** ​failed: [opencivicdata-db] => (item=build-essential,git,mercurial,python-pycurl,python-boto) => {"failed": true, "item": "build-essential,git,mercurial,python-pycurl,python-boto"} ​msg: Could not import python modules: apt, apt_pkg. Please install python-apt package. ​ FATAL: all hosts have already failed -- aborting paultag 10:05 AM ok, so it's missing a file erm package ​python-apt must have been replaced with python3-apt ​which hilariously is likely my fault ​so perhaps install python-apt in the common roles somewhere before that line

tagging @paultag https://github.com/paultag

— Reply to this email directly or view it on GitHub https://github.com/sunlightlabs/ansible-common-roles/issues/5.

franz-josef-kaiser commented 8 years ago

Same here for Ansible 1.9.4 on OS X.

TASK: [Remove obsolete APT repos] ********************************************* 
failed: [192.168.0.20] => {"failed": true}
msg: Failed to auto-install python-apt.

When I manually add the package via a task:

---
- hosts: home
  tasks:
   - name: Install Python APT
     apt: pkg=python-apt state=installed

I get a similar error, telling me that python-apt-common is not going to be installed

You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
 language-pack-gnome-zh-hans : Depends: language-pack-gnome-zh-hans-base (>= 1:12.04+20140106) but 1:12.04+20130128 is to be installed
 language-pack-gnome-zh-hant : Depends: language-pack-gnome-zh-hant-base (>= 1:12.04+20140106) but 1:12.04+20130128 is to be installed
 libavcodec53 : Depends: libavutil51 (< 4:0.8.3-99) but 4:0.8.17-0ubuntu0.12.04.1 is to be installed or
                         libavutil-extra-51 (< 4:0.8.3.99) but it is not going to be installed
 libavformat53 : Depends: libavcodec53 (>= 4:0.8.17-0ubuntu0.12.04.1) but 4:0.8.3-0ubuntu0.12.04.1 is to be installed or
                          libavcodec-extra-53 (>= 4:0.8.17) but it is not going to be installed
 python-apt : Depends: python-apt-common but it is not going to be installed

msg: E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).

FATAL: all hosts have already failed -- aborting

I tried adding with_items and add the dependencies there, which resulted in the same error.