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

apt module: do not use aptitude #16884

Closed
merifri opened this Issue Jul 30, 2016 · 10 comments

Comments

Projects
None yet
9 participants
@merifri

merifri commented Jul 30, 2016

ISSUE TYPE
  • Bug Report / Feature Idea
ANSIBLE VERSION
$ ansible --version
ansible 2.1.0.0
OS / ENVIRONMENT

Ubuntu 16.04.1

SUMMARY

Ubuntu 16 comes without aptitude package:

 "Could not find aptitude. Please ensure it is installed."
STEPS TO REPRODUCE

Tasks with upgrade parameter fails:

~/ansible-scripts $ ansible -i inventory/hosts lab -m apt -a "upgrade=full"
lab.xxx | FAILED! => {
    "changed": false, 
    "failed": true, 
    "msg": "Could not find aptitude. Please ensure it is installed."
}
~/ansible-scripts $ ansible -i inventory/hosts lab -m apt -a "upgrade=yes"
lab.xxx | FAILED! => {
    "changed": false, 
    "failed": true, 
    "msg": "Could not find aptitude. Please ensure it is installed."
}
~/ansible-scripts $ ansible -i inventory/hosts lab -m apt -a "upgrade=full"
lab.xxx | FAILED! => {
    "changed": false, 
    "failed": true, 
    "msg": "Could not find aptitude. Please ensure it is installed."
}
~/ansible-scripts $ ansible -i inventory/hosts lab -m apt -a "upgrade=safe"
lab.xxx | FAILED! => {
    "changed": false, 
    "failed": true, 
    "msg": "Could not find aptitude. Please ensure it is installed."
}

Only upgrade=dist work fine:

~/ansible-scripts $ ansible -i inventory/hosts lab -m apt -a "upgrade=dist"
lab.xxx | SUCCESS => {
    "changed": false, 
    "msg": "Reading package lists...\nBuilding dependency tree...\nReading state information...\nCalculating upgrade...\n0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.\n", 
    "stderr": "", 
    "stdout": "Reading package lists...\nBuilding dependency tree...\nReading state information...\nCalculating upgrade...\n0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.\n", 
    "stdout_lines": [
        "Reading package lists...", 
        "Building dependency tree...", 
        "Reading state information...", 
        "Calculating upgrade...", 
        "0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded."
    ]
}
@ghost

This comment has been minimized.

Show comment
Hide comment
@ghost

ghost Jul 31, 2016

A better choice would be apt-get. Neither do Debian 7/8 minimals come with aptitude.

I don't recommend using "apt" that seems to be getting popular lately.

Debian 6/Squeeze, even though EOL, doesn't recognize apt.

Eg:

Spawning container squeeze on /home/user/.containers/debian/old-debian-releases/squeeze.
Press ^] three times within 1s to kill container.
/etc/localtime is not a symlink, not updating container timezone.
root@squeeze:~# apt update
-bash: apt: command not found
root@squeeze:~# apt-get update
Hit http://archive.debian.org squeeze Release.gpg
Ign http://archive.debian.org/debian/ squeeze/main Translation-en
Hit http://archive.debian.org squeeze-lts Release.gpg
Ign http://archive.debian.org/debian/ squeeze-lts/main Translation-en
Hit http://archive.debian.org squeeze Release
Hit http://archive.debian.org squeeze-lts Release
Hit http://archive.debian.org squeeze/main i386 Packages
Ign http://archive.debian.org squeeze-lts/main i386 Packages/DiffIndex
Hit http://archive.debian.org squeeze-lts/main i386 Packages
Reading package lists... Done
root@squeeze:~#

ghost commented Jul 31, 2016

A better choice would be apt-get. Neither do Debian 7/8 minimals come with aptitude.

I don't recommend using "apt" that seems to be getting popular lately.

Debian 6/Squeeze, even though EOL, doesn't recognize apt.

Eg:

Spawning container squeeze on /home/user/.containers/debian/old-debian-releases/squeeze.
Press ^] three times within 1s to kill container.
/etc/localtime is not a symlink, not updating container timezone.
root@squeeze:~# apt update
-bash: apt: command not found
root@squeeze:~# apt-get update
Hit http://archive.debian.org squeeze Release.gpg
Ign http://archive.debian.org/debian/ squeeze/main Translation-en
Hit http://archive.debian.org squeeze-lts Release.gpg
Ign http://archive.debian.org/debian/ squeeze-lts/main Translation-en
Hit http://archive.debian.org squeeze Release
Hit http://archive.debian.org squeeze-lts Release
Hit http://archive.debian.org squeeze/main i386 Packages
Ign http://archive.debian.org squeeze-lts/main i386 Packages/DiffIndex
Hit http://archive.debian.org squeeze-lts/main i386 Packages
Reading package lists... Done
root@squeeze:~#

