Guillaume Coré
2020-01-15 bae3d3114c417dbf65158e33c8ddc7df62d66e52
refs
author Guillaume Coré <guillaume.core@gmail.com>
Wednesday, January 15, 2020 14:33 +0100
committer Tony Kay <ankay@redhat.com>
Wednesday, January 15, 2020 14:33 +0100
commitbae3d3114c417dbf65158e33c8ddc7df62d66e52
tree e125dfb514f611a15f2803102e0362a659a84fe3 tree | zip | gz
parent 98ac62b2dc362eb4199a9acb8bcedc0ed1565fc7 view | diff
Introduce default_vars.yml (#991)

`env_vars.yml` is a bad name and should be renamed to `default_vars.yml`.

This commit if applied, will update the `include_vars.yml` play so it looks
for the following files and includes them if they exist:

- `cloud_providers/{{ cloud_provider }}_default_vars.yml`
Global default vars related to the cloud provider
- `configs/{{ env_type }}/env_vars.yml`
Legacy env_vars.yml (replaced by default_vars.yml)
- `configs/{{ env_type }}/default_vars.yml`
Default vars of the config
- `configs/{{ env_type }}/default_vars.{{ cloud_provider }}.yml`
Default vars of the config, specific to a cloud provider
- `configs/{{ env_type }}/default_vars_{{ cloud_provider }}.yml`
`configs/{{ env_type }}/env_secret_vars.yml`
Lecacy secret vars file.

Both .yml and .yaml extensions are supported.

In order not to break current configs, `env_vars.yml` files are still included as
before.

This commit also makes it possible to have default vars for each cloud provider,
for example, it is now possible to have those files in a config:

```yaml
default_vars.yml
default_vars_osp.yml
default_vars_ec2.yml
```
1 files modified
40 ■■■■ changed files
ansible/include_vars.yml 40 ●●●● diff | view | raw | blame | history