Skip to content

Instantly share code, notes, and snippets.

@jonashackt
Created November 30, 2018 13:50
Show Gist options
  • Save jonashackt/dbfc9b4715ba642244a08870b943e9cc to your computer and use it in GitHub Desktop.
Save jonashackt/dbfc9b4715ba642244a08870b943e9cc to your computer and use it in GitHub Desktop.
Molecule: define host_vars or group_vars in provisioner/inventory that are really used by Molecule´s platform
# Roles which require host/groups to have certain variables set
# see (scroll down!) https://molecule.readthedocs.io/en/latest/configuration.html#provisioner & https://github.com/ansible/molecule/issues/1037
# like:
provisioner:
name: ansible
...
inventory:
host_vars:
docker-debian-stretch:
gitlab_domain: "localhost"
# Molecule uses the name of the Platform to create an inventory host name
# you have to do nothing, if you chooce the same name there (& host_vars in provisioner) like this:
platforms:
- name: docker-debian-stretch
...
# if you use group_vars under inventory, you have to define groups also under Platforms:
# see https://molecule.readthedocs.io/en/latest/configuration.html#platforms
platforms:
- name: docker-debian-stretch
groups:
- other-name-then-docker-debian-stretch
# but now you can´t re-use the nice platform name - so just stay with host_vars :)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment