Fixup version bumper job

Move role repo discovery to a script to avoid shell escaping issues.
* Fix up argument_specs.yml.

Signed-off-by: prombot <prometheus-team@googlegroups.com>
This commit is contained in:
prombot 2023-03-12 16:48:29 +01:00
parent 3b222a4c25
commit 7522f150ae
No known key found for this signature in database
GPG key ID: C646B23C9E3245F1
21 changed files with 40 additions and 35 deletions

6
.github/scripts/discover_role_repos.sh vendored Executable file
View file

@ -0,0 +1,6 @@
#!/usr/bin/env bash
for defaults_file in roles/*/vars/main.yml ; do
role="$(echo "${defaults_file}" | cut -f2 -d'/')"
yq eval "[{\"repo\": ._${role}_repo, \"role\": \"${role}\"}]" "${defaults_file}"
done | yq -o json -I=0

View file

@ -1,5 +1,5 @@
--- ---
name: Sync repo files name: Check for new upstream releases
on: on:
schedule: schedule:
- cron: '21 14 * * *' - cron: '21 14 * * *'
@ -20,13 +20,9 @@ jobs:
id: discovered-role-repos id: discovered-role-repos
uses: mikefarah/yq@master uses: mikefarah/yq@master
with: with:
cmd: | cmd: ./.github/scripts/discover_role_repos.sh
for defaults_file in roles/*/defaults/main.yml ; do
role="$(echo "${defaults_file}" | cut -f2 -d'/')"
yq eval "[{\"repo\": .${role}_repo, \"role\": \"${role}\"}]" "${defaults_file}"
done | yq -o json -I=0
repo_sync: check_for_new_versions:
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: discover-role-repos needs: discover-role-repos
permissions: permissions:
@ -43,4 +39,4 @@ jobs:
with: with:
fetch-depth: 0 fetch-depth: 0
- run: ./version_bumper.sh ${{ matrix.repo }} ${{ matrix.role }} - run: ./.github/scripts/version_bumper.sh ${{ matrix.repo }} ${{ matrix.role }}

View file

@ -1,10 +1,9 @@
--- ---
alertmanager_version: 0.21.0 alertmanager_version: 0.21.0
alertmanager_binary_local_dir: '' alertmanager_binary_local_dir: ''
alertmanager_repo: "prometheus/alertmanager" alertmanager_binary_url: "https://github.com/{{ _alertmanager_repo }}/releases/download/v{{ alertmanager_version }}/\
alertmanager_binary_url: "https://github.com/{{ alertmanager_repo }}/releases/download/v{{ alertmanager_version }}/\
alertmanager-{{ alertmanager_version }}.linux-{{ go_arch }}.tar.gz" alertmanager-{{ alertmanager_version }}.linux-{{ go_arch }}.tar.gz"
alertmanager_checksums_url: "https://github.com/{{ alertmanager_repo }}/releases/download/v{{ alertmanager_version }}/sha256sums.txt" alertmanager_checksums_url: "https://github.com/{{ _alertmanager_repo }}/releases/download/v{{ alertmanager_version }}/sha256sums.txt"
alertmanager_config_dir: /etc/alertmanager alertmanager_config_dir: /etc/alertmanager
alertmanager_db_dir: /var/lib/alertmanager alertmanager_db_dir: /var/lib/alertmanager

View file

