No description
  • Shell 92%
  • Jinja 8%
Find a file
semantic-release-bot 0f75ccacd1 chore(release): 1.11.0 [skip ci]
# [1.11.0](https://github.com/de-it-krachten/ansible-role-molecule/compare/v1.10.0...v1.11.0) (2026-07-26)

### Bug Fixes

* Standarize vars.yml ([b13ac26](b13ac269ad))

### Features

* Added support for Fedora 44 ([5780f76](5780f76c73))
* Added support for Ubuntu 26.04 LTS ([f1025ad](f1025adb80))
* Drop support for Fedora 42 ([cdd2973](cdd297383e))
2026-07-26 19:56:03 +00:00
.github/workflows Update CI 2026-07-23 14:49:27 +02: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-06-07 17:03:22 +02:00
molecule/default Update CI 2026-07-25 17:29:36 +02:00
tasks fix: Standarize vars.yml 2026-06-07 15:58:48 +02:00
.ansible-lint Update CI 2026-06-07 17:03:22 +02:00
.cicd Update CI 2026-06-09 11:08:20 +02: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.11.0 [skip ci] 2026-07-26 19:56:03 +00:00
README.md Update CI 2026-06-07 17:03:22 +02: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
  • Ubuntu 26.04 LTS
  • Fedora 43
  • Fedora 441

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