summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--playbooks/byo/openshift-cluster/upgrades/docker/docker_upgrade.yml2
-rw-r--r--playbooks/common/openshift-cluster/redeploy-certificates.yml5
-rw-r--r--playbooks/common/openshift-cluster/upgrades/upgrade_nodes.yml2
-rwxr-xr-xroles/openshift_facts/library/openshift_facts.py15
-rw-r--r--roles/openshift_logging/tasks/label_node.yaml2
-rw-r--r--roles/openshift_logging/tasks/start_cluster.yaml7
-rw-r--r--roles/openshift_logging/tasks/stop_cluster.yaml7
7 files changed, 15 insertions, 25 deletions
diff --git a/playbooks/byo/openshift-cluster/upgrades/docker/docker_upgrade.yml b/playbooks/byo/openshift-cluster/upgrades/docker/docker_upgrade.yml
index dc0bf73a2..13e1da961 100644
--- a/playbooks/byo/openshift-cluster/upgrades/docker/docker_upgrade.yml
+++ b/playbooks/byo/openshift-cluster/upgrades/docker/docker_upgrade.yml
@@ -31,7 +31,7 @@
- name: Drain Node for Kubelet upgrade
command: >
- {{ openshift.common.client_binary }} adm manage-node {{ openshift.node.nodename }} {{ openshift.common.evacuate_or_drain }} --force
+ {{ openshift.common.admin_binary }} drain {{ openshift.node.nodename }} --force --delete-local-data
delegate_to: "{{ groups.oo_first_master.0 }}"
when: l_docker_upgrade is defined and l_docker_upgrade | bool and inventory_hostname in groups.oo_nodes_to_upgrade
diff --git a/playbooks/common/openshift-cluster/redeploy-certificates.yml b/playbooks/common/openshift-cluster/redeploy-certificates.yml
index 2383836d4..a0e3f1d8a 100644
--- a/playbooks/common/openshift-cluster/redeploy-certificates.yml
+++ b/playbooks/common/openshift-cluster/redeploy-certificates.yml
@@ -228,9 +228,8 @@
- name: Drain node
command: >
- {{ openshift.common.client_binary }} adm --config={{ hostvars[groups.oo_first_master.0].mktemp.stdout }}/admin.kubeconfig
- manage-node {{ openshift.node.nodename }}
- {{ openshift.common.evacuate_or_drain }} --force
+ {{ openshift.common.admin_binary }} --config={{ hostvars[groups.oo_first_master.0].mktemp.stdout }}/admin.kubeconfig
+ drain {{ openshift.node.nodename }} --force --delete-local-data
delegate_to: "{{ groups.oo_first_master.0 }}"
when: openshift_certificates_redeploy_ca | default(false) | bool and was_schedulable | bool
diff --git a/playbooks/common/openshift-cluster/upgrades/upgrade_nodes.yml b/playbooks/common/openshift-cluster/upgrades/upgrade_nodes.yml
index 2bb460815..5fa74898f 100644
--- a/playbooks/common/openshift-cluster/upgrades/upgrade_nodes.yml
+++ b/playbooks/common/openshift-cluster/upgrades/upgrade_nodes.yml
@@ -41,7 +41,7 @@
- name: Drain Node for Kubelet upgrade
command: >
- {{ hostvars[groups.oo_first_master.0].openshift.common.client_binary }} adm manage-node {{ openshift.node.nodename | lower }} {{ openshift.common.evacuate_or_drain }} --force
+ {{ hostvars[groups.oo_first_master.0].openshift.common.admin_binary }} drain {{ openshift.node.nodename | lower }} --force --delete-local-data
delegate_to: "{{ groups.oo_first_master.0 }}"
when: inventory_hostname in groups.oo_nodes_to_upgrade
diff --git a/roles/openshift_facts/library/openshift_facts.py b/roles/openshift_facts/library/openshift_facts.py
index 5ca8879b3..3c8e2ab9c 100755
--- a/roles/openshift_facts/library/openshift_facts.py
+++ b/roles/openshift_facts/library/openshift_facts.py
@@ -867,20 +867,6 @@ def set_deployment_facts_if_unset(facts):
return facts
-def set_evacuate_or_drain_option(facts):
- """OCP before 1.5/3.5 used '--evacuate'. As of 1.5/3.5 OCP uses
-'--drain'. Let's make that a fact for easy reference later.
- """
- if facts['common']['version_gte_3_5_or_1_5']:
- # New-style
- facts['common']['evacuate_or_drain'] = '--drain'
- else:
- # Old-style
- facts['common']['evacuate_or_drain'] = '--evacuate'
-
- return facts
-
-
def set_version_facts_if_unset(facts):
""" Set version facts. This currently includes common.version and
common.version_gte_3_1_or_1_1.
@@ -1969,7 +1955,6 @@ class OpenShiftFacts(object):
facts = build_controller_args(facts)
facts = build_api_server_args(facts)
facts = set_version_facts_if_unset(facts)
- facts = set_evacuate_or_drain_option(facts)
facts = set_dnsmasq_facts_if_unset(facts)
facts = set_manageiq_facts_if_unset(facts)
facts = set_aggregate_facts(facts)
diff --git a/roles/openshift_logging/tasks/label_node.yaml b/roles/openshift_logging/tasks/label_node.yaml
index bd5073381..ebe8f1ca8 100644
--- a/roles/openshift_logging/tasks/label_node.yaml
+++ b/roles/openshift_logging/tasks/label_node.yaml
@@ -49,4 +49,4 @@
- unlabel is defined
- unlabel
- not ansible_check_mode
- - label_value.stdout != ""
+ - label in node_labels.stdout
diff --git a/roles/openshift_logging/tasks/start_cluster.yaml b/roles/openshift_logging/tasks/start_cluster.yaml
index a96ad3f3a..2d8af1385 100644
--- a/roles/openshift_logging/tasks/start_cluster.yaml
+++ b/roles/openshift_logging/tasks/start_cluster.yaml
@@ -1,18 +1,21 @@
---
- command: >
- {{openshift.common.client_binary}} --config={{mktemp.stdout}}/admin.kubeconfig get node -o jsonpath='{.items[*].metadata.name}'
+ {{openshift.common.client_binary}} --config={{mktemp.stdout}}/admin.kubeconfig get node -o name
register: fluentd_hosts
when: "'--all' in openshift_logging_fluentd_hosts"
check_mode: no
changed_when: no
+- set_fact: openshift_logging_fluentd_hosts={{ fluentd_hosts.stdout_lines | regex_replace('node/', '') }}
+ when: "'--all' in openshift_logging_fluentd_hosts"
+
- name: start fluentd
include: label_node.yaml
vars:
host: "{{fluentd_host}}"
label: "{{openshift_logging_fluentd_nodeselector.keys()[0]}}"
value: "{{openshift_logging_fluentd_nodeselector.values()[0]}}"
- with_items: "{{(fluentd_hosts.stdout_lines is defined) | ternary(fluentd_hosts.stdout_lines, openshift_logging_fluentd_hosts)}}"
+ with_items: "{{ openshift_logging_fluentd_hosts }}"
loop_control:
loop_var: fluentd_host
diff --git a/roles/openshift_logging/tasks/stop_cluster.yaml b/roles/openshift_logging/tasks/stop_cluster.yaml
index e44493e4d..c8e8fbd2c 100644
--- a/roles/openshift_logging/tasks/stop_cluster.yaml
+++ b/roles/openshift_logging/tasks/stop_cluster.yaml
@@ -1,17 +1,20 @@
---
- command: >
- {{openshift.common.client_binary}} --config={{mktemp.stdout}}/admin.kubeconfig get node -o jsonpath='{.items[*].metadata.name}'
+ {{openshift.common.client_binary}} --config={{mktemp.stdout}}/admin.kubeconfig get node -o name
register: fluentd_hosts
when: "'--all' in openshift_logging_fluentd_hosts"
changed_when: no
+- set_fact: openshift_logging_fluentd_hosts={{ fluentd_hosts.stdout_lines | regex_replace('node/', '') }}
+ when: "'--all' in openshift_logging_fluentd_hosts"
+
- name: stop fluentd
include: label_node.yaml
vars:
host: "{{fluentd_host}}"
label: "{{openshift_logging_fluentd_nodeselector.keys()[0]}}"
unlabel: True
- with_items: "{{(fluentd_hosts.stdout_lines is defined) | ternary(fluentd_hosts.stdout_lines, openshift_logging_fluentd_hosts)}}"
+ with_items: "{{ openshift_logging_fluentd_hosts }}"
loop_control:
loop_var: fluentd_host