From 338ab4ddb6d895e085a47b335f54451d9d406bc8 Mon Sep 17 00:00:00 2001 From: Michael Schmitt Date: Tue, 13 Jul 2021 17:48:37 -0600 Subject: [PATCH] fix: check for Amazon in osfamilymap for pkg repo * Add check for Amazon Linux to osfamilymap.yaml so that the RPM package repository is properly generated. Resolves #65 --- prometheus/osfamilymap.yaml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/prometheus/osfamilymap.yaml b/prometheus/osfamilymap.yaml index 4baeb32..021b20c 100644 --- a/prometheus/osfamilymap.yaml +++ b/prometheus/osfamilymap.yaml @@ -206,9 +206,14 @@ RedHat: args: config.file: /etc/prometheus/blackbox.yml repo: + {%- if grains.os == 'Amazon' %} + {%- set releasever = salt['cmd.run']("rpm -E '%{rhel}'") %} + {% else %} + {%- set releasever = "$releasever" %} + {%- endif %} # https://akai-tsuki.hatenablog.com/entry/2017/12/03/000000 # yamllint disable rule:line-length - baseurl: 'https://packagecloud.io/prometheus-rpm/release/el/$releasever/$basearch' + baseurl: "https://packagecloud.io/prometheus-rpm/release/el/{{ releasever }}/$basearch" gpgkey: 'https://packagecloud.io/prometheus-rpm/release/gpgkey gpgkey2=https://raw.githubusercontent.com/lest/prometheus-rpm/master/RPM-GPG-KEY-prometheus-rpm' # yamllint enable rule:line-length sslverify: 1