diff options
author | Eric Wolinetz <ewolinet@redhat.com> | 2017-01-27 08:37:13 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-01-27 08:37:13 -0600 |
commit | d2a0850decdf9da8e8f050d7ab59afe194dae196 (patch) | |
tree | 30e7c069a7ba8451f5c9ea344a764bd1059ebfd8 /roles/openshift_logging | |
parent | 3e00b0082c1af7cc77957bbad9ea514874681fb1 (diff) | |
parent | 6a5a0643cb94079dd9518307d657df4dd4fa7c5c (diff) | |
download | openshift-d2a0850decdf9da8e8f050d7ab59afe194dae196.tar.gz openshift-d2a0850decdf9da8e8f050d7ab59afe194dae196.tar.bz2 openshift-d2a0850decdf9da8e8f050d7ab59afe194dae196.tar.xz openshift-d2a0850decdf9da8e8f050d7ab59afe194dae196.zip |
Merge pull request #3200 from ewolinetz/logging_fix_node_labelling
Fixing fluentd node labelling
Diffstat (limited to 'roles/openshift_logging')
-rw-r--r-- | roles/openshift_logging/tasks/label_node.yaml | 2 | ||||
-rw-r--r-- | roles/openshift_logging/tasks/start_cluster.yaml | 7 | ||||
-rw-r--r-- | roles/openshift_logging/tasks/stop_cluster.yaml | 7 |
3 files changed, 11 insertions, 5 deletions
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 |