strategy:
matrix:
distro:
- - ubuntu2004
- ubuntu2204
+ - ubuntu2404
fail-fast: false
steps:
- name: Gerrit Checkout
gerrit-project: ${{ inputs.GERRIT_PROJECT }}
gerrit-url: ${{ vars.GERRIT_URL }}
delay: "0s"
- - name: Install test dependencies.
+ - name: Install Podman
+ run: |
+ sudo apt-get update
+ sudo apt-get install -y podman
+ - name: Install test dependencies
run: |
python -m pip install --upgrade pip
- pip3 install ansible ansible-lint molecule-plugins[docker] docker
- - name: Run Molecule tests.
- run: molecule test
- working-directory: ${{env.working-directory}}
+ pip3 install -r requirements.txt
+ - name: Run Molecule tests
+ run: molecule test --platform-name ${{ matrix.distro }}
env:
PY_COLORS: "1"
ANSIBLE_FORCE_COLOR: "1"
- MOLECULE_PLATFORM_NAME: ${{ matrix.distro }}
+ MOLECULE_PROJECT_DIRECTORY: ${{ github.workspace }}
+ ANSIBLE_ROLES_PATH: ${{ github.workspace }}/..
vote:
if: ${{ always() }}
dependency:
name: galaxy
driver:
- name: docker
+ name: podman
platforms:
- - name: centos7
- image: centos:7
- groups:
- - centos
- - centos_version
- - name: centos7-version
- image: centos:7
- groups:
- - centos
- - centos_version
- - name: centos8
- image: quay.io/centos/centos:stream8
- groups:
- - centos
- - centos_version
- - name: centos9
- image: quay.io/centos/centos:stream9
- groups:
- - centos
- - centos_version
- - name: ubuntu1804
- image: ubuntu:18.04
- - name: ubuntu1804-version
- image: ubuntu:18.04
- groups:
- - ubuntu_version
- - name: ubuntu2004
- image: ubuntu:20.04
- - name: ubuntu2004-version
- image: ubuntu:20.04
- groups:
- - ubuntu_version
- name: ubuntu2204
image: ubuntu:22.04
- - name: ubuntu2204-version
- image: ubuntu:22.04
- groups:
- - ubuntu_version
+ - name: ubuntu2404
+ image: ubuntu:24.04
provisioner:
name: ansible
inventory:
- group_vars:
- centos_version:
- centos_docker_version: 18.06.1.ce
- ubuntu_version:
- ubuntu_docker_version: 18.06.1~ce~3-0~ubuntu
+ host_vars:
+ ubuntu2204:
+ ansible_python_interpreter: /usr/bin/python3
+ ubuntu2404:
+ ansible_python_interpreter: /usr/bin/python3
scenario:
name: default
verifier:
- name: testinfra
+ name: ansible
- name: "Checking for x86_64"
ansible.builtin.set_fact:
host_arch: "amd64"
- when: "'x86_64' in ansible_architecture"
+ when: "'x86_64' in ansible_facts['architecture']"
- name: "Checking for aarch64"
ansible.builtin.set_fact:
host_arch: "arm64"
- when: "'aarch64' in ansible_architecture"
+ when: "'aarch64' in ansible_facts['architecture']"
- name: "Checking for Centos docker version"
ansible.builtin.set_fact:
docker_ce_name: 'docker-ce-{{ centos_docker_version }}'
when:
- - ansible_os_family == 'RedHat'
+ - ansible_facts['os_family'] == 'RedHat'
- centos_docker_version != 'latest'
- name: "Checking for Ubuntu docker version"
ansible.builtin.set_fact:
docker_ce_name: 'docker-ce={{ ubuntu_docker_version }}'
when:
- - ansible_distribution == 'Ubuntu'
+ - ansible_facts['distribution'] == 'Ubuntu'
- ubuntu_docker_version != 'latest'
- name: Install Docker (RedHat 7)
become: true
- when: ansible_os_family == 'RedHat' and ansible_distribution_major_version == "7"
+ when: ansible_facts['os_family'] == 'RedHat' and ansible_facts['distribution_major_version'] == "7"
block:
- name: Install Docker requirements
ansible.builtin.yum:
- name: Install Docker (RedHat 8)
become: true
- when: ansible_os_family == 'RedHat' and ansible_distribution_major_version >= "8"
+ when: ansible_facts['os_family'] == 'RedHat' and ansible_facts['distribution_major_version'] >= "8"
block:
- name: Remove confliting packages with Docker-ce
ansible.builtin.yum:
- name: Install Docker (Ubuntu)
become: true
- when: ansible_distribution == 'Ubuntu'
+ when: ansible_facts['distribution'] == 'Ubuntu'
block:
- name: Install Docker requirements
ansible.builtin.package:
state: present
- name: Add Docker apt-repository
ansible.builtin.apt_repository:
- repo: 'deb [arch={{ host_arch }}] https://download.docker.com/linux/ubuntu {{ ansible_distribution_release }} {{ docker_repo_channel }}'
+ repo: 'deb [arch={{ host_arch }}] https://download.docker.com/linux/ubuntu {{ ansible_facts["distribution_release"] }} {{ docker_repo_channel }}'
state: present
- name: Install Docker CE
ansible.builtin.package:
path: /lib/systemd/system/docker.service
regexp: '^ExecStart='
line: 'ExecStart=/usr/bin/dockerd'
- when: ansible_distribution == 'Ubuntu'
+ when: ansible_facts['distribution'] == 'Ubuntu'
become: true
- name: Fix broken systemd file on Red Hat
path: /usr/lib/systemd/system/docker.service
regexp: '^ExecStart='
line: 'ExecStart=/usr/bin/dockerd'
- when: ansible_os_family == 'RedHat'
+ when: ansible_facts['os_family'] == 'RedHat'
become: true
- name: Enable Docker service
name: docker
enabled: true
ignore_errors: true
- when: ansible_os_family == 'RedHat'
+ when: ansible_facts['os_family'] == 'RedHat'
become: true