Compare commits

..

No commits in common. "master" and "v0.01" have entirely different histories.

7 changed files with 32 additions and 51 deletions

View File

@ -91,9 +91,9 @@
gather_facts: false gather_facts: false
tasks: tasks:
- name: Package procps-ng - name: Packages openssh-server, python3-policycoreutils
ansible.builtin.dnf: ansible.builtin.dnf:
name: procps-ng name: ['openssh-server', 'python3-policycoreutils']
state: present state: present
- name: systemd PID - name: systemd PID

View File

@ -9,7 +9,7 @@ driver:
ansible_connection: docker ansible_connection: docker
platforms: platforms:
- name: instance - name: instance
image: geerlingguy/docker-${MOLECULE_DISTRO:-rockylinux9}-ansible:latest image: geerlingguy/docker-rockylinux9-ansible:latest
command: "/sbin/init" command: "/sbin/init"
volumes: volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:ro - /sys/fs/cgroup:/sys/fs/cgroup:ro

View File

@ -1,26 +1,8 @@
--- ---
- name: Fail if linode group is missing
hosts: localhost
tasks:
- name: Print some info
ansible.builtin.debug:
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 - name: Converge
hosts: linode hosts: all
# We disable gather facts because it would fail due to our container not gather_facts: false
# 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: tasks:
- name: Apply podman-host Role - name: Replace this task with one that validates your content
include_role: ansible.builtin.debug:
name: podman-host msg: "This is the effective test"
# ansible.builtin.assert:
# that: result.stdout | regex_search("^Linux")

View File

@ -98,9 +98,9 @@
gather_facts: false gather_facts: false
tasks: tasks:
- name: Package procps-ng - name: Packages openssh-server, python3-policycoreutils
ansible.builtin.dnf: ansible.builtin.dnf:
name: procps-ng name: ['openssh-server', 'python3-policycoreutils']
state: present state: present
- name: systemd PID - name: systemd PID

View File

@ -5,11 +5,20 @@
gather_facts: false gather_facts: false
# no_log: "{{ molecule_no_log }}" # no_log: "{{ molecule_no_log }}"
tasks: tasks:
- name: Remove dynamic molecule inventory # Developer must implement.
hosts: localhost
gather_facts: false # Mandatory configuration for Molecule to function.
tasks:
- name: Remove dynamic inventory file - name: Populate instance config
ansible.builtin.file: ansible.builtin.set_fact:
path: "{{ molecule_ephemeral_directory }}/inventory/molecule_inventory.yml" instance_conf: {}
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

View File

@ -1,2 +0,0 @@
collections:
- community.general

View File

@ -1,17 +1,8 @@
- import_tasks: include-vars.yml - import_tasks: include-vars.yml
- name: Install podman, podman networking plugins, and python support packages - name: Install podman, podman networking plugins, and python support packages
vars:
dnf_packages:
- 'openssh-server'
- 'podman'
- 'podman-plugins'
- 'systemd-container'
- 'containernetworking-plugins'
- 'python3-pip'
- 'python3-policycoreutils'
dnf: dnf:
name: "{{ dnf_packages }}" name: ['podman', 'containernetworking-plugins', 'podman-plugins', 'python3-pip', 'systemd-container']
state: present state: present
- name: Install podman-compose pip Package - name: Install podman-compose pip Package
@ -30,7 +21,6 @@
- "{{ service_users }}" - "{{ service_users }}"
- name: Create service folders - name: Create service folders
become: yes
become_user: "{{ item.0.name }}" become_user: "{{ item.0.name }}"
file: file:
path: "/home/{{ item.0.name }}/{{ item.1 }}" path: "/home/{{ item.0.name }}/{{ item.1 }}"
@ -111,7 +101,8 @@
owner: root owner: root
group: root group: root
mode: 0644 mode: 0644
when: '"molecule" not in group_names' tags:
- 'molecule-notest'
- lineinfile: - lineinfile:
path: /etc/hosts path: /etc/hosts
@ -120,7 +111,8 @@
owner: root owner: root
group: root group: root
mode: 0644 mode: 0644
when: '"molecule" not in group_names' tags:
- 'molecule-notest'
# - name: Copy cni networking driver config into place # - name: Copy cni networking driver config into place
# blockinfile: # blockinfile:
# name: "/etc/cni/net.d/podman.conflist" # name: "/etc/cni/net.d/podman.conflist"