Skip to content

Commit

Permalink
Molecule default testing suite switch to debian 12
Browse files Browse the repository at this point in the history
  • Loading branch information
aurelienmaury committed Dec 1, 2023
1 parent 3c086a3 commit 2921e9c
Show file tree
Hide file tree
Showing 7 changed files with 69 additions and 15 deletions.
4 changes: 2 additions & 2 deletions molecule/default/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ platforms:
- hashistack_cluster
- hashistack_masters
- hashistack_minions
image: galaxie-clans-debian:11
image: galaxie-clans-debian:12
log: true
dockerfile: ../platforms/Dockerfile.j2
dockerfile: ../platforms/Dockerfile-debian-12.j2
hostname: molecule-mono
privileged: true
pre_build_image: false
Expand Down
24 changes: 12 additions & 12 deletions molecule/multi/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ platforms:
groups:
- hashistack
- hashistack_sre
image: galaxie-clans-debian:11
image: galaxie-clans-debian:12
log: true
dockerfile: ../platforms/Dockerfile.j2
dockerfile: ../platforms/Dockerfile-debian-12.j2
hostname: molecule-sre
privileged: true
pre_build_image: false
Expand All @@ -42,9 +42,9 @@ platforms:
- hashistack
- hashistack_cluster
- hashistack_masters
image: galaxie-clans-debian:11
image: galaxie-clans-debian:12
log: true
dockerfile: ../platforms/Dockerfile.j2
dockerfile: ../platforms/Dockerfile-debian-12.j2
hostname: molecule-master-01
privileged: true
pre_build_image: false
Expand Down Expand Up @@ -78,9 +78,9 @@ platforms:
- hashistack
- hashistack_cluster
- hashistack_masters
image: galaxie-clans-debian:11
image: galaxie-clans-debian:12
log: true
dockerfile: ../platforms/Dockerfile.j2
dockerfile: ../platforms/Dockerfile-debian-12.j2
hostname: molecule-master-03
privileged: true
pre_build_image: false
Expand All @@ -94,9 +94,9 @@ platforms:
- hashistack
- hashistack_cluster
- hashistack_minions
image: galaxie-clans-debian:11
image: galaxie-clans-debian:12
log: true
dockerfile: ../platforms/Dockerfile.j2
dockerfile: ../platforms/Dockerfile-debian-12.j2
hostname: molecule-minion-01
privileged: true
pre_build_image: false
Expand All @@ -110,9 +110,9 @@ platforms:
- hashistack
- hashistack_cluster
- hashistack_minions
image: galaxie-clans-debian:11
image: galaxie-clans-debian:12
log: true
dockerfile: ../platforms/Dockerfile.j2
dockerfile: ../platforms/Dockerfile-debian-12.j2
hostname: molecule-minion-02
privileged: true
pre_build_image: false
Expand All @@ -126,9 +126,9 @@ platforms:
- hashistack
- hashistack_cluster
- hashistack_minions
image: galaxie-clans-debian:11
image: galaxie-clans-debian:12
log: true
dockerfile: ../platforms/Dockerfile.j2
dockerfile: ../platforms/Dockerfile-debian-12.j2
hostname: molecule-minion-03
privileged: true
pre_build_image: false
Expand Down
29 changes: 29 additions & 0 deletions molecule/platforms/Dockerfile-debian-12.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
ARG DEBIAN_TAG=12-slim

FROM debian:$DEBIAN_TAG

ARG DEBIAN_FRONTEND=noninteractive

ENV LANG fr_FR.utf8

RUN set -eux; \
apt-get update && \
apt-get upgrade -y && \
apt-get install --no-install-recommends -y \
apt-utils curl ca-certificates ssh sudo openssh-server python3 python3-apt locales \
systemd systemd-sysv libpam-systemd dbus dbus-user-session; \
localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8; \
localedef -i fr_FR -c -f UTF-8 -A /usr/share/locale/locale.alias fr_FR.UTF-8

RUN rm -f /lib/systemd/system/multi-user.target.wants/* \
/etc/systemd/system/*.wants/* \
/lib/systemd/system/local-fs.target.wants/* \
/lib/systemd/system/sockets.target.wants/*udev* \
/lib/systemd/system/sockets.target.wants/*initctl* \
/lib/systemd/system/sysinit.target.wants/systemd-tmpfiles-setup* \
/lib/systemd/system/systemd-update-utmp*; \
mkdir -p /var/run/sshd

EXPOSE 22

ENTRYPOINT ["/lib/systemd/systemd"]
23 changes: 23 additions & 0 deletions molecule/playbooks/prepare.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,27 @@
---
- name: Molecule Prepare
hosts: all
gather_facts: false

tasks:
- name: Finish boot sequence
raw: >-
systemctl restart systemd-logind &&
systemctl restart systemd-hostnamed &&
systemctl restart sshd &&
rm -f /run/nologin
changed_when: false

- name: Wait for systemd to complete initialization. # noqa 303
raw: >-
systemctl is-system-running
register: _systemctl_status
until: >-
'running' in _systemctl_status.stdout
retries: 30
delay: 5
changed_when: false

- name: Sanity checks
hosts: localhost
become: false
Expand Down
2 changes: 1 addition & 1 deletion requirements.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ collections:
- name: cloud.terraform
version: "1.1.1"
- name: rtnp.galaxie_clans
version: "1.14.0"
version: "1.14.4"
1 change: 1 addition & 0 deletions roles/stage1_bootstrap/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,6 @@ hs_stage1_bootstrap_packages:
- python3-pip
- python3-setuptools
- python3-venv
- systemd-resolved
- sudo

1 change: 1 addition & 0 deletions roles/stage1_bootstrap/tasks/debian/_system_update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
tags:
- always
- online
- molecule-idempotence-notest

- name: "Full-upgrade system"
apt:
Expand Down

0 comments on commit 2921e9c

Please sign in to comment.