hashicorp/vagrant

Ansible Provisioner does not work with bento/ubuntu-18.04

aidanmelen opened this issue · 3 comments

Reproduce issue with the following...

Vagrant version

$ vagrant -v
Vagrant 2.1.1

Host operating system

Mac OS Sierra

Guest operating system

bento/ubuntu-18.04

Vagrantfile

Vagrant.configure("2") do |config|
  config.vm.box = "bento/ubuntu-18.04"
  config.vm.provider :virtualbox do |vb, override|
    vb.memory = 1024
    vb.cpus = 1
  end

  config.vm.define "sre", primary: true do |sre|
    sre.vm.hostname = "sre"
    sre.vm.provision "ansible_local" do |ansible|
      ansible.playbook = "provision/site.yml"
      ansible.install_mode = "default"
      ansible.become = true
      ansible.compatibility_mode = "2.0"
    end
  end

  # Sychronize awscli and openssh credentials and configuration from host to guest.
  config.vm.synced_folder "~/.aws", "/home/vagrant/.aws", type: "rsync", rsync__exclude: ['assume_role']
  config.vm.synced_folder "~/.ssh", "/home/vagrant/.ssh", type: "rsync", rsync__exclude: ['authorized_keys', 'config.d/*', 'config'], privileged: true
end

Debug output

$ vup
Bringing machine 'sre' up with 'virtualbox' provider...
==> sre: Importing base box 'bento/ubuntu-18.04'...
==> sre: Matching MAC address for NAT networking...
==> sre: Checking if box 'bento/ubuntu-18.04' is up to date...
==> sre: Setting the name of the VM: ansible-local-env_sre_1535658793231_24593
==> sre: Clearing any previously set network interfaces...
==> sre: Preparing network interfaces based on configuration...
    sre: Adapter 1: nat
==> sre: Forwarding ports...
    sre: 22 (guest) => 2222 (host) (adapter 1)
==> sre: Running 'pre-boot' VM customizations...
==> sre: Booting VM...
==> sre: Waiting for machine to boot. This may take a few minutes...
    sre: SSH address: 127.0.0.1:2222
    sre: SSH username: vagrant
    sre: SSH auth method: private key
    sre:
    sre: Vagrant insecure key detected. Vagrant will automatically replace
    sre: this with a newly generated keypair for better security.
    sre:
    sre: Inserting generated public key within guest...
    sre: Removing insecure key from the guest if it's present...
    sre: Key inserted! Disconnecting and reconnecting using new SSH key...
==> sre: Machine booted and ready!
==> sre: Checking for guest additions in VM...
    sre: The guest additions on this VM do not match the installed version of
    sre: VirtualBox! In most cases this is fine, but in rare cases it can
    sre: prevent things such as shared folders from working properly. If you see
    sre: shared folder errors, please make sure the guest additions within the
    sre: virtual machine match the version of VirtualBox you have installed on
    sre: your host and reload your VM.
    sre:
    sre: Guest Additions Version: 5.2.12
    sre: VirtualBox Version: 5.0
==> sre: Setting hostname...
==> sre: Rsyncing folder: /Users/aidanmelen/.aws/ => /home/vagrant/.aws
==> sre:   - Exclude: [".vagrant/", "assume_role"]
==> sre: Rsyncing folder: /Users/aidanmelen/.ssh/ => /home/vagrant/.ssh
==> sre:   - Exclude: [".vagrant/", "authorized_keys", "config.d/*", "config"]
==> sre: Mounting shared folders...
    sre: /vagrant => /Users/aidanmelen/SiteReliabilityEngineering/ansible-local-env
==> sre: Running provisioner: ansible_local...
    sre: Installing Ansible...
The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!

apt-get install -y -qq software-properties-common python-software-properties

Stdout from the command:



Stderr from the command:

E: Package 'python-software-properties' has no installation candidate

Expected behavior

Ansible should be installed on Vagrant VM.

Actual behavior

E: Package 'python-software-properties' has no installation candidate

Steps to reproduce

  1. create a simple playbook called site.yml
  2. run vagrant up

References

None at the moment

You need to install software-properties-common instead of python-software-properties on ubuntu-18.

This problem has been resolved in Vagrant 2.1.2. See #9796 and #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.