From 54e54f043aa648d5fb1a546c94ba47324da1d2c9 Mon Sep 17 00:00:00 2001 From: Bogdan Dobrelya Date: Wed, 20 Sep 2017 15:17:28 +0200 Subject: [PATCH] Allow custom undercloud roles files for images prepare Add custom_undercloud_roles_data. Defaults to t-h-t's /roles_data_undercloud.yaml. Defines a custom undercloud roles data file which should be taken into account when preparing docker images for containerized undercloud services deployment. The default can not be changed yet as it is hardcoded in the tripleo client. Related-bug: #1693448 Change-Id: I38bd7beefa59ef56f6f4df91715a808d4b8c228e Signed-off-by: Bogdan Dobrelya --- ...tom-undercloud-roles-file-812cf0871a3d3370.yaml | 14 ++++++++++++++ roles/undercloud-deploy/defaults/main.yml | 5 +++++ .../templates/undercloud-deploy.sh.j2 | 5 +++++ 3 files changed, 24 insertions(+) create mode 100644 releasenotes/notes/custom-undercloud-roles-file-812cf0871a3d3370.yaml diff --git a/releasenotes/notes/custom-undercloud-roles-file-812cf0871a3d3370.yaml b/releasenotes/notes/custom-undercloud-roles-file-812cf0871a3d3370.yaml new file mode 100644 index 000000000..877429dfa --- /dev/null +++ b/releasenotes/notes/custom-undercloud-roles-file-812cf0871a3d3370.yaml @@ -0,0 +1,14 @@ + +features: + - | + Add `undercloud_roles_data` for containerized undercloud + deployments. Allows to specify a custom undercloud roles file which + should be taken into account when preparing docker images for UC. + Defaults to `{{overcloud_templates_path}}/roles_data_undercloud.yaml`. + + .. note :: The default value can not be changed yet. The command + `openstack undercloud deploy` works only with the static role file + `roles_data_undercloud.yaml` from t-h-t. Custom undercloud roles + data files, like `roles/UndercloudLight.yaml`, need to be copied as + `{{ overcloud_heat_templates }}/roles_data_undercloud.yaml` in order + to use this feature. diff --git a/roles/undercloud-deploy/defaults/main.yml b/roles/undercloud-deploy/defaults/main.yml index 0da1ff914..c0fad814b 100644 --- a/roles/undercloud-deploy/defaults/main.yml +++ b/roles/undercloud-deploy/defaults/main.yml @@ -13,6 +13,11 @@ undercloud_docker_registry_port: 8787 undercloud_docker_registry_insecure: true undercloud_install_script: undercloud-install.sh.j2 +# defines a custom undercloud roles file should be used with +# openstack overcloud container image prepare (and undercloud deploy, in future) +# FIXME(bogdando): do not attempt to change it yet the client's hardcode is fixed +undercloud_roles_data: "{{overcloud_templates_path}}/roles_data_undercloud.yaml" + # defines extra args for the undercloud deploy command undercloud_extra_args: "" diff --git a/roles/undercloud-deploy/templates/undercloud-deploy.sh.j2 b/roles/undercloud-deploy/templates/undercloud-deploy.sh.j2 index 4cc8c63c6..5858b9144 100644 --- a/roles/undercloud-deploy/templates/undercloud-deploy.sh.j2 +++ b/roles/undercloud-deploy/templates/undercloud-deploy.sh.j2 @@ -84,6 +84,7 @@ openstack overcloud container image prepare \ -e {{overcloud_templates_path}}/environments/services-docker/zaqar.yaml \ -e {{overcloud_templates_path}}/environments/docker.yaml \ {% endif %} + -r {{undercloud_roles_data}} \ --namespace {{ undercloud_docker_registry_host }}:{{ undercloud_docker_registry_port }}/{{ undercloud_docker_registry_namespace }} {% if undercloud_docker_registry_insecure|bool %} echo " DockerInsecureRegistryAddress: {{ undercloud_docker_registry_host }}:{{ undercloud_docker_registry_port }}" >> \ @@ -97,6 +98,7 @@ openstack overcloud container image prepare \ -e {{overcloud_templates_path}}/environments/services-docker/zaqar.yaml \ -e {{overcloud_templates_path}}/environments/docker.yaml \ {% endif %} + -r {{undercloud_roles_data}} \ --env-file {{ working_dir }}/undercloud-containers-default-parameters.yaml {% endif %} @@ -113,6 +115,9 @@ undercloud_local_ip={{ hostvars['undercloud'].undercloud_ip }} ## * Deploy the undercloud ## :: +# TODO(bogdando) add '-r {{undercloud_roles_data}}' once the client +# starts supporting 'openstack undercloud deploy -r' option. + sudo openstack undercloud deploy \ --templates={{overcloud_templates_path}} \ --local-ip=$undercloud_local_ip \