add more testing containers
This commit is contained in:
18
tests/Containerfile.debian
Normal file
18
tests/Containerfile.debian
Normal file
@@ -0,0 +1,18 @@
|
||||
FROM debian:bookworm
|
||||
LABEL PROJECT "ansible_role_package"
|
||||
LABEL MAINTAINER "Matthew Stobbs <matthew@stobbs.ca>"
|
||||
|
||||
RUN useradd -d /home/ansible -m -G wheel ansible
|
||||
RUN apt update && \
|
||||
apt install -y openssh-server python3-paramiko gnupg2
|
||||
EXPOSE 22
|
||||
|
||||
USER ansible
|
||||
WORKDIR /home/ansible
|
||||
RUN mkdir /home/ansible/.ssh
|
||||
COPY ./pubkey /home/ansible/.ssh/authorized_keys
|
||||
|
||||
USER root
|
||||
RUN echo "ansible ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/sudoers
|
||||
RUN ssh-keygen -A
|
||||
ENTRYPOINT /usr/sbin/sshd -D
|
||||
17
tests/Containerfile.el9
Normal file
17
tests/Containerfile.el9
Normal file
@@ -0,0 +1,17 @@
|
||||
FROM almalinux:9
|
||||
LABEL PROJECT "ansible_role_package"
|
||||
LABEL MAINTAINER "Matthew Stobbs <matthew@stobbs.ca>"
|
||||
|
||||
RUN useradd -d /home/ansible -m -G wheel ansible
|
||||
RUN dnf install -y openssh-server python3-paramiko python3-libdnf gnupg2
|
||||
EXPOSE 22
|
||||
|
||||
USER ansible
|
||||
WORKDIR /home/ansible
|
||||
RUN mkdir /home/ansible/.ssh
|
||||
COPY ./pubkey /home/ansible/.ssh/authorized_keys
|
||||
|
||||
USER root
|
||||
RUN echo "ansible ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/sudoers
|
||||
RUN ssh-keygen -A
|
||||
ENTRYPOINT /usr/sbin/sshd -D
|
||||
18
tests/Containerfile.ubuntu
Normal file
18
tests/Containerfile.ubuntu
Normal file
@@ -0,0 +1,18 @@
|
||||
FROM ubuntu:24.04
|
||||
LABEL PROJECT "ansible_role_package"
|
||||
LABEL MAINTAINER "Matthew Stobbs <matthew@stobbs.ca>"
|
||||
|
||||
RUN useradd -d /home/ansible -m -G wheel ansible
|
||||
RUN apt update && \
|
||||
apt install -y openssh-server python3-paramiko gnupg2
|
||||
EXPOSE 22
|
||||
|
||||
USER ansible
|
||||
WORKDIR /home/ansible
|
||||
RUN mkdir /home/ansible/.ssh
|
||||
COPY ./pubkey /home/ansible/.ssh/authorized_keys
|
||||
|
||||
USER root
|
||||
RUN echo "ansible ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/sudoers
|
||||
RUN ssh-keygen -A
|
||||
ENTRYPOINT /usr/sbin/sshd -D
|
||||
@@ -20,4 +20,7 @@ done
|
||||
echo "Machine $MACHINENAME running"
|
||||
|
||||
echo "Building container images"
|
||||
podman build --platform linux/amd64 -f Containerfile -t $IMAGE .
|
||||
podman build --platform linux/amd64 -f Containerfile.el9 -t ${IMAGE}_el9 .
|
||||
podman build --platform linux/amd64 -f Containerfile.fedora -t ${IMAGE)_fedora .
|
||||
podman build --platform linux/amd64 -f Containerfile.debian -t ${IMAGE}_debian .
|
||||
podman build --platform linux/amd64 -f Containerfile.ubuntu -t ${IMAGE}_ubuntu .
|
||||
|
||||
@@ -3,3 +3,12 @@
|
||||
podman run --rm -it -d --platform linux/amd64 --name packagetest -p 2222:22 packagetest
|
||||
ansible-playbook test_not_local.yml -i inventory.yml
|
||||
podman stop packagetest
|
||||
podman run --rm -it -d --platform linux/amd64 --name packagetest -p 2222:22 packagetest
|
||||
ansible-playbook test_not_local.yml -i inventory.yml
|
||||
podman stop packagetest
|
||||
podman run --rm -it -d --platform linux/amd64 --name packagetest -p 2222:22 packagetest
|
||||
ansible-playbook test_not_local.yml -i inventory.yml
|
||||
podman stop packagetest
|
||||
podman run --rm -it -d --platform linux/amd64 --name packagetest -p 2222:22 packagetest
|
||||
ansible-playbook test_not_local.yml -i inventory.yml
|
||||
podman stop packagetest
|
||||
|
||||
Reference in New Issue
Block a user