Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

option to auto-install python-apt module #4079

Closed
iivvoo opened this issue Sep 10, 2013 · 11 comments · Fixed by #4617
Closed

option to auto-install python-apt module #4079

iivvoo opened this issue Sep 10, 2013 · 11 comments · Fixed by #4617
Labels
feature This issue/PR relates to a feature request.

Comments

@iivvoo
Copy link

iivvoo commented Sep 10, 2013

If the 'apt' module is used but python-apt is not installed on the target host, ansible bails out with:

TASK: [Install sudo] ********************************************************** 
failed: [hoppi] => {"failed": true}
msg: Could not import python modules: apt, apt_pkg. Please install python-apt package.

FATAL: all hosts have already failed -- aborting

which means you're always forced to do some workaround to make sure python-apt is installed.

An option to somehow auto-install python-apt if necessary would be nice.

@jimi-c jimi-c closed this as completed Sep 10, 2013
@mpdehaan mpdehaan reopened this Sep 10, 2013
@mpdehaan
Copy link
Contributor

This would actually be a pretty good idea, and I don't think it needs to be an option.

The module is a packaging module and has a non-stock-OS dependency, which is a problem for people with stock images and makes the initial user experience on Debian/Ubuntu rougher than on Red Hat.

We should test if it's not there and then feed in the command line to auto-install it.

@resmo
Copy link
Contributor

resmo commented Sep 17, 2013

We should considering to add this to the documentation.

If you are doing a minimal installation, you may not have python as well. So bootstrapping ansible dependencies is not only an problem using the apt module.

So better doing less magic, print an good error message so users just can do:

ansible -m raw -a "apt-get install python-apt -y"

@mpdehaan
Copy link
Contributor

No, it should not be documentation, we should auto install the module.

If someone left out Python they ignored most of the install instructions for using Ansible, so I'm less concerned with that.

@jctanner
Copy link
Contributor

@resmo can you make a pull request for resmo@ba561db ?

@marcusramberg
Copy link
Contributor

I still see this issue with Ansible 1.5.5. Which release did this change go into?

@jimi-c
Copy link
Member

jimi-c commented May 21, 2014

@marcusramberg this is definitely in 1.6.0.

@Wilfred
Copy link

Wilfred commented Jun 27, 2014

Similarly, apt_repository depends on python-curl. Should this be autoinstalled too?

@jimi-c
Copy link
Member

jimi-c commented Jul 5, 2014

@Wilfred the installation is done via apt, so deps should be installed along with that package.

@d-mo
Copy link

d-mo commented Jan 21, 2015

I'm getting this error with Ansible version 1.8.2. Downgrading to 1.7.2 fixes it.

@hwmrocker
Copy link

I get this error with ansible 1.9.1, and 1.7.2 will not install in a virtual env because it cannot delete stuff in /usr/share WTF

@anton-rudeshko
Copy link

On Ubuntu Hardy 8.04 I always get:

Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
  python-apt: Depends: libapt-pkg-libc6.7-6-4.6
E: Broken packages

Is there a way to fix this?

@ansibot ansibot added feature This issue/PR relates to a feature request. and removed feature_idea labels Mar 2, 2018
@ansible ansible locked and limited conversation to collaborators Apr 24, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature This issue/PR relates to a feature request.
Projects
None yet
Development

Successfully merging a pull request may close this issue.