- Any os with bash, zsh or other *nix-style command promt
- python 3.10.x
- virtualenv using wanted!
- ansible-core above 2.13.0 but lower 2.13.6
If you are installing software not to virtualenv or --user it's your own risk to broke security or working environment using highest privileges
Make sure you have uninstalled all other versions to avoid broken dependencies (better option is uuse virtualenv!)
pip install --upgrade pip virtualenv
python -m virtualenv $HOME/ansible-core2.13
source $HOME/ansible-core2.13/bin/activate
pip install --upgrade -r requirements.txt
ansible-galaxy install -r requirements.yml
- Complete meta/main.yml from your role with template from templates_role/meta.yml
- Add requirements.yml to root of your role with all depenencies using as template file templates_role/requirements.yml if you have any dependencies for your role
- copy from templates_linter to your role
- check your role with commands:
yamllint ./ ;\
ansible-lint ./ -v
fix all errors before continue
Run in root folder of your role
molecule init scenario --role-name YOUR_ROLE_NAME --driver-name ec2
#### Running molecule
Test your molecule config by
```shell
molecule create
Run tests by
molecule test --destroy=never -- -b -e ANSIBLE_VAR=ANSIBLE_VALUE
Where after -- going ansible arguments passing from molecule to your playbook:
- become -b
- any additional variables for role -e ANSIBLE_VAR=ANSIBLE_VALUE
NB!!! Don't forget execute destroy after end of testing
molecule destroy