willhallonline / docker-ansible

Ansible inside Docker containers: Alpine, Ubuntu, Rocky & Debian with Ansible 2.16, 2.15, 2.14, 2.13, 2.12, 2.11, 2.10 and 2.9 + Mitogen
https://www.willhallonline.co.uk/project/docker/docker-ansible/
MIT License
376 stars 135 forks source link

ssh path, ".ssh" missing in mount option #14

Closed bartdorlandt closed 4 years ago

bartdorlandt commented 4 years ago

in the mount and inject command example the .ssh portion is missing (on the right side of the ":").

willhallonline commented 4 years ago

Hey @bartdorlandt. I am not sure as this matters? Basically speaking there is only the root user inside the container, so it will make that if it doesn't already exist? I could make a .ssh directory? Would that resolve the issue?

bartdorlandt commented 4 years ago

Hi @willhallonline , I was just referring to the documentation. I see now, that I wasn't very clear. apologies.

The documentation shows: Mount local directory and ssh key $ docker run --rm -it -v $(pwd):/ansible -v ~/.ssh/id_rsa:/root/id_rsa willhallonline/ansible:2.7 /bin/sh Injecting commands $ docker run --rm -it -v $(pwd):/ansible -v ~/.ssh/id_rsa:/root/id_rsa willhallonline/ansible:2.7 ansible-playbook playbook.yml

I believe they should be: Mount local directory and ssh key $ docker run --rm -it -v $(pwd):/ansible -v ~/.ssh/id_rsa:/root/.ssh/id_rsa willhallonline/ansible:2.7 /bin/sh Injecting commands $ docker run --rm -it -v $(pwd):/ansible -v ~/.ssh/id_rsa:/root/.ssh/id_rsa willhallonline/ansible:2.7 ansible-playbook playbook.yml

Note the ".ssh/" between root and id_rsa.

The bash_aliases show pretty much the same, but with the correct mount points.

if desired i could do a pull request.

willhallonline commented 4 years ago

If you want to do a PR that would be good 🥇 . If you don't want to then I'll do it, but I would love to say that someone else has contributed 👍 😀

willhallonline commented 4 years ago

You are totally right by the way with regards to the issue.

bartdorlandt commented 4 years ago

PR done. cheers.