Vagrant up gives "playbook does not exist on the guest" on Windows 10
Issue Type
-
Bug Report / Support Request
Your Environment
Vagrant 1.9.5
vbox 5.1.22r115126
'ansible' is not recognized as an internal or external command
Your OS
- Windows 10 Enterprise Edition
Full console output
Summary
The organization I work for uses DrupalVM with BLT dependencies for their project. I have been trying to set up the drupal environment locally. But everytime I run vagrant up, initally an nfs page pops up. then it closes and i get the error: playbook does not exist on the guest: /vagrant/vendor/geerlingguy/drupal-vm/provisioning/playbook.yml
It uses the geerlingguy/ubuntu1404 vbox
By now I am guessing it has to do with ansible, as i can see that I can't retrieve the version. Can you suggest what I need to do to fix it
Thanks for the question! I wonder if this might be related to using NFS for the shared folder mount (maybe it's not working correctly).
Can you try setting in your config.yml file the following:
vagrant_synced_folder_default_type: ''
Then do a vagrant halt and vagrant up --provision.
Sorry that didn't help. Posting below what happens when I do a 'vagrant up'
==> cgi: Checking for guest additions in VM... ==> cgi: [vagrant-hostsupdater] Checking for host entries ==> cgi: [vagrant-hostsupdater] Writing the following entries to (C:/Windows/system32/drivers/etc/hosts) ==> cgi: [vagrant-hostsupdater] 192.168.25.8 local8.cgi.com # VAGRANT: 6d8ebfe5bf7e99d7a94a6fce82671d24 (cgi) / 5a496865-7555-409e-b36e-c90ecb8da168 ==> cgi: [vagrant-hostsupdater] 192.168.25.8 www.local8.cgi.com # VAGRANT: 6d8ebfe5bf7e99d7a94a6fce82671d24 (cgi) / 5a496865-7555-409e-b36e-c90ecb8da168 ==> cgi: [vagrant-hostsupdater] 192.168.25.8 adminer.local8.cgi.com # VAGRANT: 6d8ebfe5bf7e99d7a94a6fce82671d24 (cgi) / 5a496865-7555-409e-b36e-c90ecb8da168 ==> cgi: [vagrant-hostsupdater] 192.168.25.8 xhprof.local8.cgi.com # VAGRANT: 6d8ebfe5bf7e99d7a94a6fce82671d24 (cgi) / 5a496865-7555-409e-b36e-c90ecb8da168 ==> cgi: [vagrant-hostsupdater] 192.168.25.8 pimpmylog.local8.cgi.com # VAGRANT: 6d8ebfe5bf7e99d7a94a6fce82671d24 (cgi) / 5a496865-7555-409e-b36e-c90ecb8da168 ==> cgi: [vagrant-hostsupdater] 192.168.25.8 dashboard.local8.cgi.com # VAGRANT: 6d8ebfe5bf7e99d7a94a6fce82671d24 (cgi) / 5a496865-7555-409e-b36e-c90ecb8da168 ==> cgi: [vagrant-hostsupdater] This operation requires administrative access. You may skip it by manually adding equivalent entries to the hosts file. ==> cgi: Setting hostname... ==> cgi: Configuring and enabling network interfaces... ==> cgi: Exporting NFS shared folders... ==> cgi: Preparing to edit nfs mounting file. [NFS] Status: halted [NFS] Start: started ==> cgi: Mounting NFS shared folders... The following SSH command responded with a non-zero exit status. Vagrant assumes that this means the command failed!
mount -o vers=3,udp 192.168.25.1:/F/www/cgicom /var/www/cgi
Stdout from the command:
Stderr from the command:
mount.nfs: Connection timed out
and then it's back again to the same error:
λ vagrant provision
==> cgi: [vagrant-hostsupdater] Checking for host entries
==> cgi: [vagrant-hostsupdater] found entry for: 192.168.25.8 local8.cgi.com
==> cgi: [vagrant-hostsupdater] found entry for: 192.168.25.8 www.local8.cgi.com
==> cgi: [vagrant-hostsupdater] found entry for: 192.168.25.8 adminer.local8.cgi.com
==> cgi: [vagrant-hostsupdater] found entry for: 192.168.25.8 xhprof.local8.cgi.com
==> cgi: [vagrant-hostsupdater] found entry for: 192.168.25.8 pimpmylog.local8.cgi.com
==> cgi: [vagrant-hostsupdater] found entry for: 192.168.25.8 dashboard.local8.cgi.com
==> cgi: Configuring cache buckets...
==> cgi: Running provisioner: ansible_local...
playbook does not exist on the guest: /vagrant/vendor/geerlingguy/drupal-vm/provisioning/playbook.yml
NFS is supposed to work on windows nowadays?
Hi. I managed to fix it. I can't be very sure what exactly did it, as I was just trying out different suggestions from the web. But if anyone does get stuck like me, I'd like to mention some of the extra steps I did.
-
I am not sure what this does exactly, but adding a line ansible.limit = "all" under the line ansible.playbook = playbook in my Vagrantfile helped.
-
A couple of colleagues just cloned the repository, followed through a composer install, and did a vagrant up and it worked for them. Since it didn't for me, I followed these extra steps from the tutorial jeff made a while back (Link Below): https://www.jeffgeerling.com/blog/2017/drupal-vm-on-windows-fast-container-blt-project-development Extra steps followed: Create a shell script to create your project's directory and set it's permissions correctly:
touch examples/scripts/setup.sh Open your editor of choice (e.g. Notepad++) and edit setup.sh (be sure to use Unix line endings!):
#!/bin/bash mkdir -p /var/www/projectname chown vagrant:vagrant /var/www/projectname Create a config.yml file: touch config.yml Open your editor of choice (e.g. Notepad++) and edit config.yml (be sure to use Unix line endings!)—also make sure the drupal_deploy_repo varaible is set to the correct GitHub repository you want to use as your origin remote:
---
vagrant_synced_folders: []
vagrant_synced_folder_default_type: ""
vagrant_hostname: local.projectname.com
vagrant_machine_name: projectname
vagrant_ip: 192.168.88.25
drupal_deploy: true
drupal_deploy_repo: "[email protected]:github-username/projectname.git"
drupal_deploy_version: master
drupal_deploy_update: true
drupal_deploy_dir: "/var/www/projectname"
drupal_deploy_accept_hostkey: yes
drupal_core_path: "{{ drupal_deploy_dir }}/docroot"
ssh_home: "{{ drupal_deploy_dir }}"
drupal_build_composer: false
drupal_composer_path: false
drupal_build_composer_project: false
drupal_install_site: false
firewall_allowed_tcp_ports:
- "22"
- "25"
- "80"
- "81"
- "443"
- "4444"
- "8025"
- "8080"
- "8443"
- "8983"
- "9200"
# For reverse-mount Samba share.
- "137"
- "138"
- "139"
- "445"
# Run the setup script.
pre_provision_scripts:
- "../examples/scripts/setup.sh"
# BLT-specific overrides.
vagrant_box: geerlingguy/ubuntu1404
drupal_db_user: drupal
drupal_db_password: drupal
drupal_db_name: drupal
configure_drush_aliases: false
# Use PHP 5.6.
php_version: "5.6"
php_packages_extra:
- "php{{ php_version }}-bz2"
- "php{{ php_version }}-imagick"
- imagemagick
nodejs_version: "4.x"
nodejs_npm_global_packages:
- name: bower
- name: gulp-cli
drupalvm_user: vagrant
nodejs_install_npm_user: "{{ drupalvm_user }}"
npm_config_prefix: "/home/{{ drupalvm_user }}/.npm-global"
installed_extras:
- adminer
- drupalconsole
- drush
- mailhog
- nodejs
- selenium
- xdebug
# XDebug configuration.
# Change this value to 1 in order to enable xdebug by default.
php_xdebug_default_enable: 0
php_xdebug_coverage_enable: 0
# Change this value to 1 in order to enable xdebug on the cli.
php_xdebug_cli_enable: 0
php_xdebug_remote_enable: 1
php_xdebug_remote_connect_back: 1
# Use PHPSTORM for PHPStorm, sublime.xdebug for Sublime Text.
php_xdebug_idekey: PHPSTORM
php_xdebug_max_nesting_level: 256
php_xdebug_remote_port: "9000"
It definitely seems like NFS was the issue. Afaik NFS shouldn't even work on Windows, people usually use rsync or samba.
The following lines in your config.yml disabled NFS:
vagrant_synced_folders: []
vagrant_synced_folder_default_type: ""
But now your code wont be synced between the VM and your host machine.
I think i spoke too soon. the issue persists again. I have been troubleshooting this for weeks now. sometimes the playbooks gets installed and sometimes it doesn't. Is there any solution for this? Sorry, I had to reopen this.
It looks like the issue is around your directory where the project you're using is located, maybe. It sounds like you're trying to use Drupal VM as a 'wrapper VM' to download your project inside, is that correct? If so, it's still strange that it's trying to find the Ansible playbook inside the VM, unless I'm reading something wrong.
Hi Jeff. Thanks for the help. I've figured it out, more or less. It's @oxyc comment that got me thinking. NFS was probably causing the issue as it is quite buggy on windows. So I noticed that I was installing a plugin called 'vagrant-winnfsd ' which caused the playbook error to occur. Once I stopped doing that, everything is working fine now. There is a different bug I want help with, but I will put it under a new issue heading. Thanks everyone for the suggestions.
Hi,
Adding this line: vagrant_synced_folder_default_type: "" Did the work for me.
Working on:
- Vagrant 1.8.4
- El Capitan 10.11.6
Thanks!
For me, solution given by @kennethbrenesGL worked with a minor syntax change
I added this line before end in my VagrantFile
vagrant_synced_folder_default_type = ""
Working on:
- Vagrant 2.0.4
- VirtualBox 5.2.0r118431
Path mapping
config.vm.provision "ansible_local" do |ansible|
ansible.playbook = "provisioning/playbook.yml"
end
I've put folder provisioning in the same directory where my VagrantFile resides.
Thanks,
hi @goforgold
$ vagrant provision
==> default: Running provisioner: ansible_local...
default: Running ansible-playbook...
cd /vagrant && PYTHONUNBUFFERED=1 ANSIBLE_NOCOLOR=true ansible-playbook --limit="all" --inventory-file=.vagrant/provisioners/ansible/inventory/vagrant_ansible_inventory --become -v playbook.yml
[WARNING] Ansible is being run in a world writable directory (/vagrant), ignoring it as an ansible.cfg source. For more information see https://
docs.ansible.com/ansible/devel/reference_appendices/config.html#cfg-in-world-writable-dir
Using /etc/ansible/ansible.cfg as config file
PLAY [all] *********************************************************************
TASK [Gathering Facts] *********************************************************
fatal: [default]: UNREACHABLE! => {"changed": false, "msg": "Failed to connect to the host via ssh:
ssh: connect to host 127.0.0.1 port 2222: Con
nection refused", "unreachable": true}
PLAY RECAP *********************************************************************
default : ok=0 changed=0 unreachable=1 failed=0 skipped=0 rescued=0
ignored=0
Ansible failed to complete successfully. Any error output should be
visible above. Please fix these errors and try again.
this is the issue i am getting, also where should i define by ansible.cfg file and what should be the minimal content of this configuration file to run this ansible_local provisioner ?
Hi @abhishekkarigar
I've not touched Ansible and Vagrant from a long time now. I really can't remember what was the issue. But that solution I posted worked for me.
You could post it as a separate issue or wait for other users to response here.
For me, solution given by @kennethbrenesGL worked with a minor syntax change
I added this line before
endin myVagrantFilevagrant_synced_folder_default_type = ""Working on:
- Vagrant 2.0.4
- VirtualBox 5.2.0r118431
Path mapping
config.vm.provision "ansible_local" do |ansible| ansible.playbook = "provisioning/playbook.yml" endI've put folder
provisioningin the same directory where myVagrantFileresides.Thanks,
In your VagrantFile ?
Hi @BenjaminWaye
In your VagrantFile ?
Yes, all changes were in Vagrantfile.