From 096816a238a861c986ec6697d012fa8d9e86156b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Jeanneret?= Date: Mon, 15 Apr 2019 09:48:24 +0200 Subject: [PATCH] Simplify and correct how we provide the undercloud.conf to mistral Bind-mounting a file from /home subdir is wrong. In addition, there were some useless steps for the container configuration, like copying the undercloud.conf to its final destination. This patch intends to simplify those steps, and prevents SELinux issues. Related change: If061d496a26c84e5027916c0d8f9153b129b451a Change-Id: I05f27a40b52305759533ad0cac8d79a15448852e --- .../mistral-executor-container-puppet.yaml | 24 +++++++------------ 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/deployment/mistral/mistral-executor-container-puppet.yaml b/deployment/mistral/mistral-executor-container-puppet.yaml index dee0b66569..481c468493 100644 --- a/deployment/mistral/mistral-executor-container-puppet.yaml +++ b/deployment/mistral/mistral-executor-container-puppet.yaml @@ -72,7 +72,6 @@ parameters: type: string conditions: - undercloud_config_file_path_unset: {equals : [{get_param: UndercloudConfigFilePath}, '']} docker_enabled: {equals: [{get_param: ContainerCli}, 'docker']} resources: @@ -135,13 +134,6 @@ outputs: dest: "/" merge: true preserve_properties: true - - if: - - undercloud_config_file_path_unset - - null - - - source: '/var/lib/undercloud.conf' - dest: '/var/lib/mistral/undercloud.conf' - merge: true - preserve_properties: true permissions: - path: /var/log/mistral owner: mistral:mistral @@ -181,14 +173,6 @@ outputs: - /usr/share/openstack-tripleo-heat-templates:/usr/share/openstack-tripleo-heat-templates:ro - {get_param: MistralExecutorVolumes} - {get_param: MistralExecutorExtraVolumes} - - if: - - undercloud_config_file_path_unset - - null - - - list_join: - - ':' - - - {get_param: UndercloudConfigFilePath} - - '/var/lib/undercloud.conf' - - 'ro,z' - - str_replace: template: '/home/tripleo-admin:/home/tripleo-admin' @@ -200,6 +184,7 @@ outputs: host_prep_tasks: - set_fact: tripleo_admin_user: {get_param: TripleoAdminUser} + undercloud_cfg_file: {get_param: UndercloudConfigFilePath} - import_role: name: tripleo-create-admin tasks_from: create_user.yml @@ -224,6 +209,13 @@ outputs: src: /home/{{ tripleo_admin_user }}/.ssh/id_rsa dest: /var/lib/mistral/.ssh/{{ tripleo_admin_user }}-rsa mode: 0600 + - name: copy undercloud.conf to /var/lib/mistral/ + when: undercloud_cfg_file != '' + copy: + src: "{{ undercloud_cfg_file }}" + dest: /var/lib/mistral/undercloud.conf + mode: 0444 + setype: svirt_sandbox_file_t - name: mistral logs readme copy: dest: /var/log/mistral/readme.txt