See Molecule setup and requirements for system requirements.
# We use --site-packages as it needs bindings that only exist in a system package
# https://github.com/ansible/ansible/issues/34340
# strange temporary pipenv flow due to a bug
# https://github.com/pypa/pipenv/issues/3504#issuecomment-464453146
pipenv --site-packages --three
pipenv install --dev
If you install new dependencies needed for users, please make sure to export them to requirements.txt as new users might not have pipenv installed (as it is provided as a role):
pipenv lock -r >requirements.txt
Some roles are installed as [sub-repos](https://github.com/ingydotnet/git-subrepo). This is so that we can pull upstream updates and also push updates upstream of our own. You have a role available that sets up git-subrepo for you.
Please get familiar with this tool if editing these roles (they contain .gitrepo
on the root location).
- To run a role locally without writing a playbook, just use the included ./bin/ansible-role.sh
These are ran on:
locally via ./bin/test-local-docker.sh (it assumes pipenv is configured) * the above runs all tests, to test a single role you can run:
pipenv run bash -c "(cd roles/<tested_role>; molecule test)"
pipenv run molecule init role --driver-name docker -r roles/<role_name> --verifier-name testinfra
Then
- In the role dir, make use of the shared boilerplate molecule.yml: rm molecule/default/molecule.yml && ln -s ../../../molecule-shared.yml molecule/default/molecule.yml
- Add role to
.travis-ci.yml
- Add role to the list in the README
- Make sure tests pass
Fedora: `Unknown Error occured: coreutils-single conflicts with coreutils-8.30-6.fc29.x86_64", "rc": 1, "results": []}
At the time of writing, this is an open issue on GitHub. Remove the use of update_cache
in the dnf
module.