diff --git a/releasenotes/notes/aio-config-path-82cda1de6d1dfad7.yaml b/releasenotes/notes/aio-config-path-82cda1de6d1dfad7.yaml new file mode 100644 index 0000000000..9826c87df9 --- /dev/null +++ b/releasenotes/notes/aio-config-path-82cda1de6d1dfad7.yaml @@ -0,0 +1,14 @@ +--- +features: + - It is now possible to customise the location of the configuration + file source for the All-In-One (AIO) bootstrap process using the + ``bootstrap_host_aio_config_path`` variable. + - It is now possible to customise the location of the scripts used + in the All-In-One (AIO) boostrap process using the + ``bootstrap_host_aio_script_path`` variable. + - It is now possible to customise the name of the + ``user_variables.yml`` file created by the All-In-One (AIO) bootstrap + process using the ``bootstrap_host_user_variables_filename`` variable. + - It is now possible to customise the name of the + ``user_secrets.yml`` file created by the All-In-One (AIO) bootstrap + process using the ``bootstrap_host_user_secrets_filename`` variable. diff --git a/tests/roles/bootstrap-host/defaults/main.yml b/tests/roles/bootstrap-host/defaults/main.yml index 39f0628412..29ced5dd60 100644 --- a/tests/roles/bootstrap-host/defaults/main.yml +++ b/tests/roles/bootstrap-host/defaults/main.yml @@ -13,12 +13,23 @@ # See the License for the specific language governing permissions and # limitations under the License. +## AIO user-space configuration options # Scenario used to bootstrap the host bootstrap_host_scenario: aio - +# # Boolean option to implement OpenStack-Ansible configuration for an AIO # Switch to no for a multi-node configuration bootstrap_host_aio_config: yes +# +# Path to the location of the bootstrapping configuration files +bootstrap_host_aio_config_path: "{{ playbook_dir }}/../etc/openstack_deploy" +# +# Path to the location of the scripts the bootstrap scripts use +bootstrap_host_aio_script_path: "{{ playbook_dir }}/../scripts" +# +# The user space configuration file names to use +bootstrap_host_user_variables_filename: "user_variables.yml" +bootstrap_host_user_secrets_filename: "user_secrets.yml" ## Swap memory # If there is no swap memory present, the bootstrap will create a loopback disk diff --git a/tests/roles/bootstrap-host/tasks/prepare_aio_config.yml b/tests/roles/bootstrap-host/tasks/prepare_aio_config.yml index 78c17be58a..c0376da3a8 100644 --- a/tests/roles/bootstrap-host/tasks/prepare_aio_config.yml +++ b/tests/roles/bootstrap-host/tasks/prepare_aio_config.yml @@ -27,7 +27,7 @@ - name: Deploy user conf.d configuration config_template: - src: "../etc/openstack_deploy/conf.d/{{ item.name }}" + src: "{{ item.path | default(bootstrap_host_aio_config_path ~ '/conf.d') }}/{{ item.name }}" dest: "/etc/openstack_deploy/conf.d/{{ item.name | regex_replace('.aio$', '') }}" config_overrides: "{{ item.override | default({}) }}" config_type: "yaml" @@ -37,7 +37,7 @@ - name: Deploy openstack_user_config config_template: - src: "../etc/openstack_deploy/openstack_user_config.yml.aio" + src: "{{ bootstrap_host_aio_config_path }}/openstack_user_config.yml.aio" dest: "/etc/openstack_deploy/openstack_user_config.yml" config_overrides: "{{ openstack_user_config_overrides | default({}) }}" config_type: "yaml" @@ -47,15 +47,15 @@ - name: Deploy user_secrets file config_template: - src: "../etc/openstack_deploy/user_secrets.yml" - dest: "/etc/openstack_deploy/user_secrets.yml" + src: "{{ bootstrap_host_aio_config_path }}/user_secrets.yml" + dest: "/etc/openstack_deploy/{{ bootstrap_host_user_secrets_filename }}" config_overrides: "{{ user_secrets_overrides | default({}) }}" config_type: "yaml" tags: - deploy-user-secrets - name: Generate any missing values in user_secrets - command: ../scripts/pw-token-gen.py --file /etc/openstack_deploy/user_secrets.yml + command: "{{ bootstrap_host_aio_script_path }}/pw-token-gen.py --file /etc/openstack_deploy/{{ bootstrap_host_user_secrets_filename }}" changed_when: false tags: - generate_secrets @@ -85,7 +85,7 @@ register: pip_conf_file - name: Determine the fastest available OpenStack-Infra wheel mirror - command: ../scripts/fastest-infra-wheel-mirror.py + command: "{{ bootstrap_host_aio_script_path }}/fastest-infra-wheel-mirror.py" register: fastest_wheel_mirror when: not pip_conf_file.stat.exists @@ -107,7 +107,7 @@ - name: Set the user_variables config_template: src: "user_variables.{{ bootstrap_host_scenario }}.yml.j2" - dest: /etc/openstack_deploy/user_variables.yml + dest: "/etc/openstack_deploy/{{ bootstrap_host_user_variables_filename }}" config_overrides: "{{ user_variables_overrides | default({}) }}" config_type: yaml