Compare commits
12 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ddec4cedb5 | ||
|
|
b16224334f | ||
|
|
0fcfdd4bbc | ||
|
|
d7a553f1dd | ||
|
|
0b1a8fef37 | ||
|
|
08d64e1cb1 | ||
|
|
3094dea795 | ||
|
|
2ef9c930cb | ||
|
|
77bbbc8ffb | ||
|
|
7d46ec7d7d | ||
|
|
af221cb741 | ||
|
|
a49e672ec0 |
@ -91,9 +91,9 @@
|
||||
gather_facts: false
|
||||
|
||||
tasks:
|
||||
- name: Packages openssh-server, python3-policycoreutils
|
||||
- name: Package procps-ng
|
||||
ansible.builtin.dnf:
|
||||
name: ['openssh-server', 'python3-policycoreutils']
|
||||
name: procps-ng
|
||||
state: present
|
||||
|
||||
- name: systemd PID
|
||||
|
||||
@ -9,7 +9,7 @@ driver:
|
||||
ansible_connection: docker
|
||||
platforms:
|
||||
- name: instance
|
||||
image: geerlingguy/docker-rockylinux9-ansible:latest
|
||||
image: geerlingguy/docker-${MOLECULE_DISTRO:-rockylinux9}-ansible:latest
|
||||
command: "/sbin/init"
|
||||
volumes:
|
||||
- /sys/fs/cgroup:/sys/fs/cgroup:ro
|
||||
|
||||
@ -1,8 +1,26 @@
|
||||
---
|
||||
- name: Converge
|
||||
hosts: all
|
||||
gather_facts: false
|
||||
- name: Fail if linode group is missing
|
||||
hosts: localhost
|
||||
tasks:
|
||||
- name: Replace this task with one that validates your content
|
||||
- name: Print some info
|
||||
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: linode
|
||||
# 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")
|
||||
|
||||
@ -98,9 +98,9 @@
|
||||
gather_facts: false
|
||||
|
||||
tasks:
|
||||
- name: Packages openssh-server, python3-policycoreutils
|
||||
- name: Package procps-ng
|
||||
ansible.builtin.dnf:
|
||||
name: ['openssh-server', 'python3-policycoreutils']
|
||||
name: procps-ng
|
||||
state: present
|
||||
|
||||
- name: systemd PID
|
||||
|
||||
@ -5,20 +5,11 @@
|
||||
gather_facts: false
|
||||
# no_log: "{{ molecule_no_log }}"
|
||||
tasks:
|
||||
# Developer must implement.
|
||||
|
||||
# Mandatory configuration for Molecule to function.
|
||||
|
||||
- name: Populate instance config
|
||||
ansible.builtin.set_fact:
|
||||
instance_conf: {}
|
||||
|
||||
- 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
|
||||
- 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 # Developer must implement.
|
||||
|
||||
2
extensions/molecule/linode/requirements.yml
Normal file
2
extensions/molecule/linode/requirements.yml
Normal file
@ -0,0 +1,2 @@
|
||||
collections:
|
||||
- community.general
|
||||
@ -1,8 +1,17 @@
|
||||
- import_tasks: include-vars.yml
|
||||
|
||||
- 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:
|
||||
name: ['podman', 'containernetworking-plugins', 'podman-plugins', 'python3-pip', 'systemd-container']
|
||||
name: "{{ dnf_packages }}"
|
||||
state: present
|
||||
|
||||
- name: Install podman-compose pip Package
|
||||
@ -21,6 +30,7 @@
|
||||
- "{{ service_users }}"
|
||||
|
||||
- name: Create service folders
|
||||
become: yes
|
||||
become_user: "{{ item.0.name }}"
|
||||
file:
|
||||
path: "/home/{{ item.0.name }}/{{ item.1 }}"
|
||||
@ -101,8 +111,7 @@
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0644
|
||||
tags:
|
||||
- 'molecule-notest'
|
||||
when: '"molecule" not in group_names'
|
||||
|
||||
- lineinfile:
|
||||
path: /etc/hosts
|
||||
@ -111,8 +120,7 @@
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0644
|
||||
tags:
|
||||
- 'molecule-notest'
|
||||
when: '"molecule" not in group_names'
|
||||
# - name: Copy cni networking driver config into place
|
||||
# blockinfile:
|
||||
# name: "/etc/cni/net.d/podman.conflist"
|
||||
|
||||
Loading…
Reference in New Issue
Block a user