From d87efd29ed7ce6e741975b75a4c70020bd1a4599 Mon Sep 17 00:00:00 2001 From: Emilien Macchi Date: Tue, 15 Jan 2019 13:13:26 +0100 Subject: [PATCH] Conditionalize docker socket bind-mount The socket is only needed when ContainerCli is set to 'docker'. It only affects mistral executor and sensu-client containers, which were the last containers relying on the socket. For sensu-client, it was for healthchecks and they are being replaced by systemd so the feature parity will be here. For mistral-executor, it's needed by tripleo-validations running docker CLI and they will have to run podman cli instead of docker. Change-Id: I4e3d29a6eb65d871d7a1a935fcbd7bb98e7d1752 --- docker/services/mistral-executor.yaml | 14 +++++++++++++- docker/services/sensu-client.yaml | 19 +++++++++++++++---- 2 files changed, 28 insertions(+), 5 deletions(-) diff --git a/docker/services/mistral-executor.yaml b/docker/services/mistral-executor.yaml index 00eca9f8e4..6fac92908e 100644 --- a/docker/services/mistral-executor.yaml +++ b/docker/services/mistral-executor.yaml @@ -56,9 +56,16 @@ parameters: default: '' description: Configuration file for Undercloud, needed by TripleO Validations. type: string + ContainerCli: + type: string + default: 'docker' + description: CLI tool used to manage containers. + constraints: + - allowed_values: ['docker', 'podman'] conditions: undercloud_config_file_path_unset: {equals : [{get_param: UndercloudConfigFilePath}, '']} + docker_enabled: {equals: [{get_param: ContainerCli}, 'docker']} resources: @@ -104,7 +111,12 @@ outputs: - {get_attr: [MySQLClient, role_data, step_config]} config_image: {get_param: DockerMistralConfigImage} volumes: - - /var/run/docker.sock:/var/run/docker.sock:rw + list_concat: + - + if: + - docker_enabled + - - /var/run/docker.sock:/var/run/docker.sock:rw + - null kolla_config: /var/lib/kolla/config_files/mistral_executor.json: command: /usr/bin/mistral-server --config-file=/etc/mistral/mistral.conf --log-file=/var/log/mistral/executor.log --server=executor diff --git a/docker/services/sensu-client.yaml b/docker/services/sensu-client.yaml index e65fc90a37..36a099752f 100644 --- a/docker/services/sensu-client.yaml +++ b/docker/services/sensu-client.yaml @@ -68,7 +68,15 @@ parameters: type: number description: The number of seconds sensu-plugin-aware handlers should wait before taking second action. default: 90 + ContainerCli: + type: string + default: 'docker' + description: CLI tool used to manage containers. + constraints: + - allowed_values: ['docker', 'podman'] +conditions: + docker_enabled: {equals: [{get_param: ContainerCli}, 'docker']} resources: ContainersCommon: @@ -145,10 +153,13 @@ outputs: list_concat: - {get_attr: [ContainersCommon, volumes]} - - - /var/run/docker.sock:/var/run/docker.sock:rw - - /var/lib/kolla/config_files/sensu-client.json:/var/lib/kolla/config_files/config.json:ro - - /var/lib/config-data/puppet-generated/sensu/:/var/lib/kolla/config_files/src:ro - - /var/log/containers/sensu:/var/log/sensu:rw + if: + - docker_enabled + - - /var/run/docker.sock:/var/run/docker.sock:rw + - null + - /var/lib/kolla/config_files/sensu-client.json:/var/lib/kolla/config_files/config.json:ro + - /var/lib/config-data/puppet-generated/sensu/:/var/lib/kolla/config_files/src:ro + - /var/log/containers/sensu:/var/log/sensu:rw environment: - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS host_prep_tasks: