summaryrefslogtreecommitdiffstats
path: root/playbooks/common/openshift-master/restart_hosts_pacemaker.yml
diff options
context:
space:
mode:
authorAndrew Butcher <abutcher@redhat.com>2016-01-05 11:39:22 -0500
committerAndrew Butcher <abutcher@redhat.com>2016-01-11 16:04:36 -0500
commitf9aaa8ac13adf841823f35be594641bdc2ebecac (patch)
treed60ccafbd99d54beb901766329e6f670aedaaff7 /playbooks/common/openshift-master/restart_hosts_pacemaker.yml
parentdea9abfe22864cf10d85d85370b1633ca18060b6 (diff)
downloadopenshift-f9aaa8ac13adf841823f35be594641bdc2ebecac.tar.gz
openshift-f9aaa8ac13adf841823f35be594641bdc2ebecac.tar.bz2
openshift-f9aaa8ac13adf841823f35be594641bdc2ebecac.tar.xz
openshift-f9aaa8ac13adf841823f35be594641bdc2ebecac.zip
Update rolling restart playbook for pacemaker support.
Replace fail with a warn and prompt if running ansible from a host that will be rebooted. Re-organize playbooks.
Diffstat (limited to 'playbooks/common/openshift-master/restart_hosts_pacemaker.yml')
-rw-r--r--playbooks/common/openshift-master/restart_hosts_pacemaker.yml25
1 files changed, 25 insertions, 0 deletions
diff --git a/playbooks/common/openshift-master/restart_hosts_pacemaker.yml b/playbooks/common/openshift-master/restart_hosts_pacemaker.yml
new file mode 100644
index 000000000..c9219e8de
--- /dev/null
+++ b/playbooks/common/openshift-master/restart_hosts_pacemaker.yml
@@ -0,0 +1,25 @@
+- name: Fail over master resource
+ command: >
+ pcs resource move master {{ hostvars | oo_select_keys(groups['oo_masters_to_config']) | oo_collect('openshift.common.hostname', {'is_active': 'False'}) | list | first }}
+- name: Wait for master API to come back online
+ become: no
+ local_action:
+ module: wait_for
+ host="{{ openshift.master.cluster_hostname }}"
+ state=started
+ delay=10
+ port="{{ openshift.master.api_port }}"
+- 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
+- name: Wait for master to start
+ become: no
+ local_action:
+ module: wait_for
+ host="{{ inventory_hostname }}"
+ state=started
+ delay=10