summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--playbooks/common/openshift-cluster/upgrades/post_control_plane.yml2
-rw-r--r--roles/openshift_logging/tasks/label_node.yaml52
-rw-r--r--roles/openshift_logging/tasks/start_cluster.yaml10
-rw-r--r--roles/openshift_logging/tasks/stop_cluster.yaml10
-rw-r--r--roles/openshift_manage_node/tasks/main.yml3
5 files changed, 11 insertions, 66 deletions
diff --git a/playbooks/common/openshift-cluster/upgrades/post_control_plane.yml b/playbooks/common/openshift-cluster/upgrades/post_control_plane.yml
index b79e2f7fa..bea5c038b 100644
--- a/playbooks/common/openshift-cluster/upgrades/post_control_plane.yml
+++ b/playbooks/common/openshift-cluster/upgrades/post_control_plane.yml
@@ -56,7 +56,7 @@
- name: Update registry image to current version
when:
- - _default_registry.rc == 0
+ - _default_registry.results.results[0] != {}
- temp_skip_router_registry_upgrade is not defined
command: >
{{ oc_cmd }} patch dc/docker-registry -n default -p
diff --git a/roles/openshift_logging/tasks/label_node.yaml b/roles/openshift_logging/tasks/label_node.yaml
deleted file mode 100644
index ebe8f1ca8..000000000
--- a/roles/openshift_logging/tasks/label_node.yaml
+++ /dev/null
@@ -1,52 +0,0 @@
----
-- command: >
- {{ openshift.common.client_binary }} --config={{ mktemp.stdout }}/admin.kubeconfig get node {{host}}
- -o jsonpath='{.metadata.labels}'
- register: node_labels
- when: not ansible_check_mode
- changed_when: no
-
-- command: >
- {{ openshift.common.client_binary }} --config={{ mktemp.stdout }}/admin.kubeconfig label node {{host}} {{label}}={{value}}
- register: label_result
- failed_when: label_result.rc == 1 and 'exists' not in label_result.stderr
- when:
- - value is defined
- - node_labels.stdout is defined
- - label not in node_labels.stdout
- - unlabel is not defined or not unlabel
- - not ansible_check_mode
-
-- command: >
- {{ openshift.common.client_binary }} --config={{ mktemp.stdout }}/admin.kubeconfig get node {{host}}
- -o jsonpath='{.metadata.labels.{{ label }}}'
- register: label_value
- ignore_errors: yes
- changed_when: no
- when:
- - value is defined
- - node_labels.stdout is defined
- - label in node_labels.stdout
- - unlabel is not defined or not unlabel
- - not ansible_check_mode
-
-- command: >
- {{ openshift.common.client_binary }} --config={{ mktemp.stdout }}/admin.kubeconfig label node {{host}} {{label}}={{value}} --overwrite
- register: label_result
- failed_when: label_result.rc == 1 and 'exists' not in label_result.stderr
- when:
- - value is defined
- - label_value.stdout is defined
- - label_value.stdout != value
- - unlabel is not defined or not unlabel
- - not ansible_check_mode
-
-- command: >
- {{ openshift.common.client_binary }} --config={{ mktemp.stdout }}/admin.kubeconfig label node {{host}} {{label}}-
- register: label_result
- failed_when: label_result.rc == 1 and 'exists' not in label_result.stderr
- when:
- - unlabel is defined
- - unlabel
- - not ansible_check_mode
- - label in node_labels.stdout
diff --git a/roles/openshift_logging/tasks/start_cluster.yaml b/roles/openshift_logging/tasks/start_cluster.yaml
index 3f1bd7ad2..3e97487dc 100644
--- a/roles/openshift_logging/tasks/start_cluster.yaml
+++ b/roles/openshift_logging/tasks/start_cluster.yaml
@@ -12,11 +12,11 @@
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]}}"
+ oc_label:
+ name: "{{ fluentd_host }}"
+ kind: node
+ state: add
+ label: "{{ openshift_logging_fluentd_nodeselector | oo_dict_to_list_of_dict }}"
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 ee6c800f2..bae6aebbb 100644
--- a/roles/openshift_logging/tasks/stop_cluster.yaml
+++ b/roles/openshift_logging/tasks/stop_cluster.yaml
@@ -12,11 +12,11 @@
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
+ oc_label:
+ name: "{{ fluentd_host }}"
+ kind: node
+ state: absent
+ label: "{{ openshift_logging_fluentd_nodeselector | oo_dict_to_list_of_dict }}"
with_items: "{{ openshift_logging_fluentd_hosts }}"
loop_control:
loop_var: fluentd_host
diff --git a/roles/openshift_manage_node/tasks/main.yml b/roles/openshift_manage_node/tasks/main.yml
index 73f55df12..9a883feed 100644
--- a/roles/openshift_manage_node/tasks/main.yml
+++ b/roles/openshift_manage_node/tasks/main.yml
@@ -31,7 +31,6 @@
name: "{{ openshift.node.nodename }}"
kind: node
state: list
- kubeconfig: "{{ openshift.common.config_base }}/master/admin.kubeconfig"
register: get_node
until: "'metadata' in get_node.results.results[0]"
retries: 50
@@ -43,7 +42,6 @@
oadm_manage_node:
node: "{{ openshift.node.nodename | lower }}"
schedulable: "{{ 'true' if openshift.node.schedulable | bool else 'false' }}"
- kubeconfig: "{{ openshift.common.config_base }}/master/admin.kubeconfig"
retries: 10
delay: 5
register: node_schedulable
@@ -57,7 +55,6 @@
kind: node
state: add
labels: "{{ openshift.node.labels | oo_dict_to_list_of_dict }}"
- kubeconfig: "{{ openshift.common.config_base }}/master/admin.kubeconfig"
namespace: default
when:
- "'nodename' in openshift.node"