Semaphore-UI w/ Ansible in Docker

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.

Try to pass extra argument to the task in semaphore

["--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.