Provisioning failure - all hosts have already failed

I am new to Bedrock.

I am on WIN8.1 (not by choice :()and after hitting one wall after another I am now at the point where I get this error during provisioning, please see below:

==> default: TASK: [wordpress-install | Create .env file] **********************
==> default: failed: [vagrant] => (item={'key': '', 'value': {'site
_install': True, 'admin_user': 'admin', 'local_path': '../', 'syste
m_cron': True, 'repo': '', 'ssl': {'enabled': Fa
lse}, 'multisite': {'enabled': False, 'subdomains': False}, 'site_title': 'local
dev1 Site', 'admin_password': 'admin', 'env': {'db_name': 'localdev1_dev', 'wp_e
nv': 'development', 'db_user': 'localdev1_dbuser', 'db_password': 'localdev1_dbp
assword', 'wp_home': '', 'wp_siteurl': '
/wp'}, 'site_hosts': [''], 'admin_email': ''}})
=> {"failed": true, "item": {"key": "", "value": {"admin_email": "a", "admin_password": "admin", "admin_user": "admin", "env": {"
db_name": "localdev1_dev", "db_password": "localdev1_dbpassword", "db_user": "lo
caldev1_dbuser", "wp_env": "development", "wp_home": "", "wp
_siteurl": ""}, "local_path": "../", "multis
ite": {"enabled": false, "subdomains": false}, "repo": "
rock.git", "site_hosts": [""], "site_install": true, "site_title":
"localdev1 Site", "ssl": {"enabled": false}, "system_cron": true}}}
==> default: msg: Could not replace file: /root/.ansible/tmp/ansible-tmp-1429691
400.4-145743800409621/source to /srv/www/ [Errno 26]
Text file busy
==> default:
==> default: FATAL: all hosts hav
==> default: e already failed -- aborting
==> default:
==> default: PLAY RECAP ********************************************************
==> default:            to retry, use: --limit @/root/dev.retry
==> default:
==> default: vagrant                    : ok=68   changed=38   unreachable=0


I am unsure if this is related to FATAL: all hosts have already failed

I assume that I don’t HAVE to use HHVM to get around this issue? (Assuming that it is indeed the same issue as in the link above).

Anyway I did try using HHVM and including the workaround referenced in the above link (I also destroyed the machine when switching between HHVM true/false as per Foxaii’s post here Cannot connect to database).

Below is that workaround:

 Solution/workaround for directory permissions in Vagrantfile when using HHVM:


config.bindfs.bind_folder nfs_path(name), remote_site_path(name), u: 'vagrant', g: 'www-data'


config.bindfs.bind_folder nfs_path(name), remote_site_path(name), u: 'vagrant', g: 'www-data', :'create-as-user' => true, :perms => "u=rwx:g=rwx:o=rx", :'create-with-perms' => "u=rwx:g=rwx:o=rx", :'chown-ignore' => true, :'chgrp-ignore' => true, :'chmod-ignore' => true

That lets group write to directories. Probably not the best solution, would love to hear opinions for something better.

However I still received the same error.

Any troubleshooting tips or general suggestions/ideas would be greatly appreciated!

Thank you,


[Errno 26] Text file busy
I haven’t seen this error before. After a quick search, it seems windows users have this error occasionally with Ansible and vagrant, especially with ansible’s template module, which is used in the task where you got the error.

You might research that a bit and let us know what leads you come up with. Maybe you’ve looked into that already? I fear it could be one of those issues where there’s no consensus on the fix and everyone’s got their own little trick workaround.

Yes my initial findings were the same as yours, i.e. there seems to be no consensus, I was hoping this was not the case.

Thank you for the info and the link, I will keep digging and let you know what I come up with.


1 Like

Ok, after having some sleep, I doubt that my issue is related to FATAL: all hosts have already failed which therefore accounts for receiving my original error after applying the ‘workaround’ related to the issue in the link… :stuck_out_tongue:

@Craig it sounds like you’ve done a lot of work to get this going. I’m glad you plan to keep digging. I admire that. It seems that windows users do get bedrock-ansible working, so hang in there.

If you haven’t recently tried a complete vagrant destroy to start from scratch with your latest and best settings, definitely try it. That will often resolve obscure issues that otherwise linger after multiple failed vagrant up s. You could also double-check that you have the latest Ansible, Vagrant etc., but you’ve probably done that already.

1 Like

@fullyint you were right the issue was in the code that you linked to and so inspired by jensenbox’s comment here:

  jensenbox commented 27 days ago

          @bcoca I think I have at least narrowed down the problem to something that is mildly fixable...

So it is in fact a 'cross partition' issue. The template task is 
creating a temp file of the result in the current users home directory 
and then doing an atomic os.rename.

Because /vagrant is technically on a different filesystem it is failing - but with what I suspect to be an invalid error code. 

msg: Could not replace file: /root/.ansible/tmp/ansible-tmp-1427476564.34-155580542794406/source to /vagrant/src/officepools/ [Errno 26] Text file busy

There are two points in the following code that could be returning the same error here:

I even went as far to have the templated file store its result on the
 current posix filesystem then copy the file to the non-posix directory 
and the copy function fails as well. Pretty much the same error:

msg: Could not replace file: /root/.ansible/tmp/ansible-tmp-1427477026.96-38878336250870/source to /vagrant/src/officepools/ [Errno 26] Text file busy

Turns out that they are both using the exact same module base (nice and DRY)

So I tried the 'command' to have the os move it and all was good.


- template: dest="{{ directories.src }}/{{ names.codename }}/"

becomes this:

- template: dest=/root/
- command: mv /root/ {{ directories.src }}/{{ names.codename }}/

and all is good. 

Seems like Ansible could be modified pretty easily to fix at least this corner case.

In main.yml (C:\localdev1\bedrock-ansible\roles\wordpress-install\tasks\main.yml), I changed this:

- name: Create .env file
  template: src="env.j2"
            dest="{{ www_root }}/{{ item.key }}/current/.env"
            owner="{{ web_user }}"
            group="{{ web_group }}"
  with_dict: wordpress_sites

To this:

- name: Create .env file
  template: src="env.j2"
            owner="{{ web_user }}"
            group="{{ web_group }}"
  with_dict: wordpress_sites

- name: Move .env file
  command: mv "../.env.temp" "{{ www_root }}/{{ item.key }}/current/.env"
  with_dict: wordpress_sites

Now provisioning completes and I can view my theme/site in my host machine browser. I do wonder if this method is similar to what others have employed?

1 Like

@fullyint how kind, thank you.

To be honest I have to work hard to make up for a lack of talent…

Yes I had employed vagrant destroy and verified versions.

Thank you for your help!


great work @Craig

A number of other tasks in bedrock-ansible use Ansible’s template module but apparently don’t exhibit the same problem for you. This problematic instance may differ from the others in that it it is manipulating a dotfile and declares the owner parameter. However, those characteristics were absent from the example you excerpted from the other thread, so they’re probably irrelevant.

1 Like

@fullyint Thank you.

While I haven’t had the time to fully dig into this workaround I feel that the other example I linked to is probably unrelated and so therefor it is possible that you are heading in the right direction.

Use /tmp/.env.temp rather than …/.env.temp

Edit: main.yml has now been updated to this , however I learned the hard way :stuck_out_tongue: