From c378c56c138945b78d69b8c42218bef74b85de2b Mon Sep 17 00:00:00 2001 From: Russell Teague Date: Wed, 22 Nov 2017 13:05:18 -0500 Subject: Include Deprecation - openshift-master --- playbooks/openshift-master/private/config.yml | 4 +-- playbooks/openshift-master/private/restart.yml | 9 +++-- .../openshift-master/private/restart_hosts.yml | 40 ---------------------- .../openshift-master/private/restart_services.yml | 4 --- playbooks/openshift-master/private/scaleup.yml | 12 +++---- .../private/tasks/restart_hosts.yml | 40 ++++++++++++++++++++++ .../private/tasks/restart_services.yml | 4 +++ 7 files changed, 56 insertions(+), 57 deletions(-) delete mode 100644 playbooks/openshift-master/private/restart_hosts.yml delete mode 100644 playbooks/openshift-master/private/restart_services.yml create mode 100644 playbooks/openshift-master/private/tasks/restart_hosts.yml create mode 100644 playbooks/openshift-master/private/tasks/restart_services.yml (limited to 'playbooks/openshift-master/private') diff --git a/playbooks/openshift-master/private/config.yml b/playbooks/openshift-master/private/config.yml index 6b0fd6b7c..afb8d6bd1 100644 --- a/playbooks/openshift-master/private/config.yml +++ b/playbooks/openshift-master/private/config.yml @@ -11,7 +11,7 @@ status: "In Progress" start: "{{ lookup('pipe', 'date +%Y%m%d%H%M%SZ') }}" -- include: certificates.yml +- import_playbook: certificates.yml - name: Disable excluders hosts: oo_masters_to_config @@ -229,7 +229,7 @@ hosts: oo_masters serial: 1 tasks: - - include: tasks/wire_aggregator.yml + - include_tasks: tasks/wire_aggregator.yml - name: Re-enable excluder if it was previously enabled hosts: oo_masters_to_config diff --git a/playbooks/openshift-master/private/restart.yml b/playbooks/openshift-master/private/restart.yml index 4d73b8124..5cb284935 100644 --- a/playbooks/openshift-master/private/restart.yml +++ b/playbooks/openshift-master/private/restart.yml @@ -1,5 +1,5 @@ --- -- include: validate_restart.yml +- import_playbook: validate_restart.yml - name: Restart masters hosts: oo_masters_to_config @@ -7,13 +7,12 @@ openshift_master_ha: "{{ groups.oo_masters_to_config | length > 1 }}" serial: 1 handlers: - - include: ../../../roles/openshift_master/handlers/main.yml - static: yes + - import_tasks: ../../../roles/openshift_master/handlers/main.yml roles: - openshift_facts post_tasks: - - include: restart_hosts.yml + - include_tasks: tasks/restart_hosts.yml when: openshift_rolling_restart_mode | default('services') == 'system' - - include: restart_services.yml + - include_tasks: tasks/restart_services.yml when: openshift_rolling_restart_mode | default('services') == 'services' diff --git a/playbooks/openshift-master/private/restart_hosts.yml b/playbooks/openshift-master/private/restart_hosts.yml deleted file mode 100644 index a5dbe0590..000000000 --- a/playbooks/openshift-master/private/restart_hosts.yml +++ /dev/null @@ -1,40 +0,0 @@ ---- -- 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/restart_services.yml b/playbooks/openshift-master/private/restart_services.yml deleted file mode 100644 index 4e1b3a3be..000000000 --- a/playbooks/openshift-master/private/restart_services.yml +++ /dev/null @@ -1,4 +0,0 @@ ---- -- include_role: - name: openshift_master - tasks_from: restart.yml diff --git a/playbooks/openshift-master/private/scaleup.yml b/playbooks/openshift-master/private/scaleup.yml index 021399965..8229eccfa 100644 --- a/playbooks/openshift-master/private/scaleup.yml +++ b/playbooks/openshift-master/private/scaleup.yml @@ -44,14 +44,14 @@ delay: 1 changed_when: false -- include: set_network_facts.yml +- import_playbook: set_network_facts.yml -- include: ../../openshift-etcd/private/certificates.yml +- import_playbook: ../../openshift-etcd/private/certificates.yml -- include: config.yml +- import_playbook: config.yml -- include: ../../openshift-loadbalancer/private/config.yml +- import_playbook: ../../openshift-loadbalancer/private/config.yml -- include: ../../openshift-node/private/certificates.yml +- import_playbook: ../../openshift-node/private/certificates.yml -- include: ../../openshift-node/private/config.yml +- import_playbook: ../../openshift-node/private/config.yml 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 -- cgit v1.2.3