Vagrant: Ansible Local Provision fails to install from PPA on Ubuntu 18.04 LTS (Bionic Beaver)

Created on 7 May 2018  ยท  5Comments  ยท  Source: hashicorp/vagrant

I run "ansible_local". I get " Package python-software-properties has no installation candidate" while I "vagrant up". I think this package is obsolete.Is there a way to make "ansible_local" ignore this package?

Vagrant version

Installed Version: 2.0.4

Host operating system

Windows 10

Guest operating system

Ubuntu-18.04

Expected behavior

Run "ansible_local" provisioner after successfully installing ansible on Ubuntu-18.04

Actual behavior

trying to install obsolete package

Steps to reproduce

1.Vagrant up

bug guesubuntu has-pr provisioneansible_local

Most helpful comment

I ran into this as well, using Chef's bento/ubuntu-18.04 image, though my host is macOs.

It looks like the problem is that Ubuntu 18 has renamed that package to python3-software-properties, but Vagrant's Ubuntu guest provisioner is quietly installing python-software-properties and software-properties-common, in order to get the add-apt-repository program so that it can add the ansible/ansible PPA.

Ubuntu 18, however, seems to ship with add-apt-repository already installed, so it seems like the appropriate fix in Vagrant is to check to see if that program already exists, and if not, then install the appropriate packages.

In the short term, I worked around this by specifying in my Vagrantfile that I want Ansible to be installed via pip: ansible.install_mode = "pip"

All 5 comments

I ran into this as well, using Chef's bento/ubuntu-18.04 image, though my host is macOs.

It looks like the problem is that Ubuntu 18 has renamed that package to python3-software-properties, but Vagrant's Ubuntu guest provisioner is quietly installing python-software-properties and software-properties-common, in order to get the add-apt-repository program so that it can add the ansible/ansible PPA.

Ubuntu 18, however, seems to ship with add-apt-repository already installed, so it seems like the appropriate fix in Vagrant is to check to see if that program already exists, and if not, then install the appropriate packages.

In the short term, I worked around this by specifying in my Vagrantfile that I want Ansible to be installed via pip: ansible.install_mode = "pip"

Ansible getting "mainstream" software without any doubt now, I think we'll better ditch the ansible/ansible PPA and rely on the default ubuntu repos (similarly to all other supported linux distros). For version selection, the pip install mode will be recommended.

After a few more verifications, I notice that:

  • Ansible packaging in default ubuntu LTS repos is still freezed, and therefore the interest to stick to the ppa repo to install latest release remains.
  • As of Ubuntu 14.04+, only the package software-properties-common is required to get add-apt-repository operational.
  • @drewcking comments are right (we could optimize by first checking whether add-apt-repository is already available, and only install package if necessary)

In conclusion: I'll provide a patch for the next Vagrant release

There is a proposal to fix this issue in #9879.

I'm going to lock this issue because it has been closed for _30 days_ โณ. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

Was this page helpful?
0 / 5 - 0 ratings