sync roles with changes from OWS

This commit is contained in:
Oli
2023-10-21 13:13:20 +00:00
parent e14271eab0
commit ccd75528ed
43 changed files with 479 additions and 107 deletions

View File

@@ -8,20 +8,31 @@
token: "{{ vault_github_token }}"
delegate_to: localhost
run_once: true
register: postgres_exporter_version
- name: "{{ postgres_exporter_version }}"
register: postgresql_exporter_version
- name: "{{ postgresql_exporter_version }}"
set_fact:
postgres_exporter_version: "{{ postgres_exporter_version | replace ('v', '', 1) | trim }}"
postgresql_exporter_version: "{{ postgresql_exporter_version | replace('v', '', 1) | trim }}"
run_once: true
- name: Download postgres_exporter {{ postgres_exporter_version.tag }} from GitHub
- name: Set architecture alias
set_fact:
architecture_alias: "amd64" # noqa: var-naming[no-role-prefix]
when: ansible_architecture == "x86_64"
- name: Set architecture alias
set_fact:
architecture_alias: "arm64" # noqa: var-naming[no-role-prefix]
when: ansible_architecture == "aarch64"
- name: "Download postgres_exporter from GitHub (v{{ postgresql_exporter_version.tag }})"
get_url:
url: "https://github.com/prometheus-community/postgres_exporter/releases/download/\
v{{ postgres_exporter_version.tag }}/postgres_exporter-{{ postgres_exporter_version.tag }}\
.linux-{{ deb_architecture }}.tar.gz"
v{{ postgresql_exporter_version.tag }}/postgres_exporter-{{ postgresql_exporter_version.tag }}\
.linux-{{ architecture_alias }}.tar.gz"
dest: "/var/tmp/postgres_exporter.tar.gz"
register: postgres_exporter_download_archive
until: postgres_exporter_download_archive is succeeded
mode: "0644"
register: postgresql_exporter_download_archive
until: postgresql_exporter_download_archive is succeeded
retries: 3
delay: 5
@@ -35,7 +46,7 @@
extra_opts:
--strip-components=1
include:
- "postgres_exporter-{{ postgres_exporter_version.tag }}.linux-{{ deb_architecture }}/postgres_exporter"
- "postgres_exporter-{{ postgresql_exporter_version.tag }}.linux-{{ architecture_alias }}/postgres_exporter"
notify: Restart postgres_exporter
- name: Copy the postgres_exporter systemd service file