diff --git a/roles/upgrade/pre-upgrade/defaults/main.yml b/roles/upgrade/pre-upgrade/defaults/main.yml index ddff1ea55..642c4cb81 100644 --- a/roles/upgrade/pre-upgrade/defaults/main.yml +++ b/roles/upgrade/pre-upgrade/defaults/main.yml @@ -6,6 +6,7 @@ drain_nodes: true drain_retries: 3 drain_retry_delay_seconds: 10 +upgrade_node_always_cordon: false upgrade_node_uncordon_after_drain_failure: true upgrade_node_fail_if_drain_fails: true diff --git a/roles/upgrade/pre-upgrade/tasks/main.yml b/roles/upgrade/pre-upgrade/tasks/main.yml index d969175e3..64e01d901 100644 --- a/roles/upgrade/pre-upgrade/tasks/main.yml +++ b/roles/upgrade/pre-upgrade/tasks/main.yml @@ -39,7 +39,7 @@ - name: Set if node needs cordoning set_fact: needs_cordoning: >- - {% if kubectl_node_ready.stdout == "True" and not kubectl_node_schedulable.stdout -%} + {% if (kubectl_node_ready.stdout == "True" and not kubectl_node_schedulable.stdout) or upgrade_node_always_cordon -%} true {%- else -%} false