Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ansible is being run in a world writable directory... ignoring it as an ansible.cfg source #107

Open
Xaeco opened this issue Dec 16, 2021 · 4 comments

Comments

@Xaeco
Copy link

Xaeco commented Dec 16, 2021

On page 74 in

Chapter 3 - Ansible manages containers

When running command:

$ ansible-galaxy install -r requirements.yml

It runs with a warning:

[WARNING]: Ansible is being run in a world writable directory (/mnt/c/Users/<username>/documents/afk/ansible-solr-container), 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
Starting galaxy role install process
- downloading role 'java', owned by geerlingguy
- downloading role from https://github.com/geerlingguy/ansible-role-java/archive/1.10.0.tar.gz
- extracting geerlingguy.java to /home/wsl/.ansible/roles/geerlingguy.java
- geerlingguy.java (1.10.0) was installed successfully
- downloading role 'solr', owned by geerlingguy
- downloading role from https://github.com/geerlingguy/ansible-role-solr/archive/5.3.0.tar.gz
- extracting geerlingguy.solr to /home/wsl/.ansible/roles/geerlingguy.solr
- geerlingguy.solr (5.3.0) was installed successfully

It installs the roles but not in the correct location:

$ ls -1 roles
ls: cannot access 'roles': No such file or directory

Following the link in the warning leads to options to resolve the issue.
I used:

export ANSIBLE_CONFIG=./ansible.cfg

then re-ran the command:

$ ansible-galaxy install -r requirements.yml

which put them into the correct location:

$ ls -1 roles
geerlingguy.java
geerlingguy.solr
@geerlingguy
Copy link
Owner

@Xaeco - Hmm... "Ansible is being run in a world writable directory" seems to indicate this directory has 777 permissions, and typically Ansible restricts loading ansible.cfg files in that case (for good reason—someone could do a lot of damage writing to that file!). I haven't ever noticed that warning, but did you by chance set the folder to have world-read/write/execute permissions?

@Xaeco
Copy link
Author

Xaeco commented Dec 17, 2021

My files are in my user profile documents folder in Windows and being accessed by Ansible within WSL. I have tried changing permissions in both environments and changing the mount to no avail.

So I went with the environment variable option for now as I'm planning on removing Windows this Xmas break and going full Linux to immerse myself for a while.

@geerlingguy
Copy link
Owner

going full Linux to immerse myself for a while.

Ooh, good luck!

@Xaeco
Copy link
Author

Xaeco commented Dec 19, 2021

Was tempted to quote a line from Tropic Thunder

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants