summaryrefslogtreecommitdiffstats
path: root/roles
diff options
context:
space:
mode:
authorAndrew Butcher <abutcher@redhat.com>2017-10-19 14:16:10 -0400
committerAndrew Butcher <abutcher@redhat.com>2017-10-19 14:48:44 -0400
commit263f6c31dd91a0b9da1ca5624f4020b956ce89f7 (patch)
treef46ce00f4f01e60a5196ed1ee34b61f02205c48e /roles
parent0aa429e7f6c76af05ef0570040cd4c262f2c98a8 (diff)
downloadopenshift-263f6c31dd91a0b9da1ca5624f4020b956ce89f7.tar.gz
openshift-263f6c31dd91a0b9da1ca5624f4020b956ce89f7.tar.bz2
openshift-263f6c31dd91a0b9da1ca5624f4020b956ce89f7.tar.xz
openshift-263f6c31dd91a0b9da1ca5624f4020b956ce89f7.zip
Check for container runtime prior to restarting when updating system CA trust.
Diffstat (limited to 'roles')
-rw-r--r--roles/openshift_node_certificates/handlers/main.yml16
1 files changed, 14 insertions, 2 deletions
diff --git a/roles/openshift_node_certificates/handlers/main.yml b/roles/openshift_node_certificates/handlers/main.yml
index 4abe8bcaf..ef66bf9ca 100644
--- a/roles/openshift_node_certificates/handlers/main.yml
+++ b/roles/openshift_node_certificates/handlers/main.yml
@@ -2,9 +2,21 @@
- name: update ca trust
command: update-ca-trust
notify:
- - restart docker after updating ca trust
+ - check for container runtime after updating ca trust
-- name: restart docker after updating ca trust
+- name: check for container runtime after updating ca trust
+ command: >
+ systemctl -q is-active {{ openshift.docker.service_name }}.service
+ register: l_docker_installed
+ # An rc of 0 indicates that the container runtime service is
+ # running. We will restart it by notifying the restart handler since
+ # we have updated the system CA trust.
+ changed_when: l_docker_installed.rc == 0
+ failed_when: false
+ notify:
+ - restart container runtime after updating ca trust
+
+- name: restart container runtime after updating ca trust
systemd:
name: "{{ openshift.docker.service_name }}"
state: restarted