From d37579fd787185b292b5d547f5ac3cf17dd2fd9e Mon Sep 17 00:00:00 2001 From: Grzegorz Grasza Date: Mon, 22 Jun 2020 12:08:19 +0200 Subject: [PATCH] Fix Error: invalid arguments you must use just one container The podman ps command can return multiple containers, which might happen during an upgrade, when an old container lingers on. We want to copy the cert into all of them. Change-Id: I335b75feb9b01fa0e6a80d24b8c6ea79ca6480f9 Closes-Bug: #1884731 Resolves: rhbz#1849211 --- deployment/haproxy/haproxy-public-tls-inject.yaml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/deployment/haproxy/haproxy-public-tls-inject.yaml b/deployment/haproxy/haproxy-public-tls-inject.yaml index e208e4eedf..cfe0dba9a5 100644 --- a/deployment/haproxy/haproxy-public-tls-inject.yaml +++ b/deployment/haproxy/haproxy-public-tls-inject.yaml @@ -173,9 +173,9 @@ outputs: - container_id.stdout is defined - container_id.stdout != '' block: - - name: copy certificate from host to container - shell: "{{ container_cli }} cp {{ cert_path }} {{ container_id.stdout }}:{{ cert_path }}" - - name: set certificate group on host via container - command: "{{ container_cli }} exec --user root {{container_id.stdout}} chgrp haproxy {{ cert_path }}" - - name: send restart order to haproxy container - command: "{{ container_cli }} kill --signal=HUP {{ container_id.stdout }}" + - name: copy certificate, chgrp, restart haproxy + shell: | + {{ container_cli }} cp {{ cert_path }} {{ item }}:{{ cert_path }} + {{ container_cli }} exec --user root {{ item }} chgrp haproxy {{ cert_path }} + {{ container_cli }} kill --signal=HUP {{ item }} + with_items: "{{ container_id.stdout.split('\n') }}"