Repository navigation
Provisioning issues with ansible on windows #138
Description
Hey all,
Wondering if any of you have run into a similar error when provisioning a machine.
I'm using Windows 7, cygwin, virtualbox 4.3.14, vagrant 1.6.4 and genesis-wordpress 0.2.55
(Yes, I would rather be using a unix machine, but I don't have that luxury for this project :)
I get through booting the VM, but then it barfs claiming a permissions issue that I cannot reconcile:
<snip>
==> local: Updating /etc/hosts file on active guest machines...
==> local: Updating /etc/hosts file on host machine (password may be required)...
==> local: Running provisioner: hostmanager...
==> local: Running provisioner: shell...
local: Running: inline script
==> local: stdin: is not a tty
==> local: dpkg-preconfigure: unable to re-open stdin: No such file or directory
==> local: Selecting previously unselected package software-properties-common.
==> local: (Reading database ...
==> local: 66829 files and directories currently installed.)
==> local: Unpacking software-properties-common (from .../software-properties-common_0.82.7.7_all.deb) ...
==> local: Setting up software-properties-common (0.82.7.7) ...
==> local: dpkg-preconfigure: unable to re-open stdin: No such file or directory
==> local: Selecting previously unselected package python-markupsafe.
==> local: (Reading database ...
==> local: 66843 files and directories currently installed.)
==> local: Unpacking python-markupsafe (from .../python-markupsafe_0.15-1_i386.deb) ...
==> local: Selecting previously unselected package python-jinja2.
==> local: Unpacking python-jinja2 (from .../python-jinja2_2.6-1ubuntu0.1_i386.deb) ...
==> local: Selecting previously unselected package sshpass.
==> local: Unpacking sshpass (from .../sshpass_1.05-1_i386.deb) ...
==> local: Selecting previously unselected package python-setuptools.
==> local: Unpacking python-setuptools (from .../python-setuptools_0.6.24-1ubuntu1_all.deb) ...
==> local: Selecting previously unselected package ansible.
==> local: Unpacking ansible (from .../ansible_1.7.1-precise-unstable-ppa_all.deb) ...
==> local: Processing triggers for man-db ...
==> local: Setting up python-markupsafe (0.15-1) ...
==> local: Setting up python-jinja2 (2.6-1ubuntu0.1) ...
==> local: Setting up sshpass (1.05-1) ...
==> local: Setting up python-setuptools (0.6.24-1ubuntu1) ...
==> local: Setting up ansible (1.7.1-precise-unstable-ppa) ...
==> local: Processing triggers for python-support ...
==> local: ERROR: The file localhost is marked as executable, but failed to execute correctly. If this is not supposed to be an executable script, correct this with `chmod -x localhost`.
The SSH command responded with a non-zero exit status. Vagrant
assumes that this means the command failed. The output for this command
should be in the log above. Please read the output to determine what
went wrong.
I assume we're talking about /provisioning/localhost, but as it states, it is not executable outside the vm, but inside, it is. I assume this has to do with using nfs as the sharing filesystem.
I tried forcing the permissions with: mount_options: ["dmode=777", "fmode=666"] but that messes up other files execution.
So, bottom line then, has anyone had experience running/provisioing genesis-wordpress on a windows box that may have had similar issues?
Thanks!
Activity
mcheck commentedon Sep 11, 2014
This is still an issue for me, but I got around it for now by not provisioning on the windows box. I provisioned on mac and then packaging a vagrant box. The windows box has no problems running the pre-packaged vagrant box. Long live vagrant!
AntJanus commentedon Sep 25, 2014
@mcheck I'm on a Windows machine now so I'm figuring stuff out, hopefully I'll be able to help! :)
mcheck commentedon Sep 26, 2014
@AntJanus I never did get it to work to provision on windows.
I found that it seemed like a 64bit issue so I started down the path of looking at the bios to make sure support for VT-x and such was enabled. I tried moving it to 32bit, but still no luck.
I ended up provisioning on my mac and creating a vagrant package that I could pick up on the PC. Once I pulled in the customized vagrant package to windows, all worked swimmingly - in 64bit no less.
So possibly something with ansible and the way permissions are done between virtual vagrant shares. But once provisioned, works well.
If you come across any hurdles, let me know, I'll try to help where I can.
ericclemmons commentedon Sep 26, 2014
@mcheck I've considered this for Evolution (the next, better iteration of Genesis), but what do you think?
This would mean big VM sizes (boo), but would mean that if a user wanted to get up-and-going ASAP, having the VM ready would mean much faster initial project creations.
Thoughts?
mcheck commentedon Sep 26, 2014
@AntJanus @ericclemmons
I think a vagrant box image is a great idea. When I started using Genesis, the provisioning part was the hardest to get past and configured. I sure learned a lot hacking at it, and I think that's where we came up with changes to apache and varnish, etc. BUT an image would certainly speed things up and, I would guess, increase the number of developers trying it out.
Perhaps Genesis/Evolution can be hosted on vagrantcloud.com ? Not totally sure, but I think open source projects can have multiple boxes on there. And you would get a cool url pull from in the vagrantfile like evolution/wordpress :)
AntJanus commentedon Oct 9, 2014
@mcheck @ericclemmons that totally makes sense. So the issue is, I found out, is the way that VirtualBox syncs files. It completely ignores permissions (when on Windows) which causes Ansible to throw that error. There are several workarounds for it:
622during the provisioning (I got that off another Vagrant project)I'm going ahead and creating a box in a linux box I'm running and then pulling it down onto Windows
ericclemmons commentedon Oct 9, 2014
That
622note is the way to go, IMO. Already,genesis:sshchmod's theid_rsato600, because Git doesn't respect permissions, but it makes sense to enforce this...TimonVS commentedon Oct 27, 2014
Are there any plans on implementing this "fix"? I'd really like to be able to use this generator on Windows until I get my MacBook next year.
EvanK commentedon May 1, 2015
@AntJanus Do you recall if this
622permission was necessary for all provisioning files, or just the inventory?Skynet2029 commentedon May 27, 2015
pls fix this for Win users.
EvanK commentedon May 28, 2015
There is a totally untested fix for this (since I don't currently have access to a Windows machine), on the 138-provisiong-win-permhack branch.
Feedback is welcome
EvanK commentedon May 28, 2015
Update: first commit on that branch actually broke on OSX/POSIX...so I doubt it fixed the issue in Windows. Second commit (b9faec7) has promise though
Skynet2029 commentedon May 29, 2015
Sorry but this patch does not work for me. The same error occurred.
virtualbox 4.3.12, vagrant 1.6.5
EvanK commentedon Jun 1, 2015
@TeodorMarinov Can you ssh into the vagrant machine and post what you get from
ls -al /vagrant/provisioning/?Skynet2029 commentedon Jun 1, 2015
EvanK commentedon Jun 2, 2015
One last try! In 88c69f9 we are actually copying the inventory file to a wholly separate and NOT synced location, resetting its permissions, and then specifying it as the inventory for ansible to use.
@TeodorMarinov Please try this out, and if it fails, let me know what output you get from
ls -al /tmp/ansible-inventory-localhostAntJanus commentedon Jun 3, 2015
@EvanK I battled with that for a while. I wonder how this will turn out. At some point, I gave up and started dual-booting with Linux.
EvanK commentedon Jun 3, 2015
@AntJanus Yeah, this is frustrating, even for a platform we don't "officially" support.
Evolution is using native Ansible provisioning, so hopefully won't suffer from this bug. And I'm currently working on a simpler upgrade path to Evolution, at which point we can retire Genesis once and for all.
AntJanus commentedon Jun 23, 2016
Hey guys, I know this is a year too late but I figured out what to do. The
localhostfile is the issue but it's super-easy to remedy by altering it to be an executable Ruby script (host files can be executable!) like so: