summaryrefslogtreecommitdiffstats
path: root/molecule/default
diff options
context:
space:
mode:
Diffstat (limited to 'molecule/default')
-rw-r--r--molecule/default/Dockerfile.proxmox.j221
-rw-r--r--molecule/default/converge.yml2
-rw-r--r--molecule/default/prepare.yml23
3 files changed, 41 insertions, 5 deletions
diff --git a/molecule/default/Dockerfile.proxmox.j2 b/molecule/default/Dockerfile.proxmox.j2
new file mode 100644
index 0000000..a8cebae
--- /dev/null
+++ b/molecule/default/Dockerfile.proxmox.j2
@@ -0,0 +1,21 @@
+# Based on the amazing work of geerlingguy <3
+# FROM docker.io/geerlingguy/docker-debian12-ansible
+FROM docker.io/library/debian:bookworm
+
+ARG DEBIAN_FRONTEND=noninteractive
+
+ENV container docker
+
+RUN apt-get update \
+ && apt-get install -y --no-install-recommends \
+ systemd python3 parted dosfstools \
+ && rm -Rf /var/lib/apt/lists/* \
+ && rm -Rf /usr/share/doc \
+ && rm -Rf /usr/share/man \
+ && apt-get clean
+
+RUN rm -f /lib/systemd/system/multi-user.target.wants/getty.target
+
+VOLUME ["/sys/fs/cgroup", "/tmp", "/run", "/opt"]
+
+CMD ["/lib/systemd/systemd"]
diff --git a/molecule/default/converge.yml b/molecule/default/converge.yml
index 75790b7..11fdd74 100644
--- a/molecule/default/converge.yml
+++ b/molecule/default/converge.yml
@@ -35,6 +35,8 @@
dev: "{{ partition_disk }}p3"
mount_path: "/mnt"
partition_extras: []
+ bootstrap_pi: "{{ hostvars['localhost']['test_bootstrap_pi'] }}"
+ bootstrap_proxmox: "{{ hostvars['localhost']['test_bootstrap_proxmox'] }}"
configure_playbook_dir: "../../../ansible-distro-configure"
pre_tasks:
diff --git a/molecule/default/prepare.yml b/molecule/default/prepare.yml
index 9a9d735..76b7787 100644
--- a/molecule/default/prepare.yml
+++ b/molecule/default/prepare.yml
@@ -5,10 +5,17 @@
tasks:
- name: "Set distro test host name mapping"
ansible.builtin.set_fact:
- distro_hostname_mapping:
- archlinux: "desktop.local"
- ubuntu: "laptop.local"
- raspberrypi: "rpi5.local"
+ scenario_vars:
+ archlinux:
+ hostname: "desktop.local"
+ ubuntu:
+ hostname: "laptop.local"
+ raspberrypi:
+ hostname: "rpi5.local"
+ bootstrap_pi: true
+ proxmox:
+ hostname: "pve.local"
+ bootstrap_proxmox: true
- name: "Create virtual disk image"
become: true
@@ -24,10 +31,16 @@
register: loop_device
changed_when: true
+ - name: "Set distro key"
+ ansible.builtin.set_fact:
+ distro_key: "{{ lookup('ansible.builtin.env', 'MOLECULE_DISTRO') }}"
+
- name: "Set test facts"
ansible.builtin.set_fact:
test_device: "{{ loop_device.stdout }}"
- test_hostname: "{{ distro_hostname_mapping[lookup('ansible.builtin.env', 'MOLECULE_DISTRO')] }}"
+ test_hostname: "{{ scenario_vars[distro_key].hostname }}"
+ test_bootstrap_pi: "{{ scenario_vars[distro_key].bootstrap_pi | default(false) }}"
+ test_bootstrap_proxmox: "{{ scenario_vars[distro_key].bootstrap_proxmox | default(false) }}"
cacheable: true
- name: "Show test info"