forked from cloudalchemy/ansible-prometheus
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprepare.yml
37 lines (35 loc) · 1.15 KB
/
prepare.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
---
- 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: 2.14.0
tasks:
- name: download prometheus binary to local folder
become: false
get_url:
url: "https://github.com/prometheus/prometheus/releases/download/v{{ version }}/prometheus-{{ version }}.linux-amd64.tar.gz"
dest: "/tmp/prometheus-{{ version }}.linux-amd64.tar.gz"
register: _download_archive
until: _download_archive is succeeded
retries: 5
delay: 2
run_once: true
check_mode: false
- name: unpack prometheus binaries
become: false
unarchive:
src: "/tmp/prometheus-{{ version }}.linux-amd64.tar.gz"
dest: "/tmp"
creates: "/tmp/prometheus-{{ version }}.linux-amd64/prometheus"
run_once: true
check_mode: false
- name: link to prometheus binaries directory
become: false
file:
src: "/tmp/prometheus-{{ version }}.linux-amd64"
dest: "/tmp/prometheus-linux-amd64"
state: link
run_once: true
check_mode: false