diff --git a/ansible/roles/apps/tasks/helmfiles.yml b/ansible/roles/apps/tasks/helmfiles.yml index 54100bf1b5520e3e5c1e645960a1b94b096b6edc..2945f25d8223b7a615ea53b89441af59e6511e8b 100644 --- a/ansible/roles/apps/tasks/helmfiles.yml +++ b/ansible/roles/apps/tasks/helmfiles.yml @@ -39,6 +39,25 @@ - servicemonitor.crd.yaml - podmonitor.crd.yaml +- name: Get prometheus PV name + tags: + - prometheus + shell: "kubectl -n oas get pvc prometheus-prometheus-oas-{{ release_name }}-prometheus-promet-prometheus-0 -o=jsonpath='{.spec.volumeName}'" + register: prometheus_pv_name + failed_when: false + changed_when: false + +# Needed because previously we ran prometheus as root +- name: Ensure prometheus volume is accessible by the prometheus pod + tags: + - prometheus + file: + dest: "{{ data_directory }}/local-storage/{{ prometheus_pv_name.stdout }}" + owner: '1000' + group: '2000' + recurse: true + when: prometheus_pv_name.stdout + - name: Apply storage helmfile tags: - helmfile