From e6731273d2e8232b8a535a0b939e3ee4ef4fdfaa Mon Sep 17 00:00:00 2001 From: AnsibleGuy Date: Sat, 4 May 2024 16:19:15 +0200 Subject: [PATCH] updated molecule docker-image --- molecule/default/Dockerfile_debian12_systemd.j2 | 14 -------------- molecule/default/molecule.yml | 11 +++-------- molecule/default/prepare.yml | 4 ++-- 3 files changed, 5 insertions(+), 24 deletions(-) delete mode 100644 molecule/default/Dockerfile_debian12_systemd.j2 diff --git a/molecule/default/Dockerfile_debian12_systemd.j2 b/molecule/default/Dockerfile_debian12_systemd.j2 deleted file mode 100644 index 703498a..0000000 --- a/molecule/default/Dockerfile_debian12_systemd.j2 +++ /dev/null @@ -1,14 +0,0 @@ -# docker build -t mantest - < ./Dockerfile.j2 -# docker run -it --privileged --name mantest mantest:latest /sbin/init --tmpfs /tmp --tmpfs /run --tmpfs /run/lock - -FROM debian:12-slim - -ENV container docker -ENV LC_ALL C -ENV DEBIAN_FRONTEND noninteractive - -RUN apt-get update \ - && apt-get install -y systemd systemd-sysv python3 sudo \ - && apt-get clean - -CMD ["/sbin/init"] diff --git a/molecule/default/molecule.yml b/molecule/default/molecule.yml index 19cf5d7..c64be9d 100644 --- a/molecule/default/molecule.yml +++ b/molecule/default/molecule.yml @@ -6,15 +6,10 @@ _references: all: &docker_all docker_host: 'tcp://molecule-docker.local:2375' # docker_host: 'unix://var/run/docker.sock' # localhost - purge_networks: true - image: 'debian:12-slim' - # for docker systemd config see: https://serverfault.com/questions/1053187/systemd-fails-to-run-in-a-docker-container-when-using-cgroupv2-cgroupns-priva - dockerfile: 'Dockerfile_debian12_systemd.j2' - build_image: yes - tmpfs: ['/tmp', '/run', '/run/lock'] + image: 'ansible0guy/molecule:debian-latest' + tmpfs: ['/tmp', '/run', '/run/lock'] privileged: true - command: '/sbin/init' - sysctls: + sysctls: 'net.ipv4.ip_forward': 1 'net.ipv4.conf.all.arp_filter': 0 'net.ipv4.conf.all.rp_filter': 2 diff --git a/molecule/default/prepare.yml b/molecule/default/prepare.yml index ae2136e..923dc3f 100644 --- a/molecule/default/prepare.yml +++ b/molecule/default/prepare.yml @@ -7,13 +7,13 @@ tasks: - name: Installing dependencies ansible.builtin.apt: - pkg: ['iputils-ping', 'ufw', 'iproute2'] + pkg: ['iputils-ping', 'ufw'] state: present update_cache: yes - name: Installing troubleshooting tools ansible.builtin.apt: - pkg: ['procps', 'net-tools', 'traceroute', 'vim', 'nano', 'tcpdump'] + pkg: ['traceroute', 'tcpdump'] state: present - name: Allowing traffic by ufw