--- # Copyright Red Hat, Inc. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for specific language governing permissions and limitations # under the License. - name: Ensure manifest output directory exists ansible.builtin.file: path: "{{ cifmw_deploy_loki_manifest_dest | dirname }}" state: directory mode: "0755" - name: Render Loki / MinIO manifests for CloudKitty ansible.builtin.template: src: deploy_loki_for_ck.yaml.j2 dest: "{{ cifmw_deploy_loki_manifest_dest }}" mode: "0644" - name: Apply Loki operator and MinIO manifests when: cifmw_deploy_loki | bool environment: KUBECONFIG: >- {{ cifmw_openshift_kubeconfig | default(ansible_env.HOME + '/.kube/config') }} PATH: "{{ cifmw_path | default(ansible_env.PATH) }}" ansible.builtin.command: cmd: "oc apply -f {{ cifmw_deploy_loki_manifest_dest }}" register: cifmw_deploy_loki_apply_result changed_when: >- ('stdout' in cifmw_deploy_loki_apply_result) and ('unchanged' not in cifmw_deploy_loki_apply_result.stdout) - name: Wait until Loki operator CSV reports Succeeded when: - cifmw_deploy_loki | bool - cifmw_deploy_loki_wait_for_csv | bool environment: KUBECONFIG: >- {{ cifmw_openshift_kubeconfig | default(ansible_env.HOME + '/.kube/config') }} PATH: "{{ cifmw_path | default(ansible_env.PATH) }}" ansible.builtin.shell: cmd: >- oc get csv -n {{ cifmw_deploy_loki_operator_namespace }} --no-headers=true | grep {{ cifmw_deploy_loki_subscription_name }} register: cifmw_deploy_loki_csv_out ignore_errors: true until: >- (cifmw_deploy_loki_csv_out.stdout_lines | length == 1) and ('Succeeded' in cifmw_deploy_loki_csv_out.stdout) retries: "{{ cifmw_deploy_loki_csv_wait_retries }}" delay: "{{ cifmw_deploy_loki_csv_wait_delay }}"