Roots Discourse

Provision and Deploy to DigitalOcean Droplets from local with Trellis

guide I am following:

hi, I am getting this output when trying to deploy test project to digital ocean:

ansible-playbook server.yml -e env=production
kpoxo6op@DESKTOP-LR23FLP:/mnt/c/temp/Sites/roots-example-project.com/trellis$ ansible-playbook server.yml -e env=production
 [WARNING] Ansible is being run in a world writable directory (/mnt/c/temp/Sites/roots-example-project.com/trellis), 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
 [WARNING]: Unable to parse /etc/ansible/hosts as an inventory source

 [WARNING]: No inventory was parsed, only implicit localhost is available

 [WARNING]: provided hosts list is empty, only localhost is available. Note that the implicit localhost does not match 'all'

ERROR! the role 'swapfile' was not found in /mnt/c/temp/Sites/roots-example-project.com/trellis/roles:/home/kpoxo6op/.ansible/roles:/usr/share/ansible/roles:/etc/ansible/roles:/mnt/c/temp/Sites/roots-example-project.com/trellis

The error appears to have been in '/mnt/c/temp/Sites/roots-example-project.com/trellis/server.yml': line 24, column 7, but may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

    - { role: common, tags: [common] }
    - { role: swapfile, swapfile_size: 1GB, swapfile_file: /swapfile, tags: [swapfile] }
      ^ here

what’s wrong?

[WARNING] Ansible is being run in a world writable directory (/mnt/c/temp/Sites/roots-example-project.com/trellis), 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

This is a common issue w/ WSL, and a documented solution is available in our docs: https://roots.io/getting-started/docs/windows-development-environment-trellis/#ansible-or-vagrant-complains-about-permissions

ERROR! the role 'swapfile' was not found in /mnt/c/temp/Sites/roots-example-project.com/trellis/roles:/home/kpoxo6op/.ansible/roles:/usr/share/ansible/roles:/etc/ansible/roles:/mnt/c/temp/Sites/roots-example-project.com/trellis

This sounds like you may not have installed some of the roles ansible needs. They should be installed on vagrant up but sometimes that doesn’t work. Check this section of the docs: https://roots.io/trellis/docs/remote-server-setup/#requirements

1 Like
 [WARNING] Ansible is being run in a world writable directory (/mnt/c/temp/Sites/roots-example-project.com/trellis), 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

Did you see this part of the error and read the provided link?

If Trellis’ ansible.cfg config is ignored then nothing will work properly.

1 Like

wow thanks, I will try to restrict my Windows Linux Subsystem shared folder permissions.

i ran into similar kind of error too

[WARNING]: Ansible is being run in a world writable directory (/path/to/trellis), 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

It was related to the permission issues, to get-rid of it, fix the permission by running this command inside of trellis dir

$ chmod o-w .