feat(prometheus): casting int for older ansible compat
Some checks failed
Ansible Lint Check / lint (push) Failing after 3m21s
Some checks failed
Ansible Lint Check / lint (push) Failing after 3m21s
This commit is contained in:
parent
0e00d4d70e
commit
835ef37f4a
1 changed files with 14 additions and 14 deletions
|
|
@ -29,15 +29,15 @@
|
|||
|
||||
- name: Podman Prometheus | AUDIT | Parse outputs of getsubids and store results
|
||||
ansible.builtin.set_fact:
|
||||
_podman_prometheus_user_subuid_start: "{{ (_podman_prometheus_user_subuid.stdout_lines[0].split()[2] | int) }}"
|
||||
_podman_prometheus_user_subgid_start: "{{ (_podman_prometheus_user_subgid.stdout_lines[0].split()[2] | int) }}"
|
||||
_podman_prometheus_user_subuid_start: "{{ _podman_prometheus_user_subuid.stdout_lines[0].split()[2] }}"
|
||||
_podman_prometheus_user_subgid_start: "{{ _podman_prometheus_user_subgid.stdout_lines[0].split()[2] }}"
|
||||
|
||||
# Prometheus runs with UID/GID 65534 inside the container
|
||||
- name: Podman Prometheus | PATCH | Create data directory for Prometheus
|
||||
ansible.builtin.file:
|
||||
path: "/home/{{ podman_prometheus_podman_rootless_user }}/prometheus-data"
|
||||
owner: "{{ _podman_prometheus_user_subuid_start + 65533 }}"
|
||||
group: "{{ _podman_prometheus_user_subgid_start + 65533 }}"
|
||||
owner: "{{ (_podman_prometheus_user_subuid_start | int) + 65533 }}"
|
||||
group: "{{ (_podman_prometheus_user_subgid_start | int) + 65533 }}"
|
||||
mode: "0700"
|
||||
state: "directory"
|
||||
become: true
|
||||
|
|
@ -46,8 +46,8 @@
|
|||
- name: Podman Prometheus | PATCH | Create service discovery directory for Prometheus
|
||||
ansible.builtin.file:
|
||||
path: "/home/{{ podman_prometheus_podman_rootless_user }}/file-configs"
|
||||
owner: "{{ _podman_prometheus_user_subuid_start + 65533 }}"
|
||||
group: "{{ _podman_prometheus_user_subgid_start + 65533 }}"
|
||||
owner: "{{ (_podman_prometheus_user_subuid_start | int) + 65533 }}"
|
||||
group: "{{ (_podman_prometheus_user_subgid_start | int) + 65533 }}"
|
||||
mode: "0700"
|
||||
state: "directory"
|
||||
become: true
|
||||
|
|
@ -58,8 +58,8 @@
|
|||
src: "home/podman/{{ item }}"
|
||||
dest: "/home/{{ podman_prometheus_podman_rootless_user }}/{{ item }}"
|
||||
mode: "0400"
|
||||
owner: "{{ _podman_prometheus_user_subuid_start + 65533 }}"
|
||||
group: "{{ _podman_prometheus_user_subgid_start + 65533 }}"
|
||||
owner: "{{ (_podman_prometheus_user_subuid_start | int) + 65533 }}"
|
||||
group: "{{ (_podman_prometheus_user_subgid_start | int) + 65533 }}"
|
||||
become: true
|
||||
with_items:
|
||||
- prometheus.yml
|
||||
|
|
@ -71,8 +71,8 @@
|
|||
src: "home/podman/{{ item }}"
|
||||
dest: "/home/{{ podman_prometheus_podman_rootless_user }}/{{ item }}"
|
||||
mode: "0400"
|
||||
owner: "{{ _podman_prometheus_user_subuid_start + 65533 }}"
|
||||
group: "{{ _podman_prometheus_user_subgid_start + 65533 }}"
|
||||
owner: "{{ (_podman_prometheus_user_subuid_start | int) + 65533 }}"
|
||||
group: "{{ (_podman_prometheus_user_subgid_start | int) + 65533 }}"
|
||||
become: true
|
||||
with_items:
|
||||
- alert.rules.yml
|
||||
|
|
@ -85,8 +85,8 @@
|
|||
src: home/podman/alertmanager.yml
|
||||
dest: "/home/{{ podman_prometheus_podman_rootless_user }}/alertmanager.yml"
|
||||
mode: "0400"
|
||||
owner: "{{ _podman_prometheus_user_subuid_start + 65533 }}"
|
||||
group: "{{ _podman_prometheus_user_subgid_start + 65533 }}"
|
||||
owner: "{{ (_podman_prometheus_user_subuid_start | int) + 65533 }}"
|
||||
group: "{{ (_podman_prometheus_user_subgid_start | int) + 65533 }}"
|
||||
become: true
|
||||
notify:
|
||||
- Restart Alertmanager
|
||||
|
|
@ -95,8 +95,8 @@
|
|||
- name: Podman Prometheus | PATCH | Create data directory for Grafana
|
||||
ansible.builtin.file:
|
||||
path: "/home/{{ podman_prometheus_podman_rootless_user }}/grafana-data"
|
||||
owner: "{{ _podman_prometheus_user_subuid_start + 471 }}"
|
||||
group: "{{ _podman_prometheus_user_subgid_start + 471 }}"
|
||||
owner: "{{ (_podman_prometheus_user_subuid_start | int) + 471 }}"
|
||||
group: "{{ (_podman_prometheus_user_subgid_start | int) + 471 }}"
|
||||
mode: "0700"
|
||||
state: "directory"
|
||||
become: true
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue