Files
ansible-role-certificate-au…/molecule/default/create.yml
T
volker.raschekandCopilot b72fba0924 test: add a molecule scenario covering three distribution families
The role was only linted statically so far, which is why every bug of the recent analysis passed the ci
unnoticed. The scenario converges the role in podman containers of Archlinux, Debian and Fedora, checks
idempotence and then verifies the result.

Verification covers the chain via openssl verify, the file modes of keys, certificates and directories,
the number of certificates in the fullchain of the client, its subject alternative names and the anchor in
the systems trust store. Root and intermediate use a passphrase so the protected code paths are exercised
as well.

Molecule ships only the default driver, so create and destroy are provided as playbooks. Three details
were needed to make it work. The connection has to be declared in the instance config, since molecule
ignores ansible_connection_options of the driver. Raw commands are passed through sh explicitly, because
the podman connection plugin splits them instead of using a shell. And the roles path has to point at the
parent of the project directory, which is the role itself.

Co-authored-by: Copilot <copilot@github.com>
2026-09-07 22:30:23 +02:00

26 lines
661 B
YAML

---
- name: Create
hosts: localhost
gather_facts: false
tasks:
- name: Start a container per platform
containers.podman.podman_container:
name: "{{ item.name }}"
image: "{{ item.image }}"
command: "sleep infinity"
state: started
loop: "{{ molecule_yml.platforms }}"
loop_control:
label: "{{ item.name }}"
- name: Write the instance config
ansible.builtin.copy:
content: |
{% for platform in molecule_yml.platforms %}
- instance: {{ platform.name }}
connection: containers.podman.podman
{% endfor %}
dest: "{{ molecule_instance_config }}"
mode: "0600"