First draft linode scenario converge, destroy steps
Gitea Actions - molecule test work / Explore-terraform-molecule-Gitea-Action (push) Successful in 5m31s

This commit is contained in:
Mike Holloway committed 2025-01-07 20:12:07 -05:00
1 parent 336d673393
commit a49e672ec0
2 files changed
+31 -22

No files matched your search

+23 -5
View File
@@ -1,8 +1,26 @@
--- ---
- name: Converge - name: Fail if linode group is missing
hosts: all hosts: localhost
gather_facts: false
tasks: tasks:
- name: Replace this task with one that validates your content - name: Print some info
ansible.builtin.debug: ansible.builtin.debug:
msg: "This is the effective test" msg: "{{ groups }}"
- name: Assert group existence
ansible.builtin.assert:
that: "'linode' in groups"
fail_msg: |
linode 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-host Role
include_role:
name: podman-host
# ansible.builtin.assert:
# that: result.stdout | regex_search("^Linux")
+8 -17
View File
@@ -5,20 +5,11 @@
gather_facts: false gather_facts: false
# no_log: "{{ molecule_no_log }}" # no_log: "{{ molecule_no_log }}"
tasks: tasks:
# Developer must implement. - name: Remove dynamic molecule inventory
hosts: localhost
# Mandatory configuration for Molecule to function. gather_facts: false
tasks:
- name: Populate instance config - name: Remove dynamic inventory file
ansible.builtin.set_fact: ansible.builtin.file:
instance_conf: {} path: "{{ molecule_ephemeral_directory }}/inventory/molecule_inventory.yml"
state: absent # Developer must implement.
- name: Dump instance config
ansible.builtin.copy:
content: |
# Molecule managed
{{ instance_conf | to_json | from_json | to_yaml }}
dest: "{{ molecule_instance_config }}"
mode: "0600"
when: server.changed | default(false) | bool # noqa no-handler