Add variable for template filename

The current logic for constructing the template filename
does not allow custom scenario names. For example, if an
outside playbook defines ``boostrap_host_scenario`` to
be "swift" or "awesome_scenario", then the task would try
to look for the user_variables.swlft.yml.j2 template within the
role. This commit allows the user to define a template filename
using the variable bootstrap_user_variables_template.

Change-Id: I9fc98ea9b7d68623cb42c5fa3b9d5383fadb82d8
This commit is contained in:
alextricity25 2017-04-23 22:33:21 -05:00
parent 457a5f9d8f
commit adcdb7ed4d
3 changed files with 10 additions and 1 deletions

View File

@ -0,0 +1,6 @@
---
features:
- |
A variable named ``bootstrap_user_variables_template`` has been added
to the bootstrap-host role so the user can define the user variable
template filename for AIO deployments

View File

@ -31,6 +31,9 @@ bootstrap_host_aio_script_path: "{{ playbook_dir }}/../scripts"
bootstrap_host_user_variables_filename: "user_variables.yml"
bootstrap_host_user_secrets_filename: "user_secrets.yml"
# The user variables template to use
bootstrap_user_variables_template: "user_variables.{{ bootstrap_host_scenario }}.yml.j2"
## Swap memory
# If there is no swap memory present, the bootstrap will create a loopback disk
# for the purpose of having swap memory available. Swap is required for some of

View File

@ -113,7 +113,7 @@
- name: Set the user_variables
config_template:
src: "user_variables.{{ bootstrap_host_scenario }}.yml.j2"
src: "{{ bootstrap_user_variables_template }}"
dest: "/etc/openstack_deploy/{{ bootstrap_host_user_variables_filename }}"
config_overrides: "{{ user_variables_overrides | default({}) }}"
config_type: yaml