mirror of
https://github.com/de-it-krachten/ansible-role-molecule
synced 2026-05-14 03:41:47 +00:00
No description
- Shell 92%
- Jinja 8%
# [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 ([ |
||
|---|---|---|
| .github/workflows | ||
| defaults | ||
| files | ||
| meta | ||
| molecule/default | ||
| tasks | ||
| .ansible-lint | ||
| .cicd | ||
| .cicd.overwrite | ||
| .collections | ||
| .git.include | ||
| .gitignore | ||
| .releaserc.yml | ||
| .roles | ||
| .yamllint | ||
| CHANGELOG.md | ||
| README.md | ||
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