Skip to content
This repository has been archived by the owner on Mar 6, 2023. It is now read-only.

Commit

Permalink
specify version for alternative alertmanager download
Browse files Browse the repository at this point in the history
  • Loading branch information
paulfantom committed Oct 19, 2019
1 parent 77e2774 commit 4322da8
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 5 deletions.
2 changes: 1 addition & 1 deletion molecule/alternative/playbook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
roles:
- ansible-alertmanager
vars:
alertmanager_binary_local_dir: '/tmp/alertmanager-0.18.0.linux-amd64'
alertmanager_binary_local_dir: '/tmp/alertmanager-linux-amd64'
alertmanager_config_dir: /opt/am/etc
alertmanager_db_dir: /opt/am/lib
alertmanager_web_listen_address: '127.0.0.1:9093'
Expand Down
20 changes: 16 additions & 4 deletions molecule/alternative/prepare.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,15 @@
- name: Prepare
hosts: localhost
gather_facts: false
vars:
# Version seeds to be specified here as molecule doesn't have access to ansible_version at this stage
version: 0.19.0
tasks:
- name: download alertmanager binary to local folder
become: false
get_url:
url: "https://github.com/prometheus/alertmanager/releases/download/v0.18.0/alertmanager-0.18.0.linux-amd64.tar.gz"
dest: "/tmp/alertmanager-0.18.0.linux-amd64.tar.gz"
url: "https://github.com/prometheus/alertmanager/releases/download/v{{ version }}/alertmanager-{{ version }}.linux-amd64.tar.gz"
dest: "/tmp/alertmanager-{{ version }}.linux-amd64.tar.gz"
register: _download_archive
until: _download_archive is succeeded
retries: 5
Expand All @@ -18,8 +21,17 @@
- name: unpack alertmanager binaries
become: false
unarchive:
src: "/tmp/alertmanager-0.18.0.linux-amd64.tar.gz"
src: "/tmp/alertmanager-{{ version }}.linux-amd64.tar.gz"
dest: "/tmp"
creates: "/tmp/alertmanager-0.18.0.linux-amd64/alertmanager"
creates: "/tmp/alertmanager-{{ version }}.linux-amd64/alertmanager"
run_once: true
check_mode: false

- name: link to alertmanager binaries directory
become: false
file:
src: "/tmp/alertmanager-{{ version }}.linux-amd64"
dest: "/tmp/alertmanager-linux-amd64"
state: link
run_once: true
check_mode: false

0 comments on commit 4322da8

Please sign in to comment.