1
0
Fork 0

Begin add docker to test ansible test image

This commit is contained in:
Florian RICHER 2023-05-02 14:14:39 +02:00
parent 074a9b05b6
commit c0d9f69ee7
No known key found for this signature in database
GPG key ID: 6BF27BF8A1E71623
3 changed files with 14 additions and 0 deletions

7
docker/Dockerfile Normal file
View file

@ -0,0 +1,7 @@
FROM fedora:38
RUN dnf install openssh-server -y
RUN ssh-keygen -A -v
EXPOSE 22
CMD ["/usr/sbin/sshd", "-D", "-o", "ListenAddress=0.0.0.0"]

4
docker/inventory.yaml Normal file
View file

@ -0,0 +1,4 @@
servers:
localhost:
ansibleConnection: ssh
ansibleUser: root

3
docker/start Executable file
View file

@ -0,0 +1,3 @@
#!/bin/sh
docker build -t ansible_test:latest docker/
docker run --rm -d --name ansible_test --privileged --volume=/sys/fs/cgroup:/sys/fs/cgroup:rw --volume="$HOME/.ssh/id_rsa.pub:/root/.ssh/authorized_keys" -p 1022:22 --cgroupns=host ansible_test:latest