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

Unable to obtain the current directory #73

Open
xphsc opened this issue Feb 1, 2024 · 4 comments
Open

Unable to obtain the current directory #73

xphsc opened this issue Feb 1, 2024 · 4 comments

Comments

@xphsc
Copy link

xphsc commented Feb 1, 2024

image

image

@willhallonline
Copy link
Owner

Unfortunately, I don't have enough context to understand why this doesn't work. Can you let me know what commands you are running and how you are mounting the docker container. What it looks like it is doing is loading the "/ansible" directory (which is the default) and then you should be mounting your "playbook-resources" into that.

Does this happen on all tasks or just one?

@xphsc
Copy link
Author

xphsc commented Feb 20, 2024

usage docker run --rm -it -v ~/.ssh/id_rsa:/root/.ssh/id_rsa -v ~/.ssh/id_rsa.pub:/root/.ssh/id_rsa.pub -v $(pwd):/ansible willhallonline/ansible:latest ansible-playbook -i ...

@willhallonline
Copy link
Owner

OK, so if you are using:

docker run --rm -it
-v ~/.ssh/id_rsa:/root/.ssh/id_rsa
-v ~/.ssh/id_rsa.pub:/root/.ssh/id_rsa.pub
-v $(pwd):/ansible
willhallonline/ansible:latest
ansible-playbook -i

This should work. I guess that I don't really know where {{ playbook_dir }} is being used, however, I would expect that it is operating either without the directory being mounted, or it is looking somewhere else for it.

@xphsc
Copy link
Author

xphsc commented Mar 6, 2024

The directory exists, how can we obtain it? It is possible to use ansible natively on a Linux server, but it cannot be obtained using this Docker version of ansible

image

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