Skip to content

Commit 47af052

Browse files
wtripp180901sd109
andauthored
Fix workstation monitoring permissions issues post-upgrade (#371)
* fix workstation monitoring permissions issues post-upgrade * typo * fixed incorrect modules + idempotency issues * review comments Co-authored-by: Scott Davidson <49713135+sd109@users.noreply.github.com> --------- Co-authored-by: Scott Davidson <49713135+sd109@users.noreply.github.com>
1 parent 1adf69f commit 47af052

File tree

2 files changed

+43
-0
lines changed

2 files changed

+43
-0
lines changed

ansible/roles/linux-data-volumes/files/data-volumes-configure-volume.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,3 +67,17 @@
6767
state: mounted
6868
fstype: "{{ data_volume.get('fs_type', 'ext4') }}"
6969
opts: "{{ data_volume.get('opts', omit) }}"
70+
71+
# Workaround for https://github.com/azimuth-cloud/azimuth-images/issues/370
72+
- name: Ensure permissions for mount
73+
ansible.builtin.file:
74+
path: "{{ item }}"
75+
state: directory
76+
owner: root
77+
group: root
78+
mode: "0755"
79+
loop:
80+
- "{{ data_volume.mountpoint }}"
81+
- "{{ data_volume.mountpoint }}/lost+found"
82+
# Avoid making changes Zenith data volume
83+
when: data_volume.mountpoint == "/data"

ansible/roles/linux-monitoring/files/monitoring-playbook.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,16 @@
2323
regexp: "{{ ansible_hostname }}"
2424
line: "{{ ansible_default_ipv4.address }} {{ ansible_hostname }}"
2525

26+
# Workaround for https://github.com/azimuth-cloud/azimuth-images/issues/370
27+
- name: Ensure Prometheus parent directory with correct permissions
28+
ansible.builtin.file:
29+
path: /data/prometheus
30+
state: directory
31+
owner: "{{ prometheus_podman_user }}"
32+
group: "{{ prometheus_podman_user }}"
33+
recurse: true
34+
mode: "0755"
35+
2636
- name: Ensure Prometheus data directory exists
2737
ansible.builtin.file:
2838
path: "{{ prometheus_data }}"
@@ -31,6 +41,25 @@
3141
group: "{{ prometheus_podman_user }}"
3242
mode: "0755"
3343

44+
# Workaround for https://github.com/azimuth-cloud/azimuth-images/issues/370
45+
- name: Check for existing Prometheus data files
46+
ansible.builtin.stat:
47+
path: "{{ prometheus_data }}/{{ item }}"
48+
loop:
49+
- lock
50+
- queries.active
51+
register: _prom_files
52+
53+
- name: Ensure permissions on Prometheus data files
54+
ansible.builtin.file:
55+
path: "{{ item.stat.path }}"
56+
state: file
57+
owner: "{{ prometheus_podman_user }}"
58+
group: "{{ prometheus_podman_user }}"
59+
mode: "0644"
60+
loop: "{{ _prom_files.results }}"
61+
when: item.stat.exists
62+
3463
- name: Write Prometheus configuration file
3564
ansible.builtin.copy:
3665
content: "{{ prometheus_config | to_nice_yaml() }}"

0 commit comments

Comments
 (0)