Compare commits

..

21 Commits

Author SHA1 Message Date
Mike Holloway
7934dbb6e7 # Molecule testing ## Correcting project name refs, adding role deps
Some checks failed
Gitea Actions - molecule test work / Explore-terraform-molecule-Gitea-Action (push) Failing after 1m51s
2026-07-24 12:07:22 -04:00
Mike Holloway
8535ba3384 ## molecule command sleep infinity - working 2026-07-24 02:45:28 -04:00
Mike Holloway
1f59a33574 ## platforms command added to creation task
Some checks failed
Gitea Actions - molecule test work / Explore-terraform-molecule-Gitea-Action (push) Failing after 1m22s
2026-07-24 02:35:57 -04:00
Mike Holloway
1988fae3e8 ## Molecule platform values update
Some checks failed
Gitea Actions - molecule test work / Explore-terraform-molecule-Gitea-Action (push) Failing after 2m2s
2026-07-24 02:26:44 -04:00
Mike Holloway
9539cb485e ## Molecule default test
Some checks failed
Gitea Actions - molecule test work / Explore-terraform-molecule-Gitea-Action (push) Failing after 3m6s
2026-07-24 02:08:47 -04:00
Mike Holloway
aa8e17efa9 ## Molecule extensions added
Some checks failed
Gitea Actions - molecule test work / Explore-terraform-molecule-Gitea-Action (push) Failing after 54s
2026-07-24 02:03:22 -04:00
Mike Holloway
e3a2901cba ## Project path probing
All checks were successful
Gitea Actions - molecule test work / Explore-terraform-molecule-Gitea-Action (push) Successful in 47s
2026-07-24 01:58:02 -04:00
Mike Holloway
17194052bc ## ssh privkey tinkering
Some checks failed
Gitea Actions - molecule test work / Explore-terraform-molecule-Gitea-Action (push) Failing after 1m2s
2026-07-24 01:54:56 -04:00
Mike Holloway
1c888f76a0 ## ssh config returned
Some checks failed
Gitea Actions - molecule test work / Explore-terraform-molecule-Gitea-Action (push) Failing after 1m14s
2026-07-24 01:52:43 -04:00
Mike Holloway
251770eac3 ## Testing deploy key
Some checks failed
Gitea Actions - molecule test work / Explore-terraform-molecule-Gitea-Action (push) Failing after 1m7s
2026-07-24 01:38:09 -04:00
Mike Holloway
9c51402b86 ## base64 encoding for privkey - Working 2026-07-24 01:33:57 -04:00
Mike Holloway
de0797831f ## verbose ssh
Some checks failed
Gitea Actions - molecule test work / Explore-terraform-molecule-Gitea-Action (push) Failing after 27s
2026-07-24 00:52:46 -04:00
Mike Holloway
bf997640c2 ## more ssh testing again
Some checks failed
Gitea Actions - molecule test work / Explore-terraform-molecule-Gitea-Action (push) Failing after 31s
2026-07-24 00:29:16 -04:00
Mike Holloway
a665f6ea36 ## more ssh testing
All checks were successful
Gitea Actions - molecule test work / Explore-terraform-molecule-Gitea-Action (push) Successful in 29s
2026-07-24 00:25:24 -04:00
Mike Holloway
c854346ab1 ## path param added again
Some checks failed
Gitea Actions - molecule test work / Explore-terraform-molecule-Gitea-Action (push) Failing after 1m33s
2026-07-23 23:58:16 -04:00
Mike Holloway
1a70d81995 ## ssh host key fingerprint not working
Some checks failed
Gitea Actions - molecule test work / Explore-terraform-molecule-Gitea-Action (push) Failing after 1m13s
2026-07-23 23:36:07 -04:00
Mike Holloway
ebd2495f50 ## ssh host key fingerprint instead
Some checks failed
Gitea Actions - molecule test work / Explore-terraform-molecule-Gitea-Action (push) Failing after 1m2s
2026-07-23 23:33:18 -04:00
Mike Holloway
2b1fabddf5 ## updated ssh host key
Some checks failed
Gitea Actions - molecule test work / Explore-terraform-molecule-Gitea-Action (push) Failing after 1m11s
2026-07-23 22:47:45 -04:00
Mike Holloway
b3997830a2 ## del'd ssh extra params, added test ssh command
Some checks failed
Gitea Actions - molecule test work / Explore-terraform-molecule-Gitea-Action (push) Failing after 34s
2026-07-23 22:35:42 -04:00
Mike Holloway
4d0f7616a7 ## del'd ssh setup tasks
Some checks failed
Gitea Actions - molecule test work / Explore-terraform-molecule-Gitea-Action (push) Failing after 1m5s
2026-07-23 21:40:51 -04:00
Mike Holloway
3e007fe7d4 ## +56GiB RAM, re-add del'd steps
Some checks failed
Gitea Actions - molecule test work / Explore-terraform-molecule-Gitea-Action (push) Failing after 1m16s
2026-07-23 21:31:26 -04:00
7 changed files with 239 additions and 2 deletions