@ -18,10 +18,10 @@ argument_specs:
- "This overrides I(alertmanager_version) parameter" - "This overrides I(alertmanager_version) parameter"
alertmanager_binary_url: alertmanager_binary_url:
description: "URL of the alertmanager binaries .tar.gz file" description: "URL of the alertmanager binaries .tar.gz file"
default: "https://github.com/prometheus/alertmanager/releases/download/v{{ alertmanager_version }}/alertmanager-{{ alertmanager_version }}.linux-{{ go_arch }}.tar.gz" default: "https://github.com/{{ _alertmanager_repo }}/releases/download/v{{ alertmanager_version }}/alertmanager-{{ alertmanager_version }}.linux-{{ go_arch }}.tar.gz"
alertmanager_checksums_url: alertmanager_checksums_url:
description: "URL of the alertmanager checksums file" description: "URL of the alertmanager checksums file"
default: "https://github.com/prometheus/alertmanager/releases/download/v{{ alertmanager_version }}/sha256sums.txt" default: "https://github.com/{{ _alertmanager_repo }}/releases/download/v{{ alertmanager_version }}/sha256sums.txt"
alertmanager_web_listen_address: alertmanager_web_listen_address:
description: "Address on which alertmanager will be listening" description: "Address on which alertmanager will be listening"
default: "0.0.0.0:9093" default: "0.0.0.0:9093"

View file

@ -11,3 +11,4 @@ _alertmanager_binary_install_dir: '/usr/local/bin'
# The expected location of the amtool configuration file # The expected location of the amtool configuration file
_alertmanager_amtool_config_dir: '/etc/amtool' _alertmanager_amtool_config_dir: '/etc/amtool'
_alertmanager_repo: "prometheus/alertmanager"

View file

