|
@@ -15,17 +15,66 @@
|
|
|
- openshift-operators
|
|
|
- openshift-logging
|
|
|
|
|
|
-- name: Create a LokiStack resource if not yet there
|
|
|
+- name: Create an ObjectBucketClaim if not yet there
|
|
|
+ k8s:
|
|
|
+ kubeconfig: tmp/kubeconfig-ocp4
|
|
|
+ validate_certs: no
|
|
|
+ definition: "{{ lookup('ansible.builtin.file', 'files/obj-bucket-claim.yml') }}"
|
|
|
+
|
|
|
+- name: Wait for the secret to appear
|
|
|
+ k8s_info:
|
|
|
+ kubeconfig: tmp/kubeconfig-ocp4
|
|
|
+ validate_certs: no
|
|
|
+ api_version: v1
|
|
|
+ kind: secret
|
|
|
+ namespace: openshift-logging
|
|
|
+ name: loki-bucket-odf
|
|
|
+ register: loki_secret
|
|
|
+ until:
|
|
|
+ - (loki_secret.resources | length) == 1
|
|
|
+ retries: 6
|
|
|
+ delay: 5
|
|
|
+
|
|
|
+- name: Wait for the configmap to appear
|
|
|
+ k8s_info:
|
|
|
+ kubeconfig: tmp/kubeconfig-ocp4
|
|
|
+ validate_certs: no
|
|
|
+ api_version: v1
|
|
|
+ kind: configmap
|
|
|
+ namespace: openshift-logging
|
|
|
+ name: loki-bucket-odf
|
|
|
+ register: loki_cmap
|
|
|
+ until:
|
|
|
+ - (loki_cmap.resources | length) == 1
|
|
|
+ retries: 6
|
|
|
+ delay: 5
|
|
|
+
|
|
|
+- name: Ensure the loki secret contains the relevant data
|
|
|
k8s:
|
|
|
kubeconfig: tmp/kubeconfig-ocp4
|
|
|
validate_certs: no
|
|
|
- api_version: loki.grafana.com/v1
|
|
|
- kind: lokistack
|
|
|
- name: logging-loki
|
|
|
+ api_version: v1
|
|
|
+ kind: secret
|
|
|
+ name: logging-loki-storage
|
|
|
namespace: openshift-logging
|
|
|
+ definition:
|
|
|
+ stringData:
|
|
|
+ access_key_id: "{{ loki_secret.resources[0].data.AWS_ACCESS_KEY_ID | b64decode }}"
|
|
|
+ access_key_secret: "{{ loki_secret.resources[0].data.AWS_SECRET_ACCESS_KEY | b64decode }}"
|
|
|
+ bucketnames: "{{ loki_cmap.resources[0].data.BUCKET_NAME }}"
|
|
|
+ endpoint: "https://{{ loki_cmap.resources[0].data.BUCKET_HOST }}:{{ loki_cmap.resources[0].data.BUCKET_PORT }}"
|
|
|
+
|
|
|
+- name: Create a LokiStack resource if not yet there
|
|
|
+ k8s:
|
|
|
+ kubeconfig: tmp/kubeconfig-ocp4
|
|
|
+ validate_certs: no
|
|
|
definition: "{{ lookup('ansible.builtin.file', 'files/loki-stack.yml') }}"
|
|
|
|
|
|
-# Create a ClusterLogging instance if not yet there.
|
|
|
+#- name: Create a ClusterLogging instance if not yet there.
|
|
|
+# k8s:
|
|
|
+# kubeconfig: tmp/kubeconfig-ocp4
|
|
|
+# validate_certs: no
|
|
|
+# definition: "{{ lookup('ansible.builtin.file', 'files/cluster-logging.yml') }}"
|
|
|
|
|
|
# Verification???
|
|
|
|