diff options
author | ewolinetz <ewolinet@redhat.com> | 2017-04-27 13:52:39 -0500 |
---|---|---|
committer | ewolinetz <ewolinet@redhat.com> | 2017-04-27 13:52:39 -0500 |
commit | 5a0d8dc1cc637f78c0d1321d86f51af2184a9e07 (patch) | |
tree | 6268d4a2c48ee4dd05708e102b922e6cc6852bec /roles/openshift_logging/tasks | |
parent | 38e832422a92124bd17a97f4cf65f4bec55cb516 (diff) | |
download | openshift-5a0d8dc1cc637f78c0d1321d86f51af2184a9e07.tar.gz openshift-5a0d8dc1cc637f78c0d1321d86f51af2184a9e07.tar.bz2 openshift-5a0d8dc1cc637f78c0d1321d86f51af2184a9e07.tar.xz openshift-5a0d8dc1cc637f78c0d1321d86f51af2184a9e07.zip |
Adding way to add labels and nodeselectors to logging project
Diffstat (limited to 'roles/openshift_logging/tasks')
-rw-r--r-- | roles/openshift_logging/tasks/install_support.yaml | 41 |
1 files changed, 30 insertions, 11 deletions
diff --git a/roles/openshift_logging/tasks/install_support.yaml b/roles/openshift_logging/tasks/install_support.yaml index da0bbb627..877ce3149 100644 --- a/roles/openshift_logging/tasks/install_support.yaml +++ b/roles/openshift_logging/tasks/install_support.yaml @@ -1,17 +1,36 @@ --- # This is the base configuration for installing the other components -- name: Check for logging project already exists - command: > - {{ openshift.common.client_binary }} --config={{ mktemp.stdout }}/admin.kubeconfig get project {{openshift_logging_namespace}} --no-headers - register: logging_project_result - ignore_errors: yes - when: not ansible_check_mode - changed_when: no +- name: Set logging project + oc_project: + state: present + name: "{{ openshift_logging_namespace }}" + node_selector: "{{ openshift_logging_nodeselector | default(null) }}" + +- name: Labelling logging project + oc_label: + state: present + kind: namespace + name: "{{ openshift_logging_namespace }}" + labels: + - key: "{{ item.key }}" + value: "{{ item.value }}" + with_dict: "{{ openshift_logging_labels | default({}) }}" + when: + - openshift_logging_labels is defined + - openshift_logging_labels is dict -- name: "Create logging project" - command: > - {{ openshift.common.admin_binary }} --config={{ mktemp.stdout }}/admin.kubeconfig new-project {{openshift_logging_namespace}} - when: not ansible_check_mode and "not found" in logging_project_result.stderr +- name: Labelling logging project + oc_label: + state: present + kind: namespace + name: "{{ openshift_logging_namespace }}" + labels: + - key: "{{ openshift_logging_label_key }}" + value: "{{ openshift_logging_label_value }}" + when: + - openshift_logging_label_key is defined + - openshift_logging_label_key != "" + - openshift_logging_label_value is defined - name: Create logging cert directory file: path={{openshift.common.config_base}}/logging state=directory mode=0755 |