View File

@ -8,7 +8,7 @@ on:
jobs:
Explore-terraform-molecule-Gitea-Action:
env:
ANSIBLE_ROLES_PATH: '/workspace/seasharp/ansible-role_podman-host'
ANSIBLE_ROLES_PATH: '/workspace/seasharp/ansible-role_podman_netbird'
# ANSIBLE_REMOTE_TMP: '/root/.ansible/tmp/'
EQIT_VPC: '136994'
EQIT_VPC_SUBNET: '131754'
@ -25,9 +25,39 @@ jobs:
chmod a+r /etc/apt/sources.list.d/opentofu.list
apt-get update
apt-get install -y tofu
- name: Update ssh config
run: |
umask 077
mkdir .ssh
echo -e "Host git.libre.audio\n Port 2222" >> ~/.ssh/config
cat ~/.ssh/config
- name: tofu Checkout
uses: actions/checkout@v4
with:
repository: 'seasharp/eqit_tofu-plan'
path: 'tofu'
ssh-key: |-
-----BEGIN OPENSSH PRIVATE KEY-----
b3BlbnNzaC1rZXktdjEAAAAABG5vbmUAAAAEbm9uZQAAAAAAAAABAAAAMwAAAAtzc2gtZW
QyNTUxOQAAACDYtU5hAnmHZ68PDgogVQfq5vEsAVnM/fEnv6vt5d4jPwAAAJiuquVvrqrl
bwAAAAtzc2gtZWQyNTUxOQAAACDYtU5hAnmHZ68PDgogVQfq5vEsAVnM/fEnv6vt5d4jPw
AAAEAgtCS7S50mz7uxA5ucR2UILvkvsqTum10668gpWJmXqdi1TmECeYdnrw8OCiBVB+rm
8SwBWcz98Se/q+3l3iM/AAAAEW0wMHRAbWlzZXJ2ZXIubGFuAQIDBA==
-----END OPENSSH PRIVATE KEY-----
ssh-known-hosts: |
git.libre.audio ssh-ed25519
[git.libre.audio]:2222 ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFLiDhNN7aPdGUt8gvvAftF5Oo3xwsy/JcT9gcX00BDW
- name: Project Checkout
uses: actions/checkout@v4
with:
path: 'podman_netbird'
- name: Set up Python
uses: actions/setup-python@v2
- name: Molecule test
run: |
cd podman_netbird/extensions
molecule test

View File

@ -0,0 +1,26 @@
---
- name: Fail if molecule group is missing
hosts: localhost
tasks:
- name: Print some info
ansible.builtin.debug:
msg: "{{ groups }}"
- name: Assert group existence
ansible.builtin.assert:
that: "'molecule' in groups"
fail_msg: |
molecule group was not found inside inventory groups: {{ groups }}
- name: Converge
hosts: molecule
# We disable gather facts because it would fail due to our container not
# having python installed. This will not prevent use from running 'raw'
# commands. Most molecule users are expected to use containers that already
# have python installed in order to avoid notable delays installing it.
tasks:
- name: Apply podman_netbird Role
include_role:
name: podman_netbird
# ansible.builtin.assert:
# that: result.stdout | regex_search("^Linux")

View File

