The directory containing the rules for the molecule included linter, yamllint and ansible-lint These rules are global for all roles and when changed could break roles!
- yaml-lint.yml contains rules for yamllint
- ansible-lint contains rules for ansible-lint
- ansible-lint-rules contains custom rules for ansible-lint
docker build .
ENV vars are prefixed with DEV_
because MOLECULE_
and ANSIBLE_
are reserved namespaces
Available ENV vars:
DEV_MOLECULE_RULES
point to molecule-rules directory
Roles can be tested with the following commands, executed from the role directory, where the last part is the command executed by bash:
The Docker socket needs to be listening on 127.0.0.1:2375 see the Docker docs
docker run -it -v $(pwd):/data/$(basename ~+) \
-w /data/$(basename ~+) \
-e LOCAL_USER_ID=`id -u $USER` \
-e LOCAL_GROUP_ID=`getent group lxd | cut -d: -f3` \
lansible/ansible-dev-container:2.6 molecule test
docker run -it -v ${PWD}:/data/$(Split-Path -Path $PWD -Leaf) \
-w /data/$(Split-Path -Path $PWD -Leaf) \
lansible/ansible-dev-container:2.6 molecule test