@ -1,7 +1,6 @@
--- ---
blackbox_exporter_version: 0.18.0 blackbox_exporter_version: 0.18.0
blackbox_exporter_repo: "prometheus/blackbox_exporter" blackbox_exporter_binary_url: "https://github.com/{{ _blackbox_exporter_repo }}/releases/download/v{{ blackbox_exporter_version }}/\
blackbox_exporter_binary_url: "https://github.com/{{ blackbox_exporter_repo }}/releases/download/v{{ blackbox_exporter_version }}/\
blackbox_exporter-{{ blackbox_exporter_version }}.linux-{{ go_arch_map[ansible_architecture] | blackbox_exporter-{{ blackbox_exporter_version }}.linux-{{ go_arch_map[ansible_architecture] |
default(ansible_architecture) }}.tar.gz" default(ansible_architecture) }}.tar.gz"

View file

@ -11,6 +11,9 @@ argument_specs:
blackbox_exporter_version: blackbox_exporter_version:
description: "Blackbox exporter package version" description: "Blackbox exporter package version"
default: "0.18.0" default: "0.18.0"
blackbox_exporter_binary_url:
description: "URL of the blackbox_exporter binaries .tar.gz file"
default: "https://github.com/{{ _blackbox_exporter_repo }}/releases/download/v{{ blackbox_exporter_version }}/blackbox_exporter-{{ blackbox_exporter_version }}.linux-{{ go_arch_map[ansible_architecture] | default(ansible_architecture) }}.tar.gz"
blackbox_exporter_web_listen_address: blackbox_exporter_web_listen_address:
description: "Address on which blackbox exporter will be listening" description: "Address on which blackbox exporter will be listening"
default: "0.0.0.0:9115" default: "0.0.0.0:9115"

View file

@ -5,3 +5,4 @@ go_arch_map:
aarch64: 'arm64' aarch64: 'arm64'
armv7l: 'armv7' armv7l: 'armv7'
armv6l: 'armv6' armv6l: 'armv6'
_blackbox_exporter_repo: "prometheus/blackbox_exporter"

View file

@ -1,10 +1,9 @@
--- ---
node_exporter_version: 1.1.2 node_exporter_version: 1.1.2
node_exporter_binary_local_dir: "" node_exporter_binary_local_dir: ""
node_exporter_repo: "prometheus/node_exporter" node_exporter_binary_url: "https://github.com/{{ _node_exporter_repo }}/releases/download/v{{ node_exporter_version }}/\
node_exporter_binary_url: "https://github.com/{{ node_exporter_repo }}/releases/download/v{{ node_exporter_version }}/\
node_exporter-{{ node_exporter_version }}.linux-{{ go_arch }}.tar.gz" node_exporter-{{ node_exporter_version }}.linux-{{ go_arch }}.tar.gz"
node_exporter_checksums_url: "https://github.com/{{ node_exporter_repo }}/releases/download/v{{ node_exporter_version }}/sha256sums.txt" node_exporter_checksums_url: "https://github.com/{{ _node_exporter_repo }}/releases/download/v{{ node_exporter_version }}/sha256sums.txt"
node_exporter_web_listen_address: "0.0.0.0:9100" node_exporter_web_listen_address: "0.0.0.0:9100"
node_exporter_web_telemetry_path: "/metrics" node_exporter_web_telemetry_path: "/metrics"

View file

@ -18,10 +18,10 @@ argument_specs:
- "This overrides the I(node_exporter_version) parameter" - "This overrides the I(node_exporter_version) parameter"
node_exporter_binary_url: node_exporter_binary_url:
description: "URL of the node exporter binaries .tar.gz file" description: "URL of the node exporter binaries .tar.gz file"
default: "https://github.com/prometheus/node_exporter/releases/download/v{{ node_exporter_version }}/node_exporter-{{ node_exporter_version }}.linux-{{ go_arch }}.tar.gz" default: "https://github.com/{{ _node_exporter_repo }}/releases/download/v{{ node_exporter_version }}/node_exporter-{{ node_exporter_version }}.linux-{{ go_arch }}.tar.gz"
node_exporter_checksums_url: node_exporter_checksums_url:
description: "URL of the node exporter checksums file" description: "URL of the node exporter checksums file"
default: "https://github.com/prometheus/node_exporter/releases/download/v{{ node_exporter_version }}/sha256sums.txt" default: "https://github.com/{{ _node_exporter_repo }}/releases/download/v{{ node_exporter_version }}/sha256sums.txt"
node_exporter_web_listen_address: node_exporter_web_listen_address:
description: "Address on which node exporter will listen" description: "Address on which node exporter will listen"
default: "0.0.0.0:9100" default: "0.0.0.0:9100"

View file

@ -7,3 +7,4 @@ go_arch_map:
armv6l: 'armv6' armv6l: 'armv6'
go_arch: "{{ go_arch_map[ansible_architecture] | default(ansible_architecture) }}" go_arch: "{{ go_arch_map[ansible_architecture] | default(ansible_architecture) }}"
_node_exporter_repo: "prometheus/node_exporter"

View file

@ -1,10 +1,9 @@
--- ---
prometheus_version: 2.27.0 prometheus_version: 2.27.0
prometheus_binary_local_dir: '' prometheus_binary_local_dir: ''
prometheus_repo: "prometheus/prometheus" prometheus_binary_url: "https://github.com/{{ _prometheus_repo }}/releases/download/v{{ prometheus_version }}/\
prometheus_binary_url: "https://github.com/{{ prometheus_repo }}/releases/download/v{{ prometheus_version }}/\
prometheus-{{ prometheus_version }}.linux-{{ go_arch }}.tar.gz" prometheus-{{ prometheus_version }}.linux-{{ go_arch }}.tar.gz"
prometheus_checksums_url: "https://github.com/{{ prometheus_repo }}/releases/download/v{{ prometheus_version }}/sha256sums.txt" prometheus_checksums_url: "https://github.com/{{ _prometheus_repo }}/releases/download/v{{ prometheus_version }}/sha256sums.txt"
prometheus_skip_install: false prometheus_skip_install: false
prometheus_config_dir: /etc/prometheus prometheus_config_dir: /etc/prometheus

View file

@ -24,10 +24,10 @@ argument_specs:
- "This overrides I(prometheus_version) parameter" - "This overrides I(prometheus_version) parameter"
prometheus_binary_url: prometheus_binary_url:
description: "URL of the prometheus binaries .tar.gz file" description: "URL of the prometheus binaries .tar.gz file"
default: "https://github.com/prometheus/prometheus/releases/download/v{{ prometheus_version }}/ prometheus-{{ prometheus_version }}.linux-{{ go_arch }}.tar.gz" default: "https://github.com/{{ _prometheus_repo }}/releases/download/v{{ prometheus_version }}/ prometheus-{{ prometheus_version }}.linux-{{ go_arch }}.tar.gz"
prometheus_checksums_url: prometheus_checksums_url:
description: URL of the prometheus checksums file description: URL of the prometheus checksums file
default: "https://github.com/prometheus/prometheus/releases/download/v{{ prometheus_version }}/sha256sums.txt" default: "https://github.com/{{ _prometheus_repo }}/releases/download/v{{ prometheus_version }}/sha256sums.txt"
prometheus_config_dir: prometheus_config_dir:
description: "Path to directory with prometheus configuration" description: "Path to directory with prometheus configuration"
default: "/etc/prometheus" default: "/etc/prometheus"

View file

@ -12,3 +12,4 @@ _prometheus_binary_install_dir: '/usr/local/bin'
_prometheus_selinux_packages: "{{ ['libselinux-python', 'policycoreutils-python'] _prometheus_selinux_packages: "{{ ['libselinux-python', 'policycoreutils-python']
if ansible_python_version is version('3', '<') else if ansible_python_version is version('3', '<') else
['python3-libselinux', 'python3-policycoreutils'] }}" ['python3-libselinux', 'python3-policycoreutils'] }}"
_prometheus_repo: "prometheus/prometheus"

View file

@ -1,9 +1,8 @@
--- ---
snmp_exporter_version: 0.19.0 snmp_exporter_version: 0.19.0
snmp_exporter_repo: "prometheus/snmp_exporter" snmp_exporter_binary_url: "https://github.com/{{ _snmp_exporter_repo }}/releases/download/v{{ snmp_exporter_version }}/\
snmp_exporter_binary_url: "https://github.com/{{ snmp_exporter_repo }}/releases/download/v{{ snmp_exporter_version }}/\
snmp_exporter-{{ snmp_exporter_version }}.linux-{{ go_arch_map[ansible_architecture] | default(ansible_architecture) }}.tar.gz" snmp_exporter-{{ snmp_exporter_version }}.linux-{{ go_arch_map[ansible_architecture] | default(ansible_architecture) }}.tar.gz"
snmp_exporter_checksums_url: "https://github.com/{{ snmp_exporter_repo }}/releases/download/v{{ snmp_exporter_version }}/sha256sums.txt" snmp_exporter_checksums_url: "https://github.com/{{ _snmp_exporter_repo }}/releases/download/v{{ snmp_exporter_version }}/sha256sums.txt"
snmp_exporter_web_listen_address: "0.0.0.0:9116" snmp_exporter_web_listen_address: "0.0.0.0:9116"
snmp_exporter_log_level: info snmp_exporter_log_level: info

View file

@ -13,10 +13,10 @@ argument_specs:
default: "0.19.0" default: "0.19.0"
snmp_exporter_binary_url: snmp_exporter_binary_url:
description: "URL of the snmp exporter binaries .tar.gz file" description: "URL of the snmp exporter binaries .tar.gz file"
default: "https://github.com/prometheus/snmp_exporter/releases/download/v{{ snmp_exporter_version }}/snmp_exporter-{{ snmp_exporter_version }}.linux-{{ go_arch_map[ansible_architecture] | default(ansible_architecture) }}.tar.gz" default: "https://github.com/{{ _snmp_exporter_repo }}/releases/download/v{{ snmp_exporter_version }}/snmp_exporter-{{ snmp_exporter_version }}.linux-{{ go_arch_map[ansible_architecture] | default(ansible_architecture) }}.tar.gz"
snmp_exporter_checksums_url: snmp_exporter_checksums_url:
description: "URL of the snmp exporter checksums file" description: "URL of the snmp exporter checksums file"
default: "https://github.com/prometheus/snmp_exporter/releases/download/v{{ snmp_exporter_version }}/sha256sums.txt" default: "https://github.com/{{ _snmp_exporter_repo }}/releases/download/v{{ snmp_exporter_version }}/sha256sums.txt"
snmp_exporter_web_listen_address: snmp_exporter_web_listen_address:
description: "Address on which SNMP exporter will be listening" description: "Address on which SNMP exporter will be listening"
default: "0.0.0.0:9116" default: "0.0.0.0:9116"

View file

@ -5,3 +5,4 @@ go_arch_map:
aarch64: 'arm64' aarch64: 'arm64'
armv7l: 'armv7' armv7l: 'armv7'
armv6l: 'armv6' armv6l: 'armv6'
_snmp_exporter_repo: "prometheus/snmp_exporter"

View file

@ -1,10 +1,9 @@
--- ---
systemd_exporter_version: 0.4.0 systemd_exporter_version: 0.4.0
systemd_exporter_binary_local_dir: "" systemd_exporter_binary_local_dir: ""
systemd_exporter_repo: "prometheus-community/systemd_exporter" systemd_exporter_binary_url: "https://github.com/{{ _systemd_exporter_repo }}/releases/download/v{{ systemd_exporter_version }}/\
systemd_exporter_binary_url: "https://github.com/{{ systemd_exporter_repo }}/releases/download/v{{ systemd_exporter_version }}/\
systemd_exporter-{{ systemd_exporter_version }}.linux-{{ go_arch }}.tar.gz" systemd_exporter-{{ systemd_exporter_version }}.linux-{{ go_arch }}.tar.gz"
systemd_exporter_checksums_url: "https://github.com/{{ systemd_exporter_repo }}/releases/download/v{{ systemd_exporter_version }}/sha256sums.txt" systemd_exporter_checksums_url: "https://github.com/{{ _systemd_exporter_repo }}/releases/download/v{{ systemd_exporter_version }}/sha256sums.txt"
systemd_exporter_web_listen_address: "0.0.0.0:9558" systemd_exporter_web_listen_address: "0.0.0.0:9558"
systemd_exporter_enable_restart_count: false systemd_exporter_enable_restart_count: false

View file

@ -18,10 +18,10 @@ argument_specs:
- "This overrides I(systemd_exporter_version) parameter" - "This overrides I(systemd_exporter_version) parameter"
systemd_exporter_binary_url: systemd_exporter_binary_url:
description: URL of the systemd exporter binaries .tar.gz file" description: URL of the systemd exporter binaries .tar.gz file"
default: "https://github.com/prometheus-community/systemd_exporter/releases/download/v{{ systemd_exporter_version }}/systemd_exporter-{{ systemd_exporter_version }}.linux-{{ go_arch }}.tar.gz" default: "https://github.com/{{ _systemd_exporter_repo }}/releases/download/v{{ systemd_exporter_version }}/systemd_exporter-{{ systemd_exporter_version }}.linux-{{ go_arch }}.tar.gz"
systemd_exporter_checksums_url: systemd_exporter_checksums_url:
description: "URL of the systemd exporter checksums file" description: "URL of the systemd exporter checksums file"
default: "https://github.com/prometheus-community/systemd_exporter/releases/download/v{{ systemd_exporter_version }}/sha256sums.txt" default: "https://github.com/{{ _systemd_exporter_repo }}/releases/download/v{{ systemd_exporter_version }}/sha256sums.txt"
systemd_exporter_web_listen_address: systemd_exporter_web_listen_address:
description: Address on which systemd exporter will listen" description: Address on which systemd exporter will listen"
default: "0.0.0.0:9558" default: "0.0.0.0:9558"

View file

@ -7,3 +7,4 @@ go_arch_map:
armv6l: 'armv6' armv6l: 'armv6'
go_arch: "{{ go_arch_map[ansible_architecture] | default(ansible_architecture) }}" go_arch: "{{ go_arch_map[ansible_architecture] | default(ansible_architecture) }}"
_systemd_exporter_repo: "prometheus-community/systemd_exporter"