@ -0,0 +1,119 @@
---
- name: Create
hosts: localhost
connection: local
gather_facts: false
vars:
molecule_inventory:
all:
hosts: {}
molecule: {}
tasks:
- name: Create a container
community.docker.docker_container:
name: "{{ item.name }}"
image: "{{ item.image }}"
state: started
command: "{{ item.command }}"
log_driver: json-file
register: result
loop: "{{ molecule_yml.platforms }}"
- name: Print some info
ansible.builtin.debug:
msg: "{{ result.results }}"
- name: Fail if container is not running
when: >
item.container.State.ExitCode != 0 or
not item.container.State.Running
ansible.builtin.include_tasks:
file: tasks/create-fail.yml
loop: "{{ result.results }}"
loop_control:
label: "{{ item.container.Name }}"
- name: Add container to molecule_inventory
vars:
inventory_partial_yaml: |
all:
children:
molecule:
hosts:
"{{ item.name }}":
ansible_connection: community.docker.docker
service_users:
- name: eqadmin
services:
- netbird
- service2
ansible.builtin.set_fact:
molecule_inventory: >
{{ molecule_inventory | combine(inventory_partial_yaml | from_yaml, recursive=true) }}
loop: "{{ molecule_yml.platforms }}"
loop_control:
label: "{{ item.name }}"
- name: Dump molecule_inventory
ansible.builtin.copy:
content: |
{{ molecule_inventory | to_yaml }}
dest: "{{ molecule_ephemeral_directory }}/inventory/molecule_inventory.yml"
mode: "0600"
- name: Force inventory refresh
ansible.builtin.meta: refresh_inventory
- name: Fail if molecule group is missing
ansible.builtin.assert:
that: "'molecule' in groups"
fail_msg: |
molecule group was not found inside inventory groups: {{ groups }}
run_once: true # noqa: run-once[task]
# we want to avoid errors like "Failed to create temporary directory"
- name: Validate that inventory was refreshed
hosts: molecule
gather_facts: false
tasks:
- name: Check uname
ansible.builtin.raw: uname -a
register: result
changed_when: false
- name: Display uname info
ansible.builtin.debug:
msg: "{{ result.stdout }}"
- name: Verify container properties
hosts: molecule
gather_facts: false
tasks:
- name: Prerequisite packages
ansible.builtin.dnf:
name: ['openssh-server', 'python3-policycoreutils', 'python3-firewall', 'cronie']
state: present
- name: Apply prerequisite roles
hosts: molecule
gather_facts: true
tasks:
- name: Apply podman-host Role
include_role:
name: podman-host
- name: Apply repo-epel Role
include_role:
name: geerlingguy.repo-epel
- name: Apply certbot Role
include_role:
name: geerlingguy.certbot
- name: Register certbot
command:
cmd: "certbot register --agree-tos --email admin@libre.audio"
creates: "/etc/letsencrypt/renewal-hooks/"

View File

@ -0,0 +1,20 @@
---
- name: Destroy molecule containers
hosts: molecule
gather_facts: false
tasks:
- name: Stop and remove container
delegate_to: localhost
community.docker.docker_container:
name: "{{ inventory_hostname }}"
state: absent
auto_remove: true
- name: Remove dynamic molecule inventory
hosts: localhost
gather_facts: false
tasks:
- name: Remove dynamic inventory file
ansible.builtin.file:
path: "{{ molecule_ephemeral_directory }}/inventory/molecule_inventory.yml"
state: absent

View File

@ -0,0 +1,21 @@
---
dependency:
name: galaxy
driver:
options:
managed: false
login_cmd_template: "docker exec -it {instance} bash"
ansible_connection_options:
ansible_connection: docker
platforms:
- name: instance
image: "geerlingguy/docker-${MOLECULE_DISTRO:-rockylinux9}-ansible:latest"
command: ${MOLECULE_DOCKER_COMMAND:-"sleep infinity"}
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:ro
cgroupns_mode: host
privileged: true
pre_build_image: true
# you might want to add your own variables here based on what provisioning
# you are doing like:
# image: quay.io/centos/centos:stream8

View File

@ -0,0 +1,8 @@
roles:
- equilibrateit.podman-host
- geerlingguy.repo-epel
- geerlingguy.certbot
collections:
- community.general
- community.docker
- ansible.posix

View File

@ -0,0 +1,13 @@
- name: Retrieve container log
ansible.builtin.command:
cmd: >-
{% raw %}
docker logs
{% endraw %}
{{ item.stdout_lines[0] }}
changed_when: false
register: logfile_cmd
- name: Display container log
ansible.builtin.fail:
msg: "{{ logfile_cmd.stderr }}"