summaryrefslogtreecommitdiffstats
path: root/roles/openshift_node/tasks/upgrade/restart.yml
diff options
context:
space:
mode:
authorMichael Gugino <mgugino@redhat.com>2017-11-09 17:00:00 -0500
committerMichael Gugino <mgugino@redhat.com>2017-11-16 09:03:35 -0500
commitafa4fd5799b0ff43d625d061e4c2bde66b5fb86a (patch)
tree2654bb42deb7dcd3b907b1476ec0fbe55c133fb2 /roles/openshift_node/tasks/upgrade/restart.yml
parent8a85bc3a00efb654238a58e1faa2a2629d9360b1 (diff)
downloadopenshift-afa4fd5799b0ff43d625d061e4c2bde66b5fb86a.tar.gz
openshift-afa4fd5799b0ff43d625d061e4c2bde66b5fb86a.tar.bz2
openshift-afa4fd5799b0ff43d625d061e4c2bde66b5fb86a.tar.xz
openshift-afa4fd5799b0ff43d625d061e4c2bde66b5fb86a.zip
Combine openshift_node and openshift_node_upgrade
Currently, having openshift_node and openshift_node_upgrade as two distinct roles has created a duplication across handlers, templates, and some tasks. This commit combines the roles to reduce duplication and bugs encountered by not putting code in both places.
Diffstat (limited to 'roles/openshift_node/tasks/upgrade/restart.yml')
-rw-r--r--roles/openshift_node/tasks/upgrade/restart.yml46
1 files changed, 46 insertions, 0 deletions
diff --git a/roles/openshift_node/tasks/upgrade/restart.yml b/roles/openshift_node/tasks/upgrade/restart.yml
new file mode 100644
index 000000000..a4fa51172
--- /dev/null
+++ b/roles/openshift_node/tasks/upgrade/restart.yml
@@ -0,0 +1,46 @@
+---
+# input variables:
+# - openshift.common.service_type
+# - openshift.common.is_containerized
+# - openshift.common.hostname
+# - openshift.master.api_port
+
+# NOTE: This is needed to make sure we are using the correct set
+# of systemd unit files. The RPMs lay down defaults but
+# the install/upgrade may override them in /etc/systemd/system/.
+# NOTE: We don't use the systemd module as some versions of the module
+# require a service to be part of the call.
+- name: Reload systemd to ensure latest unit files
+ command: systemctl daemon-reload
+
+- name: Restart docker
+ service:
+ name: "{{ openshift.docker.service_name }}"
+ state: started
+ register: docker_start_result
+ until: not docker_start_result | failed
+ retries: 3
+ delay: 30
+
+- name: Update docker facts
+ openshift_facts:
+ role: docker
+
+- name: Start services
+ service: name={{ item }} state=started
+ with_items:
+ - etcd_container
+ - openvswitch
+ - "{{ openshift.common.service_type }}-master-api"
+ - "{{ openshift.common.service_type }}-master-controllers"
+ - "{{ openshift.common.service_type }}-node"
+ failed_when: false
+
+- name: Wait for master API to come back online
+ wait_for:
+ host: "{{ openshift.common.hostname }}"
+ state: started
+ delay: 10
+ port: "{{ openshift.master.api_port }}"
+ timeout: 600
+ when: inventory_hostname in groups.oo_masters_to_config