- PowerShell 57.4%
- Shell 42.6%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| defaults | ||
| files | ||
| handlers | ||
| meta | ||
| molecule/default | ||
| tasks | ||
| templates | ||
| vars | ||
| .ansible-lint | ||
| .gitignore | ||
| .yamllint | ||
| BEST_PRACTICES.md | ||
| CHANGELOG.md | ||
| CODE_OF_CONDUCT.md | ||
| CONTRIBUTING.md | ||
| IMPROVEMENTS.md | ||
| LICENSE | ||
| molecule.sh | ||
| README.md | ||
| rename.ps1 | ||
| rename.sh | ||
| requirements.txt | ||
| SECURITY.md | ||
Ansible Role Template
A professional Ansible role template for SPIE DataSolutions. This template provides a structured foundation for creating new Ansible roles with best practices, testing, and CI/CD integration.
Quick Start
To use this template as a base for your new role:
# Clone or download this template
git clone <repository-url> my-new-role
cd my-new-role
# Run the rename script to customize the template
powershell -ExecutionPolicy Bypass -File rename.ps1
# or on Linux:
./rename.sh
Supported Platforms
- Debian
- Debian 12 (Bookworm)
- Debian 13 (Trixie)
- Ubuntu
- Ubuntu 22.04 LTS (Jammy)
- Ubuntu 24.04 LTS (Noble)
- Enterprise Linux
- RHEL/Rocky Linux 9
Requirements
- Ansible >= 2.10
- Python 3.8+
- Docker (for local testing with Molecule)
- pip packages: see
requirements.txt
Installation
From Galaxy
ansible-galaxy role install spie-ds.<role_name>
From Git
ansible-galaxy install git+https://git.ds.spie-nl.com/datasolutions/ansible-role-<role_name>.git
Role Variables
Default values are defined in defaults/main.yml. Override these in your playbook or inventory:
# Example: defaults/main.yml
role_name_example_var: "default_value"
For detailed variable documentation, see the comments in:
defaults/main.yml- Default configuration valuesvars/main.yml- Internal role variables (not meant to be overridden)
Dependencies
None. This role is designed to be self-contained.
Example Playbook
Basic usage:
---
- name: Configure systems with role
hosts: all
become: true
gather_facts: true
roles:
- role: spie-ds.<role_name>
vars:
role_name_example_var: "custom_value"
With tags for selective execution:
---
- name: Configure systems with role
hosts: all
become: true
gather_facts: true
roles:
- role: spie-ds.<role_name>
tags:
- configuration
- packages
Testing
This role uses Molecule for testing with the following platforms:
- Debian 12 (Bookworm)
- Ubuntu 22.04 LTS (Jammy)
- Rocky Linux 9
Running Tests Locally
Prerequisites
Install the Python dependencies:
python -m pip install --upgrade -r requirements.txt
Ensure Docker daemon is running:
sudo systemctl start docker
Running Molecule Tests
Run complete test suite for all platforms:
molecule test
Run tests for specific distribution:
# For Debian 12
MOLECULE_DISTRO=debian12 molecule test
# For Ubuntu 22.04
MOLECULE_DISTRO=ubuntu2404 molecule test
# For Rocky Linux 9
MOLECULE_DISTRO=rocky9 molecule test
Run without destroying containers (for debugging):
molecule converge
molecule verify
Linting
Check code quality:
ansible-lint
yamllint .
The CI pipeline automatically tests all supported distributions.
Troubleshooting
Common Issues
Molecule container won't start:
- Ensure Docker is running:
sudo systemctl start docker - Check permissions:
sudo usermod -aG docker $USER - Recreate containers:
molecule destroy && molecule test
Ansible connection errors:
- Verify SSH keys are configured
- Check firewall rules
- Ensure
ansible_useris set correctly
Galaxy role import fails:
- Verify
meta/main.ymlis valid - Check namespace and role naming conventions
- Ensure version is valid SemVer
For more help, open an issue or contact support.ds.nl@spie.com
License
MIT - See LICENSE file for details.
Copyright (c) 2026 SPIE DataSolutions B.V.
Changelog
See CHANGELOG.md for a list of all notable changes to this project.
Security
Please see our Security Policy for reporting security vulnerabilities.
Contributing
Please read our Contributing Guide and Code of Conduct before submitting a Pull Request.
Support
For questions or support, contact: support.ds.nl@spie.com