diff --git a/.github/workflows/molecule.yml b/.github/workflows/molecule.yml index 4860dee..bedd79e 100644 --- a/.github/workflows/molecule.yml +++ b/.github/workflows/molecule.yml @@ -10,7 +10,7 @@ on: jobs: list-scenarios: - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 outputs: matrix: ${{ steps.listscenarios.outputs.scenarios }} steps: @@ -22,7 +22,7 @@ jobs: name: Test needs: - list-scenarios - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 strategy: # Keep running so we can see if other tests pass fail-fast: false @@ -48,7 +48,7 @@ jobs: if: startsWith(github.ref, 'refs/tags') needs: - test - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 steps: - name: galaxy uses: ome/action-ansible-galaxy-publish@main diff --git a/meta/main.yml b/meta/main.yml index d030296..949c462 100644 --- a/meta/main.yml +++ b/meta/main.yml @@ -9,10 +9,10 @@ galaxy_info: platforms: - name: EL versions: - - 7 + - 9 - name: Ubuntu versions: - - xenial + - jammy namespace: ome galaxy_tags: [] diff --git a/molecule/default/Dockerfile.j2 b/molecule/default/Dockerfile.j2 deleted file mode 100644 index 0a60553..0000000 --- a/molecule/default/Dockerfile.j2 +++ /dev/null @@ -1,14 +0,0 @@ -# Molecule managed - -{% if item.registry is defined %} -FROM {{ item.registry.url }}/{{ item.image }} -{% else %} -FROM {{ item.image }} -{% endif %} - -RUN if [ $(command -v apt-get) ]; then apt-get update && apt-get install -y python sudo bash ca-certificates && apt-get clean; \ - elif [ $(command -v dnf) ]; then dnf makecache && dnf --assumeyes install python sudo python-devel python2-dnf bash && dnf clean all; \ - elif [ $(command -v yum) ]; then yum makecache fast && yum install -y python sudo yum-plugin-ovl bash && sed -i 's/plugins=0/plugins=1/g' /etc/yum.conf && yum clean all; \ - elif [ $(command -v zypper) ]; then zypper refresh && zypper install -y python sudo bash python-xml && zypper clean -a; \ - elif [ $(command -v apk) ]; then apk update && apk add --no-cache python sudo bash ca-certificates; \ - elif [ $(command -v xbps-install) ]; then xbps-install -Syu && xbps-install -y python sudo bash ca-certificates && xbps-remove -O; fi diff --git a/molecule/default/destroy.yml b/molecule/default/destroy.yml new file mode 100644 index 0000000..2b682c9 --- /dev/null +++ b/molecule/default/destroy.yml @@ -0,0 +1,19 @@ +- 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 diff --git a/molecule/default/molecule.yml b/molecule/default/molecule.yml index 3d616a0..8b2cbdc 100644 --- a/molecule/default/molecule.yml +++ b/molecule/default/molecule.yml @@ -9,10 +9,15 @@ lint: | flake8 platforms: - name: nfs-mount - image: centos/systemd + image: eniocarboni/docker-rockylinux-systemd:9 image_version: latest command: /sbin/init privileged: true + cgroupns_mode: host + tmpfs: + - /sys/fs/cgroup + groups: + - extra_options volumes: # This allows NFS exports to work on Docker - "nfs-share-rw:/srv" diff --git a/molecule/default/playbook.yml b/molecule/default/playbook.yml index 54223ad..70df70d 100644 --- a/molecule/default/playbook.yml +++ b/molecule/default/playbook.yml @@ -27,7 +27,7 @@ - host: "*" options: "rw,fsid=0" - - role: ansible-role-nfs-mount + - role: ome.nfs_mount nfs_share_mounts: - path: /mnt/rw location: localhost:/share diff --git a/molecule/default/requirements.yml b/molecule/default/requirements.yml index 287f1ea..d306047 100644 --- a/molecule/default/requirements.yml +++ b/molecule/default/requirements.yml @@ -1,2 +1,2 @@ --- -- src: ome.nfs_share +- name: ome.nfs_share diff --git a/tasks/main.yml b/tasks/main.yml index 9c50a95..dcaae38 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -3,14 +3,16 @@ - name: Install NFS mount utility become: true - yum: + ansible.builtin.dnf: + update_cache: true name: nfs-utils state: present when: ansible_os_family == "RedHat" - name: Install NFS mount utility become: true - apt: + ansible.builtin.apt: + update_cache: true pkg: nfs-common state: present when: ansible_os_family == "Debian"