@alikins alikins added the bug_report label Aug 1, 2016

@alikins

This comment has been minimized.

Show comment
Hide comment
@alikins

alikins Aug 1, 2016

Contributor

This appears to be a submission about a module ('apt' from ansible-modules-core).

We would appreciate if you can submit this there (https://github.com/ansible/ansible-modules-core)
instead. (If we move it, the owner of the issue resets to ansible instead of you).

Contributor

alikins commented Aug 1, 2016

This appears to be a submission about a module ('apt' from ansible-modules-core).

We would appreciate if you can submit this there (https://github.com/ansible/ansible-modules-core)
instead. (If we move it, the owner of the issue resets to ansible instead of you).

@alikins alikins closed this Aug 1, 2016

@YPCrumble

This comment has been minimized.

Show comment
Hide comment
@YPCrumble

YPCrumble Sep 12, 2016

@merifri did you add this as an issue yet? Having the same problem, happy to add but don't want to create a duplicate.

YPCrumble commented Sep 12, 2016

@merifri did you add this as an issue yet? Having the same problem, happy to add but don't want to create a duplicate.

@merifri

This comment has been minimized.

Show comment
Hide comment
@merifri

merifri commented Sep 13, 2016

@YPCrumble no, I found similar issue: ansible/ansible-modules-core#3523

@mamoit

This comment has been minimized.

Show comment
Hide comment
@mamoit

mamoit Dec 8, 2016

The issue ansible/ansible-modules-core#3523 has been closed since the bug tracking moved here.
This issue should be re-opened @alikins.

mamoit commented Dec 8, 2016

The issue ansible/ansible-modules-core#3523 has been closed since the bug tracking moved here.
This issue should be re-opened @alikins.

@dev169

This comment has been minimized.

Show comment
Hide comment
@dev169

dev169 Dec 13, 2016

@mamoit @alikins I think this should be marked a duplicate of #18987 (which was migrated from ansible/ansible-modules-core#3523). I will continue discussion there.

dev169 commented Dec 13, 2016

@mamoit @alikins I think this should be marked a duplicate of #18987 (which was migrated from ansible/ansible-modules-core#3523). I will continue discussion there.

@pharazon

This comment has been minimized.

Show comment
Hide comment
@pharazon

pharazon Jan 8, 2017

Lol makes me think what is the benefit of ansible over a bash script. I make a simple ansible playbook to upgrade my servers, but it turns out ansible core is broken and doesn't support Ubuntu (or Debian).

pharazon commented Jan 8, 2017

Lol makes me think what is the benefit of ansible over a bash script. I make a simple ansible playbook to upgrade my servers, but it turns out ansible core is broken and doesn't support Ubuntu (or Debian).

@michaelBenin

This comment has been minimized.

Show comment
Hide comment
@michaelBenin

michaelBenin Jan 17, 2017

Is this fixed in 2.2.0?

michaelBenin commented Jan 17, 2017

Is this fixed in 2.2.0?

@merifri

This comment has been minimized.

Show comment
Hide comment
@merifri

merifri Jan 17, 2017

@michaelBenin No. Issue with apt module: #18987

merifri commented Jan 17, 2017

@michaelBenin No. Issue with apt module: #18987

@sonjz

This comment has been minimized.

Show comment
Hide comment
@sonjz

sonjz Feb 7, 2017

based on: ansible/ansible-modules-core#3523 (comment)

Added this early in the bootstrap to reenable apt (you can remove the becomes if you do that elsewhere)

- name: "FIX: Ubuntu 16.04 LTS doesn't come with certain modules, required by ansible"
  raw: apt-get install python-minimal aptitude -y
  become: true
  become_user: root
  become_method: sudo

sonjz commented Feb 7, 2017

based on: ansible/ansible-modules-core#3523 (comment)

Added this early in the bootstrap to reenable apt (you can remove the becomes if you do that elsewhere)

- name: "FIX: Ubuntu 16.04 LTS doesn't come with certain modules, required by ansible"
  raw: apt-get install python-minimal aptitude -y
  become: true
  become_user: root
  become_method: sudo

@ansibot ansibot added bug and removed bug_report labels Mar 7, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment