diff options
author | OpenShift Bot <eparis+openshiftbot@redhat.com> | 2017-05-02 10:04:37 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-05-02 10:04:37 -0500 |
commit | 0ea1e389625341bebececce9a56aebc616decd8d (patch) | |
tree | f4e6fc4cc762b31770ae22e6bfe043cf05c02f26 /roles/openshift_logging/tasks | |
parent | 58f79bd7c3db1545247e6175e9e422a19bddc855 (diff) | |
parent | 5a0d8dc1cc637f78c0d1321d86f51af2184a9e07 (diff) | |
download | openshift-0ea1e389625341bebececce9a56aebc616decd8d.tar.gz openshift-0ea1e389625341bebececce9a56aebc616decd8d.tar.bz2 openshift-0ea1e389625341bebececce9a56aebc616decd8d.tar.xz openshift-0ea1e389625341bebececce9a56aebc616decd8d.zip |
Merge pull request #4028 from ewolinetz/logging_project_ns_labels
Merged by openshift-bot
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 |