Remote Server Setup on Windows

Whenever I run ansible-playbook server.yml -e env=production in my vagrant box I get the error.

ERROR: problem running /vagrant/hosts/development --list ([Errno 8] Exec format error)

My suspicion is it has something to do with Windows, shared folders, and permission issues which is alluded to here https://github.com/mitchellh/vagrant/issues/713.

@DemaniClassic had a working solution before the “Refactor hosts files” commit.

How can I replicate DemaniClassic’s solution with the new update to the hosts files?

1 Like

In your Vagrantfile, you can try adding the following:

config.vm.synced_folder File.join(ANSIBLE_PATH, 'hosts'), '/vagrant/hosts', owner: 'vagrant', group: 'www-data', mount_options: ['dmode=755', 'fmode=644']

I think that will remove +x from /vagrant/hosts/*

3 Likes

I added

config.vm.synced_folder File.join(ANSIBLE_PATH, ‘hosts’), ‘/vagrant/hosts’, owner: ‘vagrant’, group: ‘www-data’, mount_options: [‘dmode=755’, ‘fmode=644’]

in my vagrantfile and it worked! @QWp6t Thank you so much.

1 Like

Thanks! Worked for me

roots/trellis#460 proposes to add @QWp6t’s solution into Trellis. Could use a few Windows users to test and confirm that it works for their setup.