12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- ---
- - block:
- - debug:
- msg: "Running openshift_node_pre_cordon_hook {{ openshift_node_pre_cordon_hook }}"
- - include_tasks: "{{ openshift_node_pre_cordon_hook }}"
- when: openshift_node_pre_cordon_hook is defined
- - name: Cordon node prior to upgrade
- command: >
- oc adm cordon {{ ansible_nodename | lower }}
- --kubeconfig={{ openshift_node_kubeconfig_path }}
- delegate_to: localhost
- - name: Drain node prior to upgrade
- command: >
- oc adm drain {{ ansible_nodename | lower }}
- --kubeconfig={{ openshift_node_kubeconfig_path }}
- --force --delete-local-data --ignore-daemonsets
- delegate_to: localhost
- # Run the openshift_node_pre_upgrade_hook if defined
- - block:
- - debug:
- msg: "Running node openshift_node_pre_upgrade_hook {{ openshift_node_pre_upgrade_hook }}"
- - include_tasks: "{{ openshift_node_pre_upgrade_hook }}"
- when: openshift_node_pre_upgrade_hook is defined
- # Upgrade Node Packages
- - import_tasks: install.yml
- # Apply machine config
- - import_tasks: apply_machine_config.yml
- # Run the openshift_node_pre_uncordon_hook if defined
- - block:
- - debug:
- msg: "Running openshift_node_pre_uncordon_hook {{ openshift_node_pre_uncordon_hook }}"
- - include_tasks: "{{ openshift_node_pre_uncordon_hook }}"
- when: openshift_node_pre_uncordon_hook is defined
- - name: Uncordon node after upgrade
- command: >
- oc adm uncordon {{ ansible_nodename | lower }}
- --kubeconfig={{ openshift_node_kubeconfig_path }}
- delegate_to: localhost
- # Run the openshift_node_post_upgrade_hook if defined
- - block:
- - debug:
- msg: "Running node openshift_node_post_upgrade_hook {{ openshift_node_post_upgrade_hook }}"
- - include_tasks: "{{ openshift_node_post_upgrade_hook }}"
- when: openshift_node_post_upgrade_hook is defined
|