summaryrefslogtreecommitdiffstats
path: root/playbooks/openshift-master/private/tasks
diff options
context:
space:
mode:
authorRussell Teague <rteague@redhat.com>2017-11-22 16:36:45 -0500
committerGitHub <noreply@github.com>2017-11-22 16:36:45 -0500
commit4e6df8801fcb627804b1f4075d25da6d38b49639 (patch)
tree7e0a9877fb859aacbfa6af17b627d6214db16f76 /playbooks/openshift-master/private/tasks
parent9a405010c5a656f89866906d29866ba98493e91b (diff)
parentc378c56c138945b78d69b8c42218bef74b85de2b (diff)
downloadopenshift-4e6df8801fcb627804b1f4075d25da6d38b49639.tar.gz
openshift-4e6df8801fcb627804b1f4075d25da6d38b49639.tar.bz2
openshift-4e6df8801fcb627804b1f4075d25da6d38b49639.tar.xz
openshift-4e6df8801fcb627804b1f4075d25da6d38b49639.zip
Merge pull request #6231 from mtnbikenc/include-deprecation-openshift-master
Include Deprecation - openshift-master
Diffstat (limited to 'playbooks/openshift-master/private/tasks')
-rw-r--r--playbooks/openshift-master/private/tasks/restart_hosts.yml40
-rw-r--r--playbooks/openshift-master/private/tasks/restart_services.yml4
2 files changed, 44 insertions, 0 deletions
diff --git a/playbooks/openshift-master/private/tasks/restart_hosts.yml b/playbooks/openshift-master/private/tasks/restart_hosts.yml
new file mode 100644
index 000000000..a5dbe0590
--- /dev/null
+++ b/playbooks/openshift-master/private/tasks/restart_hosts.yml
@@ -0,0 +1,40 @@
+---
+- name: Restart master system
+ # https://github.com/ansible/ansible/issues/10616
+ shell: sleep 2 && shutdown -r now "OpenShift Ansible master rolling restart"
+ async: 1
+ poll: 0
+ ignore_errors: true
+ become: yes
+
+# WARNING: This process is riddled with weird behavior.
+
+# Workaround for https://github.com/ansible/ansible/issues/21269
+- set_fact:
+ wait_for_host: "{{ ansible_host }}"
+
+# Ansible's blog documents this *without* the port, which appears to now
+# just wait until the timeout value and then proceed without checking anything.
+# port is now required.
+#
+# However neither ansible_ssh_port or ansible_port are reliably defined, likely
+# only if overridden. Assume a default of 22.
+- name: Wait for master to restart
+ local_action:
+ module: wait_for
+ host="{{ wait_for_host }}"
+ state=started
+ delay=10
+ timeout=600
+ port="{{ ansible_port | default(ansible_ssh_port | default(22,boolean=True),boolean=True) }}"
+ become: no
+
+# Now that ssh is back up we can wait for API on the remote system,
+# avoiding some potential connection issues from local system:
+- 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
diff --git a/playbooks/openshift-master/private/tasks/restart_services.yml b/playbooks/openshift-master/private/tasks/restart_services.yml
new file mode 100644
index 000000000..4e1b3a3be
--- /dev/null
+++ b/playbooks/openshift-master/private/tasks/restart_services.yml
@@ -0,0 +1,4 @@
+---
+- include_role:
+ name: openshift_master
+ tasks_from: restart.yml