ansible_local provisioning fails with `ubuntu/xenial64` box due to missing synced folder #7463

Closed
DmitryRomanenko opened this Issue Jun 16, 2016 · 6 comments

Comments

Projects
None yet
4 participants

DmitryRomanenko commented Jun 16, 2016

Vagrant version

Vagrant 1.8.4

Host operating system

Windows 10

Guest operating system

Box ubuntu/xenial64 is up to date.
That's the latest LTS version of most popular Linux distro.

Vagrantfile

Vagrant.configure(2) do |config|
  config.vm.box = "ubuntu/xenial64"
  config.vm.provision "ansible_local" do |ansible|
    ansible.playbook = "dev.yml"
  end
end

Debug output

https://gist.github.com/DmitryRomanenko/ce4c70a75aa0c782c45f36bc74b9f052

Expected behavior

dev.yml is executed (near Vagrantfile)

Actual behavior

``playbookdoes not exist on the guest: /vagrant/dev.yml

Steps to reproduce

  1. Create dev.yml with any content and Vagrantfile
  2. vagrant up

References

Collaborator

gildegoma commented Jun 16, 2016

@DmitryRomanenko

I guess you're hitting a bug in this ubuntu/xenial64 base box. See for instance https://bugs.launchpad.net/cloud-images/+bug/1565985

As you reported in mitchellh#6740 (comment), the same steps work fine with an other base box (geerlingguy/ubuntu1604).
I haven't catched any specific warning or error in your vagrant.log gist, but I'm pretty sure that the /vagrant shared directory is not mounted in the failing case.

Can you first please login into the ubuntu/xenial64 machine (via vagrant ssh) and manually verify the presence of /vagrant/dev.yml file?

You can also give a try with ubuntu/trusty64 to compare...

@gildegoma gildegoma self-assigned this Jun 16, 2016

DmitryRomanenko commented Jun 16, 2016

Yes, it works with geerlingguy/ubuntu1604 or ubuntu/trusty64.

but I'm pretty sure that the /vagrant shared directory is not mounted in the failing case (ubuntu/xenial64)

You are right. There is no /vagrant directory, I've checked it using ssh.

Collaborator

gildegoma commented Jun 17, 2016

Closing as this is problem is specific to the current state of ubuntu/xenial64 and ubuntu/xenial32 base boxes.


The ansible_local provisioner assumes that all the required files are available on the guest system, usually by relying a shared directory between the Vagrant host and guest. See also the provisioning_path option in https://www.vagrantup.com/docs/provisioning/ansible_local.html.

@gildegoma gildegoma closed this Jun 17, 2016

@gildegoma gildegoma added the upstream label Jun 17, 2016

@gildegoma gildegoma changed the title from ansible_local: `playbook` does not exist on the guest: /vagrant/dev.yml to ansible_local provisioning fails with `ubuntu/xenial64` box due to missing synced folder Jun 17, 2016

semiosis commented Jun 24, 2016

FYI for anyone interested, I proposed a fix for ubuntu. You can follow in the launchpad bug. Please upvote the bug if any of these issues in the official Xenial vagrant box affect you:

  • Missing virtualbox guest additions
  • Missing config management packages puppet & chef
  • Can only run one instance per host because of vm name
  • Box doesn't have default /vagrant synced folder
Contributor

sethvargo commented Jun 24, 2016

Or you could just use the bento/ubuntu-16.04 boxes which work much better 99% of the time 😄

semiosis commented Sep 7, 2016

The latest ubuntu xenial box fixes this problem.

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