No description
  • Shell 92%
  • Jinja 8%
Find a file
semantic-release-bot 7477e70af1 chore(release): 1.10.0 [skip ci]
# [1.10.0](https://github.com/de-it-krachten/ansible-role-molecule/compare/v1.9.0...v1.10.0) (2026-03-15)

### Features

* Added support for AlmaLinux 10 ([0df8fdc](0df8fdc9f5))
* Added support for Fedora 42 ([ea90130](ea90130799))
* Added support for Fedora 43 ([53dfbe7](53dfbe7298))
* Added support for Red Hat Enterprise Linux 10 ([451cd42](451cd42072))
* Added support for RockyLinux 10 ([aeb91ca](aeb91ca06e))
2026-03-15 11:39:16 +00:00
.github/workflows Update supported platforms & CI 2026-03-14 19:44:55 +01:00
defaults feat: Restrict supported platforms 2025-03-15 21:57:47 +01:00
files fix: Add dedicated/temporary roles path 2025-02-19 14:47:00 +01:00
meta Update CI 2026-03-06 22:51:50 +01:00
molecule/default Update supported platforms & CI 2026-03-14 15:04:08 +01:00
tasks fix: Update code for ansible11 2025-03-14 23:37:04 +01:00
.ansible-lint feat: Update CI to latest standards 2022-10-08 14:08:19 +02:00
.cicd Update CI 2026-03-06 22:51:50 +01:00
.cicd.overwrite Update CI 2026-03-06 22:51:50 +01:00
.collections feat: Move to FQCN 2022-10-08 14:07:57 +02:00
.git.include fix: Add support for fallback to old Galaxy server on specific ansible versions 2024-08-21 20:22:25 +02:00
.gitignore feat: Update supported platforms & CI 2024-12-29 02:21:46 +01:00
.releaserc.yml Update CI 2026-03-06 22:51:50 +01:00
.roles feat: Update CI to latest standards 2022-10-08 14:08:19 +02:00
.yamllint Update CI 2024-10-17 00:27:24 +02:00
CHANGELOG.md chore(release): 1.10.0 [skip ci] 2026-03-15 11:39:16 +00:00
README.md Update CI 2026-03-06 22:51:50 +01:00

CI

ansible-role-molecule

Install & manage molecule for testing Ansible roles

Dependencies

Roles

  • deitkrachten.docker
  • deitkrachten.python

Collections

None

Platforms

Supported platforms

  • Red Hat Enterprise Linux 81
  • Red Hat Enterprise Linux 91
  • Red Hat Enterprise Linux 101
  • RockyLinux 8
  • RockyLinux 9
  • RockyLinux 10
  • AlmaLinux 8
  • AlmaLinux 9
  • AlmaLinux 10
  • Ubuntu 22.04 LTS
  • Ubuntu 24.04 LTS
  • Fedora 42
  • Fedora 43

Note: 1 : no automated testing is performed on these platforms

Role Variables

defaults/main.yml


# Should python be installed by this role
molecule_python_install: false

# Python version to use
molecule_python: /usr/bin/python3

# Should molecule virtual environments be created by this role
molecule_python_venv: true

# base directory for all virtual environments
molecule_venv_root: /usr/local/venv

# list of OS packages required
molecule_os_packages:
  - jq
  - git

# list of all virtual environments
molecule_venvs:
  - name: docker-compose
    state: present
    recreate: false
    python: "{{ molecule_python }}"
    site_packages: false
    user: "{{ molecule_virtualenv_user | default('root') }}"
    packages:
      - "docker<7"
      - "docker-compose"
  - name: ansible11
    state: present
    recreate: false
    python: "{{ molecule_python }}"
    site_packages: false
    user: "{{ molecule_virtualenv_user | default('root') }}"
    packages:
      - "ansible>=11,<12"
      - ansible-lint
      - molecule
      # - docker
      # - docker-compose
      - lxml
      - dnspython
      - jmespath
      - netaddr
      - requests
  - name: e2j2
    state: present
    recreate: false
    python: "{{ molecule_python }}"
    site_packages: false
    user: "{{ molecule_virtualenv_user | default('root') }}"
    packages:
      - e2j2
      - jinja2-ansible-filters
  - name: yq
    state: present
    recreate: false
    python: "{{ molecule_python }}"
    site_packages: false
    user: "{{ molecule_virtualenv_user | default('root') }}"
    packages:
      - yq

# List of direct links or indirect via wrapper
molecule_links:
  - { link: /usr/local/bin/molecule, cmd: /usr/local/venv/ansible11/bin/molecule, direct: false }
  - { link: /usr/local/bin/ansible, cmd: /usr/local/venv/ansible11/bin/ansible, direct: true }
  - { link: /usr/local/bin/ansible-galaxy, cmd: /usr/local/venv/ansible11/bin/ansible-galaxy, direct: true }
  - { link: /usr/local/bin/ansible-playbook, cmd: /usr/local/venv/ansible11/bin/ansible-playbook, direct: true }
  - { link: /usr/local/bin/ansible-lint, cmd: /usr/local/venv/ansible11/bin/ansible-lint, direct: false }
  - { link: /usr/local/bin/yamllint, cmd: /usr/local/venv/ansible11/bin/yamllint, direct: true }
  - { link: /usr/local/bin/e2j2, cmd: /usr/local/venv/e2j2/bin/e2j2, direct: true }
  - { link: /usr/local/bin/yq, cmd: /usr/local/venv/yq/bin/yq, direct: true }
  - { link: /usr/local/bin/docker-compose, cmd: /usr/local/venv/docker-compose/bin/docker-compose, direct: true }

defaults/family-RedHat-8.yml


# Install python 3.11
molecule_python311: true

# Python version to use
molecule_python: /usr/bin/python3.11

defaults/family-RedHat-9.yml


# Install python 3.11
molecule_python311: true

# Python version to use
molecule_python: /usr/bin/python3.11

defaults/Ubuntu-22.yml


# Install python 3.11
molecule_python311: true

# Python version to use
molecule_python: /usr/bin/python3.11

Example Playbook

molecule/default/converge.yml


- name: sample playbook for role 'molecule'
  hosts: all
  become: 'yes'
  vars:
    molecule_driver: '{{ lookup(''env'', ''MOLECULE_DRIVER_NAME'') }}'
    molecule_python_install: true
  roles:
    - deitkrachten.python
  tasks:
    - name: Include role 'molecule'
      ansible.builtin.include_role:
        name: molecule