Closed Decipher closed 7 years ago
PoC'd and it works a charm, file is included and after the vars
and vars_files
are, so will always override prior configuration.
A workaround for the moment is:
pre_tasks:
- name: Include CI config.
include_vars: "{{ beet_base }}/.beetbox/ci.config.yml"
when: "{{ lookup('env','BEET_CI') }}"
Or similar.
That will only include the ci.config.yml
file when BEET_CI
is true.
This could be done along with -- https://github.com/beetboxvm/beetbox/issues/325
so it would automatically include a config file with the name of {{ beet_env }}.config.yml
if that file existed.
Again for CI, the ability to add an extra vars file via the
--extra-vars "@some_file.yml"
command line argument, passed through via an argument tobeetbox.sh
would allow a simple way to add CI specific overrides to playbooks.Not 100% sure if the argument will support a yml file, as the documentation specified a JSON file but then goes on to say YML format is supported, nor am I sure on how the hierarchy will work here, if that new file will be included before or after the existing files, but I will prototype it when I can.