diff --git a/docker/Dockerfile b/docker/Dockerfile new file mode 100644 index 0000000..8600f3c --- /dev/null +++ b/docker/Dockerfile @@ -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"] \ No newline at end of file diff --git a/docker/inventory.yaml b/docker/inventory.yaml new file mode 100644 index 0000000..d3ff1c3 --- /dev/null +++ b/docker/inventory.yaml @@ -0,0 +1,4 @@ +servers: + localhost: + ansibleConnection: ssh + ansibleUser: root \ No newline at end of file diff --git a/docker/start b/docker/start new file mode 100755 index 0000000..118a776 --- /dev/null +++ b/docker/start @@ -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 \ No newline at end of file