# Semaphore-UI w/ Ansible in Docker

**URL:** <https://forum.ansible.com/t/semaphore-ui-w-ansible-in-docker/6648>\
**Category:** Get Help\
**Tags:** semaphore, ssh, github, ansible-core\
**Created:** [June 19, 2024, 1:37am UTC](https://forum.ansible.com/t/semaphore-ui-w-ansible-in-docker/6648 "2024-06-19T01:37:48Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![cmennens](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/cmennens/32/3081_2.png) [@cmennens](https://forum.ansible.com/u/cmennens)\
**Post date:** [June 19, 2024, 1:37am UTC](https://forum.ansible.com/t/semaphore-ui-w-ansible-in-docker/6648/1 "2024-06-19T01:37:48Z")

</div>

I recently deployed Ansible at work for our Infrastructure team along side with Semaphore UI. It’s been fantastic however we recently wanted to move the Ansible platform to a Docker container setup. We deployed the semaphoreui/semaphore image which I found out is an all-in-one image for ansible, semaphore, bash and etc…

My problem is when I setup Semaphore UI to run a playbook from my private Github repo, I get access denied likely due to SSH keypair Ansible is using in the container. I can’t find the ansible.cfg when I exec into the semaphore container which has Ansible as well. I’m unclear how I can tell the docker containers Ansible what private key pair to use for ssh when cloning a repo.

Has anyone set this up in Docker that can explain what I need to do? Appreciate it.

---

<div class="post-metadata">

**Author:** ![markuman](https://avatars.discourse-cdn.com/v4/letter/m/7bcc69/32.png) [@markuman](https://forum.ansible.com/u/markuman)\
**Post date:** [June 19, 2024, 1:29pm UTC](https://forum.ansible.com/t/semaphore-ui-w-ansible-in-docker/6648/2 "2024-06-19T13:29:19Z")

</div>

Try to pass extra argument to the task in semaphore

```auto
["--ssh-common-args", "-o StrictHostKeyChecking=accept-new"]

```

Another option could be to mount the `.ssh/known_hosts` from the semaphore runner in the container to the host to make it persistent. But I’m not 100% sure, because I don’t run semaphore in a container environment.

---

<div class="post-metadata">

**Author:** ![bbaassssiiee](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/bbaassssiiee/32/1927_2.png) [@bbaassssiiee](https://forum.ansible.com/u/bbaassssiiee)\
**Post date:** [November 9, 2024, 6:59am UTC](https://forum.ansible.com/t/semaphore-ui-w-ansible-in-docker/6648/3 "2024-11-09T06:59:24Z")

</div>

You can use the Key Store built into Semaphore to store SSH keys. Automate that with Ansible tasks like these: [api/tasks/credentials](https://github.com/bbaassssiiee/controller/blob/main/roles/api/tasks/credentials.yml)
