add custom exporter's version support
This commit is contained in:
parent
f86870ec3a
commit
daac4303b0
@ -3,23 +3,23 @@
|
||||
shell: curl --silent "https://api.github.com/repos/percona/mongodb_exporter/releases/latest" | jq -r .tag_name | sed "s/v//"
|
||||
args:
|
||||
warn: false
|
||||
register: prometheus_mongodb_exporter_version
|
||||
register: prometheus_mongodb_exporter_latest_version
|
||||
run_once: true
|
||||
|
||||
- name: 'prometheus | mongodb exporter | download'
|
||||
get_url:
|
||||
url: https://github.com/percona/mongodb_exporter/releases/download/v{{ prometheus_mongodb_exporter_version.stdout }}/mongodb_exporter-{{ prometheus_mongodb_exporter_version.stdout }}.linux-amd64.tar.gz
|
||||
url: https://github.com/percona/mongodb_exporter/releases/download/v{{ prometheus_mongodb_exporter_version|default(prometheus_mongodb_exporter_latest_version.stdout) }}/mongodb_exporter-{{ prometheus_mongodb_exporter_version|default(prometheus_mongodb_exporter_latest_version.stdout) }}.linux-amd64.tar.gz
|
||||
dest: /tmp
|
||||
|
||||
- name: 'prometheus | mongodb exporter | unarchive'
|
||||
unarchive:
|
||||
remote_src: yes
|
||||
src: /tmp/mongodb_exporter-{{ prometheus_mongodb_exporter_version.stdout }}.linux-amd64.tar.gz
|
||||
src: /tmp/mongodb_exporter-{{ prometheus_mongodb_exporter_version|default(prometheus_mongodb_exporter_latest_version.stdout) }}.linux-amd64.tar.gz
|
||||
dest: /tmp
|
||||
|
||||
- name: 'prometheus | mongodb exporter | move to /usr/local/bin'
|
||||
- name: 'prometheus | mongodb exporter < v0.2 | move to /usr/local/bin'
|
||||
copy:
|
||||
src: /tmp/mongodb_exporter-{{ prometheus_mongodb_exporter_version.stdout }}.linux-amd64/mongodb_exporter
|
||||
src: /tmp/mongodb_exporter
|
||||
dest: /usr/local/bin/prometheus-mongodb-exporter
|
||||
remote_src: yes
|
||||
owner: root
|
||||
@ -27,6 +27,21 @@
|
||||
mode: 0755
|
||||
notify:
|
||||
- 'prometheus | mongodb exporter | restart service'
|
||||
when:
|
||||
- prometheus_mongodb_exporter_version < '0.2'
|
||||
|
||||
- name: 'prometheus | mongodb exporter > v0.2 | move to /usr/local/bin'
|
||||
copy:
|
||||
src: /tmp/mongodb_exporter-{{ prometheus_mongodb_exporter_version|default(prometheus_mongodb_exporter_latest_version.stdout) }}.linux-amd64/mongodb_exporter
|
||||
dest: /usr/local/bin/prometheus-mongodb-exporter
|
||||
remote_src: yes
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0755
|
||||
notify:
|
||||
- 'prometheus | mongodb exporter | restart service'
|
||||
when:
|
||||
- prometheus_mongodb_exporter_version > '0.2'
|
||||
|
||||
- name: 'prometheus | mongodb exporter | install unit file to systemd'
|
||||
template:
|
||||
|
@ -3,23 +3,23 @@
|
||||
shell: curl --silent "https://api.github.com/repos/prometheus/mysqld_exporter/releases/latest" | jq -r .tag_name | sed "s/v//"
|
||||
args:
|
||||
warn: false
|
||||
register: prometheus_mysqld_exporter_version
|
||||
register: prometheus_mysqld_exporter_latest_version
|
||||
run_once: true
|
||||
|
||||
- name: 'prometheus | mysqld exporter | download'
|
||||
get_url:
|
||||
url: https://github.com/prometheus/mysqld_exporter/releases/download/v{{ prometheus_mysqld_exporter_version.stdout }}/mysqld_exporter-{{ prometheus_mysqld_exporter_version.stdout }}.linux-amd64.tar.gz
|
||||
url: https://github.com/prometheus/mysqld_exporter/releases/download/v{{ prometheus_mysqld_exporter_version|default(prometheus_mysqld_exporter_latest_version.stdout) }}/mysqld_exporter-{{ prometheus_mysqld_exporter_version.|default(prometheus_mysqld_exporter_latest_version.stdout) }}.linux-amd64.tar.gz
|
||||
dest: /tmp
|
||||
|
||||
- name: 'prometheus | mysqld exporter | unarchive'
|
||||
unarchive:
|
||||
remote_src: yes
|
||||
src: /tmp/mysqld_exporter-{{ prometheus_mysqld_exporter_version.stdout }}.linux-amd64.tar.gz
|
||||
src: /tmp/mysqld_exporter-{{ prometheus_mysqld_exporter_version|default(prometheus_mysqld_exporter_latest_version.stdout) }}.linux-amd64.tar.gz
|
||||
dest: /tmp
|
||||
|
||||
- name: 'prometheus | mysqld exporter | move to /usr/local/bin'
|
||||
copy:
|
||||
src: /tmp/mysqld_exporter-{{ prometheus_mysqld_exporter_version.stdout }}.linux-amd64/mysqld_exporter
|
||||
src: /tmp/mysqld_exporter-{{ prometheus_mysqld_exporter_version|default(prometheus_mysqld_exporter_latest_version.stdout) }}.linux-amd64/mysqld_exporter
|
||||
dest: /usr/local/bin/prometheus-mysqld-exporter
|
||||
remote_src: yes
|
||||
owner: root
|
||||
|
@ -8,18 +8,18 @@
|
||||
|
||||
- name: 'prometheus | node exporter | download'
|
||||
get_url:
|
||||
url: https://github.com/prometheus/node_exporter/releases/download/v{{ prometheus_node_exporter_version.stdout }}/node_exporter-{{ prometheus_node_exporter_version.stdout }}.linux-amd64.tar.gz
|
||||
url: https://github.com/prometheus/node_exporter/releases/download/v{{ prometheus_node_exporter_version|default(prometheus_node_exporter_latest_version.stdout) }}/node_exporter-{{ prometheus_node_exporter_version|default(prometheus_node_exporter_latest_version.stdout) }}.linux-amd64.tar.gz
|
||||
dest: /tmp
|
||||
|
||||
- name: 'prometheus | node exporter | unarchive'
|
||||
unarchive:
|
||||
remote_src: yes
|
||||
src: /tmp/node_exporter-{{ prometheus_node_exporter_version.stdout }}.linux-amd64.tar.gz
|
||||
src: /tmp/node_exporter-{{ prometheus_node_exporter_version|default(prometheus_node_exporter_latest_version.stdout) }}.linux-amd64.tar.gz
|
||||
dest: /tmp
|
||||
|
||||
- name: 'prometheus | node exporter | move to /usr/local/bin'
|
||||
copy:
|
||||
src: /tmp/node_exporter-{{ prometheus_node_exporter_version.stdout }}.linux-amd64/node_exporter
|
||||
src: /tmp/node_exporter-{{ prometheus_node_exporter_version|default(prometheus_node_exporter_latest_version.stdout) }}.linux-amd64/node_exporter
|
||||
dest: /usr/local/bin/prometheus-node-exporter
|
||||
remote_src: yes
|
||||
owner: root
|
||||
|
@ -8,18 +8,18 @@
|
||||
|
||||
- name: 'prometheus | postgres exporter | download'
|
||||
get_url:
|
||||
url: https://github.com/prometheus-community/postgres_exporter/releases/download/v{{ prometheus_postgres_exporter_version.stdout }}/postgres_exporter-{{ prometheus_postgres_exporter_version.stdout }}.linux-amd64.tar.gz
|
||||
url: https://github.com/prometheus-community/postgres_exporter/releases/download/v{{ prometheus_postgres_exporter_version|default(prometheus_postgres_exporter_latest_version.stdout) }}/postgres_exporter-{{ prometheus_postgres_exporter_version|default(prometheus_postgres_exporter_latest_version.stdout) }}.linux-amd64.tar.gz
|
||||
dest: /tmp
|
||||
|
||||
- name: 'prometheus | postgres exporter | unarchive'
|
||||
unarchive:
|
||||
remote_src: yes
|
||||
src: /tmp/postgres_exporter-{{ prometheus_postgres_exporter_version.stdout }}.linux-amd64.tar.gz
|
||||
src: /tmp/postgres_exporter-{{ prometheus_postgres_exporter_version|default(prometheus_postgres_exporter_latest_version.stdout) }}.linux-amd64.tar.gz
|
||||
dest: /tmp
|
||||
|
||||
- name: 'prometheus | postgres exporter | move to /usr/local/bin'
|
||||
copy:
|
||||
src: /tmp/postgres_exporter-{{ prometheus_postgres_exporter_version.stdout }}.linux-amd64/postgres_exporter
|
||||
src: /tmp/postgres_exporter-{{ prometheus_postgres_exporter_version|default(prometheus_postgres_exporter_latest_version.stdout) }}.linux-amd64/postgres_exporter
|
||||
dest: /usr/local/bin/prometheus-postgres-exporter
|
||||
remote_src: yes
|
||||
owner: root
|
||||
|
Loading…
x
Reference in New Issue
Block a user