remove prometheus in tasks' name

This commit is contained in:
Ludovic Cartier 2022-11-11 21:08:07 +01:00
parent cef259a52c
commit 2d141b32a4
14 changed files with 83 additions and 85 deletions

View File

@ -1,12 +1,12 @@
--- ---
- name: 'prometheus | assert | check if ansible version >= 2.7' - name: 'assert | check if ansible version >= 2.7'
assert: assert:
that: ansible_version.full is version_compare(2.7, '>=') that: ansible_version.full is version_compare(2.7, '>=')
msg: Ansible version 2.7 or later is required to use this version of the role msg: Ansible version 2.7 or later is required to use this version of the role
tags: tags:
- prometheus - prometheus
- name: 'prometheus | assert | gather the package facts' - name: 'assert | gather the package facts'
ansible.builtin.package_facts: ansible.builtin.package_facts:
manager: auto manager: auto
when: when:
@ -15,7 +15,7 @@
tags: tags:
- prometheus - prometheus
- name: 'prometheus | assert | check if docker-ce is installed' - name: 'assert | check if docker-ce is installed'
assert: assert:
that: "'docker-ce' in ansible_facts.packages" that: "'docker-ce' in ansible_facts.packages"
when: when:
@ -24,7 +24,7 @@
tags: tags:
- prometheus - prometheus
- name: 'prometheus | assert | check if docker pyhon libraries are installed' - name: 'assert | check if docker pyhon libraries are installed'
assert: assert:
that: that:
#- "'python-docker' in ansible_facts.packages" #- "'python-docker' in ansible_facts.packages"
@ -34,4 +34,3 @@
- prometheus_server_enable == "true" - prometheus_server_enable == "true"
tags: tags:
- prometheus - prometheus

View File

@ -1,23 +1,23 @@
--- ---
- name: 'prometheus | apache exporter | get latest release from GitHub' - name: 'apache exporter | get latest release from GitHub'
shell: curl --silent "https://api.github.com/repos/Lusitaniae/apache_exporter/releases/latest" | jq -r .tag_name | sed "s/v//" shell: curl --silent "https://api.github.com/repos/Lusitaniae/apache_exporter/releases/latest" | jq -r .tag_name | sed "s/v//"
args: args:
warn: false warn: false
register: prometheus_apache_exporter_latest_version register: prometheus_apache_exporter_latest_version
run_once: true run_once: true
- name: 'prometheus | apache exporter | download' - name: 'apache exporter | download'
get_url: get_url:
url: https://github.com/Lusitaniae/apache_exporter/releases/download/v{{ prometheus_apache_exporter_version|default(prometheus_apache_exporter_latest_version.stdout) }}/apache_exporter-{{ prometheus_apache_exporter_version|default(prometheus_apache_exporter_latest_version.stdout) }}.linux-amd64.tar.gz url: https://github.com/Lusitaniae/apache_exporter/releases/download/v{{ prometheus_apache_exporter_version|default(prometheus_apache_exporter_latest_version.stdout) }}/apache_exporter-{{ prometheus_apache_exporter_version|default(prometheus_apache_exporter_latest_version.stdout) }}.linux-amd64.tar.gz
dest: /tmp dest: /tmp
- name: 'prometheus | apache exporter | unarchive' - name: 'apache exporter | unarchive'
unarchive: unarchive:
remote_src: yes remote_src: yes
src: /tmp/apache_exporter-{{ prometheus_apache_exporter_version|default(prometheus_apache_exporter_latest_version.stdout) }}.linux-amd64.tar.gz src: /tmp/apache_exporter-{{ prometheus_apache_exporter_version|default(prometheus_apache_exporter_latest_version.stdout) }}.linux-amd64.tar.gz
dest: /tmp dest: /tmp
- name: 'prometheus | apache exporter | move to /usr/local/bin' - name: 'apache exporter | move to /usr/local/bin'
copy: copy:
src: /tmp/apache_exporter-{{ prometheus_apache_exporter_version|default(prometheus_apache_exporter_latest_version.stdout) }}.linux-amd64/apache_exporter src: /tmp/apache_exporter-{{ prometheus_apache_exporter_version|default(prometheus_apache_exporter_latest_version.stdout) }}.linux-amd64/apache_exporter
dest: /usr/local/bin/prometheus-apache-exporter dest: /usr/local/bin/prometheus-apache-exporter
@ -28,7 +28,7 @@
notify: notify:
- 'prometheus | apache exporter | restart service' - 'prometheus | apache exporter | restart service'
- name: 'prometheus | apache exporter | install unit file to systemd' - name: 'apache exporter | install unit file to systemd'
template: template:
src: systemd/prometheus-apache-exporter.service.j2 src: systemd/prometheus-apache-exporter.service.j2
dest: /etc/systemd/system/prometheus-apache-exporter.service dest: /etc/systemd/system/prometheus-apache-exporter.service

View File

@ -1,23 +1,23 @@
--- ---
- name: 'prometheus | blackbox exporter | get latest release from GitHub' - name: 'blackbox exporter | get latest release from GitHub'
shell: curl --silent "https://api.github.com/repos/prometheus/blackbox_exporter/releases/latest" | jq -r .tag_name | sed "s/v//" shell: curl --silent "https://api.github.com/repos/prometheus/blackbox_exporter/releases/latest" | jq -r .tag_name | sed "s/v//"
args: args:
warn: false warn: false
register: prometheus_blackbox_exporter_latest_version register: prometheus_blackbox_exporter_latest_version
run_once: true run_once: true
- name: 'prometheus | blackbox exporter | download' - name: 'blackbox exporter | download'
get_url: get_url:
url: https://github.com/prometheus/blackbox_exporter/releases/download/v{{ prometheus_blackbox_exporter_version|default(prometheus_blackbox_exporter_latest_version.stdout) }}/blackbox_exporter-{{ prometheus_blackbox_exporter_version|default(prometheus_blackbox_exporter_latest_version.stdout) }}.linux-amd64.tar.gz url: https://github.com/prometheus/blackbox_exporter/releases/download/v{{ prometheus_blackbox_exporter_version|default(prometheus_blackbox_exporter_latest_version.stdout) }}/blackbox_exporter-{{ prometheus_blackbox_exporter_version|default(prometheus_blackbox_exporter_latest_version.stdout) }}.linux-amd64.tar.gz
dest: /tmp dest: /tmp
- name: 'prometheus | blackbox exporter | unarchive' - name: 'blackbox exporter | unarchive'
unarchive: unarchive:
remote_src: yes remote_src: yes
src: /tmp/blackbox_exporter-{{ prometheus_blackbox_exporter_version|default(prometheus_blackbox_exporter_latest_version.stdout) }}.linux-amd64.tar.gz src: /tmp/blackbox_exporter-{{ prometheus_blackbox_exporter_version|default(prometheus_blackbox_exporter_latest_version.stdout) }}.linux-amd64.tar.gz
dest: /tmp dest: /tmp
- name: 'prometheus | blackbox exporter | move to /usr/local/bin' - name: 'blackbox exporter | move to /usr/local/bin'
copy: copy:
src: /tmp/blackbox_exporter-{{ prometheus_blackbox_exporter_version|default(prometheus_blackbox_exporter_latest_version.stdout) }}.linux-amd64/blackbox_exporter src: /tmp/blackbox_exporter-{{ prometheus_blackbox_exporter_version|default(prometheus_blackbox_exporter_latest_version.stdout) }}.linux-amd64/blackbox_exporter
dest: /usr/local/bin/prometheus-blackbox-exporter dest: /usr/local/bin/prometheus-blackbox-exporter
@ -28,7 +28,7 @@
notify: notify:
- 'prometheus | blackbox exporter | restart service' - 'prometheus | blackbox exporter | restart service'
- name: 'prometheus | blackbox exporter | configuration' - name: 'blackbox exporter | configuration'
template: template:
src: conf/prometheus-blackbox-exporter.j2 src: conf/prometheus-blackbox-exporter.j2
dest: /etc/default/prometheus-blackbox-exporter dest: /etc/default/prometheus-blackbox-exporter
@ -39,7 +39,7 @@
notify: notify:
- 'prometheus | blackbox exporter | restart service' - 'prometheus | blackbox exporter | restart service'
- name: 'prometheus | blackbox exporter | install unit file to systemd' - name: 'blackbox exporter | install unit file to systemd'
template: template:
src: systemd/prometheus-blackbox-exporter.service.j2 src: systemd/prometheus-blackbox-exporter.service.j2
dest: /etc/systemd/system/prometheus-blackbox-exporter.service dest: /etc/systemd/system/prometheus-blackbox-exporter.service
@ -49,7 +49,7 @@
notify: notify:
- 'prometheus | blackbox exporter | restart service' - 'prometheus | blackbox exporter | restart service'
- name: 'prometheus | blackbox exporter | configure systemd to use service' - name: 'blackbox exporter | configure systemd to use service'
systemd: systemd:
daemon_reload: yes daemon_reload: yes
enabled: yes enabled: yes

View File

@ -1,5 +1,5 @@
--- ---
- name: 'prometheus | memcached exporter | get latest release from GitHub' - name: 'memcached exporter | get latest release from GitHub'
shell: curl --silent "https://api.github.com/repos/prometheus/memcached_exporter/releases/latest" | jq -r .tag_name | sed "s/v//" shell: curl --silent "https://api.github.com/repos/prometheus/memcached_exporter/releases/latest" | jq -r .tag_name | sed "s/v//"
args: args:
warn: false warn: false
@ -11,13 +11,13 @@
url: https://github.com/prometheus/memcached_exporter/releases/download/v{{ prometheus_memcached_exporter_version|default(prometheus_memcached_exporter_latest_version.stdout) }}/memcached_exporter-{{ prometheus_memcached_exporter_version|default(prometheus_memcached_exporter_latest_version.stdout) }}.linux-amd64.tar.gz url: https://github.com/prometheus/memcached_exporter/releases/download/v{{ prometheus_memcached_exporter_version|default(prometheus_memcached_exporter_latest_version.stdout) }}/memcached_exporter-{{ prometheus_memcached_exporter_version|default(prometheus_memcached_exporter_latest_version.stdout) }}.linux-amd64.tar.gz
dest: /tmp dest: /tmp
- name: 'prometheus | memcached exporter | unarchive' - name: 'memcached exporter | unarchive'
unarchive: unarchive:
remote_src: yes remote_src: yes
src: /tmp/memcached_exporter-{{ prometheus_memcached_exporter_version|default(prometheus_memcached_exporter_latest_version.stdout) }}.linux-amd64.tar.gz src: /tmp/memcached_exporter-{{ prometheus_memcached_exporter_version|default(prometheus_memcached_exporter_latest_version.stdout) }}.linux-amd64.tar.gz
dest: /tmp dest: /tmp
- name: 'prometheus | memcached exporter | move to /usr/local/bin' - name: 'memcached exporter | move to /usr/local/bin'
copy: copy:
src: /tmp/memcached_exporter-{{ prometheus_memcached_exporter_version|default(prometheus_memcached_exporter_latest_version.stdout) }}.linux-amd64/memcached_exporter src: /tmp/memcached_exporter-{{ prometheus_memcached_exporter_version|default(prometheus_memcached_exporter_latest_version.stdout) }}.linux-amd64/memcached_exporter
dest: /usr/local/bin/prometheus-memcached-exporter dest: /usr/local/bin/prometheus-memcached-exporter
@ -28,7 +28,7 @@
notify: notify:
- 'prometheus | memcached exporter | restart service' - 'prometheus | memcached exporter | restart service'
- name: 'prometheus | memcached exporter | install unit file to systemd' - name: 'memcached exporter | install unit file to systemd'
template: template:
src: systemd/prometheus-memcached-exporter.service.j2 src: systemd/prometheus-memcached-exporter.service.j2
dest: /etc/systemd/system/prometheus-memcached-exporter.service dest: /etc/systemd/system/prometheus-memcached-exporter.service
@ -38,7 +38,7 @@
notify: notify:
- 'prometheus | memcached exporter | restart service' - 'prometheus | memcached exporter | restart service'
# - name: 'prometheus | memcached exporter | configuration' # - name: 'memcached exporter | configuration'
# template: # template:
# src: conf/prometheus-memcached-exporter.j2 # src: conf/prometheus-memcached-exporter.j2
# dest: /etc/default/prometheus-memcached-exporter # dest: /etc/default/prometheus-memcached-exporter
@ -49,7 +49,7 @@
# notify: # notify:
# - 'prometheus | memcached exporter | restart service' # - 'prometheus | memcached exporter | restart service'
- name: 'prometheus | memcached exporter | configure systemd to use service' - name: 'memcached exporter | configure systemd to use service'
systemd: systemd:
daemon_reload: yes daemon_reload: yes
enabled: yes enabled: yes

View File

@ -1,23 +1,23 @@
--- ---
- name: 'prometheus | mongodb exporter | get latest release from GitHub' - name: 'mongodb exporter | get latest release from GitHub'
shell: curl --silent "https://api.github.com/repos/percona/mongodb_exporter/releases/latest" | jq -r .tag_name | sed "s/v//" shell: curl --silent "https://api.github.com/repos/percona/mongodb_exporter/releases/latest" | jq -r .tag_name | sed "s/v//"
args: args:
warn: false warn: false
register: prometheus_mongodb_exporter_latest_version register: prometheus_mongodb_exporter_latest_version
run_once: true run_once: true
- name: 'prometheus | mongodb exporter | download' - name: 'mongodb exporter | download'
get_url: get_url:
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 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 dest: /tmp
- name: 'prometheus | mongodb exporter | unarchive' - name: 'mongodb exporter | unarchive'
unarchive: unarchive:
remote_src: yes remote_src: yes
src: /tmp/mongodb_exporter-{{ prometheus_mongodb_exporter_version|default(prometheus_mongodb_exporter_latest_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 dest: /tmp
- name: 'prometheus | mongodb exporter < v0.2 | move to /usr/local/bin' - name: 'mongodb exporter < v0.2 | move to /usr/local/bin'
copy: copy:
src: /tmp/mongodb_exporter src: /tmp/mongodb_exporter
dest: /usr/local/bin/prometheus-mongodb-exporter dest: /usr/local/bin/prometheus-mongodb-exporter
@ -30,7 +30,7 @@
when: when:
- prometheus_mongodb_exporter_latest_version.stdout < '0.2' - prometheus_mongodb_exporter_latest_version.stdout < '0.2'
- name: 'prometheus | mongodb exporter > v0.2 | move to /usr/local/bin' - name: 'mongodb exporter > v0.2 | move to /usr/local/bin'
copy: copy:
src: /tmp/mongodb_exporter-{{ prometheus_mongodb_exporter_version|default(prometheus_mongodb_exporter_latest_version.stdout) }}.linux-amd64/mongodb_exporter 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 dest: /usr/local/bin/prometheus-mongodb-exporter
@ -43,7 +43,7 @@
when: when:
- prometheus_mongodb_exporter_latest_version.stdout > '0.2' - prometheus_mongodb_exporter_latest_version.stdout > '0.2'
- name: 'prometheus | mongodb exporter | configuration' - name: 'mongodb exporter | configuration'
template: template:
src: conf/prometheus-mongodb-exporter.j2 src: conf/prometheus-mongodb-exporter.j2
dest: /etc/default/prometheus-mongodb-exporter dest: /etc/default/prometheus-mongodb-exporter
@ -53,7 +53,7 @@
notify: notify:
- 'prometheus | mongodb exporter | restart service' - 'prometheus | mongodb exporter | restart service'
- name: 'prometheus | mongodb exporter | install unit file to systemd' - name: 'mongodb exporter | install unit file to systemd'
template: template:
src: systemd/prometheus-mongodb-exporter.service.j2 src: systemd/prometheus-mongodb-exporter.service.j2
dest: /etc/systemd/system/prometheus-mongodb-exporter.service dest: /etc/systemd/system/prometheus-mongodb-exporter.service
@ -63,7 +63,7 @@
notify: notify:
- 'prometheus | mongodb exporter | restart service' - 'prometheus | mongodb exporter | restart service'
- name: 'prometheus | mongodb exporter | configure systemd to use service' - name: 'mongodb exporter | configure systemd to use service'
systemd: systemd:
daemon_reload: yes daemon_reload: yes
enabled: yes enabled: yes

View File

@ -1,23 +1,23 @@
--- ---
- name: 'prometheus | mysqld exporter | get latest release from GitHub' - name: 'mysqld exporter | get latest release from GitHub'
shell: curl --silent "https://api.github.com/repos/prometheus/mysqld_exporter/releases/latest" | jq -r .tag_name | sed "s/v//" shell: curl --silent "https://api.github.com/repos/prometheus/mysqld_exporter/releases/latest" | jq -r .tag_name | sed "s/v//"
args: args:
warn: false warn: false
register: prometheus_mysqld_exporter_latest_version register: prometheus_mysqld_exporter_latest_version
run_once: true run_once: true
- name: 'prometheus | mysqld exporter | download' - name: 'mysqld exporter | download'
get_url: get_url:
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 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 dest: /tmp
- name: 'prometheus | mysqld exporter | unarchive' - name: 'mysqld exporter | unarchive'
unarchive: unarchive:
remote_src: yes remote_src: yes
src: /tmp/mysqld_exporter-{{ prometheus_mysqld_exporter_version|default(prometheus_mysqld_exporter_latest_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 dest: /tmp
- name: 'prometheus | mysqld exporter | move to /usr/local/bin' - name: 'mysqld exporter | move to /usr/local/bin'
copy: copy:
src: /tmp/mysqld_exporter-{{ prometheus_mysqld_exporter_version|default(prometheus_mysqld_exporter_latest_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 dest: /usr/local/bin/prometheus-mysqld-exporter
@ -28,7 +28,7 @@
notify: notify:
- 'prometheus | mysqld exporter | restart service' - 'prometheus | mysqld exporter | restart service'
- name: 'prometheus | mysqld exporter | configuration' - name: 'mysqld exporter | configuration'
template: template:
src: conf/prometheus-mysqld-exporter.j2 src: conf/prometheus-mysqld-exporter.j2
dest: /etc/default/prometheus-mysqld-exporter dest: /etc/default/prometheus-mysqld-exporter
@ -41,7 +41,7 @@
notify: notify:
- 'prometheus | mysqld exporter | restart service' - 'prometheus | mysqld exporter | restart service'
- name: 'prometheus | mysqld exporter | install unit file to systemd' - name: 'mysqld exporter | install unit file to systemd'
template: template:
src: systemd/prometheus-mysqld-exporter.service.j2 src: systemd/prometheus-mysqld-exporter.service.j2
dest: /etc/systemd/system/prometheus-mysqld-exporter.service dest: /etc/systemd/system/prometheus-mysqld-exporter.service
@ -49,7 +49,7 @@
group: root group: root
mode: 0600 mode: 0600
- name: 'prometheus | mysqld exporter | configure systemd to use service' - name: 'mysqld exporter | configure systemd to use service'
systemd: systemd:
daemon_reload: yes daemon_reload: yes
enabled: yes enabled: yes

View File

@ -1,23 +1,23 @@
--- ---
- name: 'prometheus | node exporter | get latest release from GitHub' - name: 'node exporter | get latest release from GitHub'
shell: curl --silent "https://api.github.com/repos/prometheus/node_exporter/releases/latest" | jq -r .tag_name | sed "s/v//" shell: curl --silent "https://api.github.com/repos/prometheus/node_exporter/releases/latest" | jq -r .tag_name | sed "s/v//"
args: args:
warn: false warn: false
register: prometheus_node_exporter_latest_version register: prometheus_node_exporter_latest_version
run_once: true run_once: true
- name: 'prometheus | node exporter | download' - name: 'node exporter | download'
get_url: get_url:
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 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 dest: /tmp
- name: 'prometheus | node exporter | unarchive' - name: 'node exporter | unarchive'
unarchive: unarchive:
remote_src: yes remote_src: yes
src: /tmp/node_exporter-{{ prometheus_node_exporter_version|default(prometheus_node_exporter_latest_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 dest: /tmp
- name: 'prometheus | node exporter | move to /usr/local/bin' - name: 'node exporter | move to /usr/local/bin'
copy: copy:
src: /tmp/node_exporter-{{ prometheus_node_exporter_version|default(prometheus_node_exporter_latest_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 dest: /usr/local/bin/prometheus-node-exporter
@ -28,7 +28,7 @@
notify: notify:
- 'prometheus | node exporter | restart service' - 'prometheus | node exporter | restart service'
- name: 'prometheus | node exporter | install unit file to systemd' - name: 'node exporter | install unit file to systemd'
template: template:
src: systemd/prometheus-node-exporter.service.j2 src: systemd/prometheus-node-exporter.service.j2
dest: /etc/systemd/system/prometheus-node-exporter.service dest: /etc/systemd/system/prometheus-node-exporter.service
@ -36,7 +36,7 @@
group: root group: root
mode: 0600 mode: 0600
- name: 'prometheus | node exporter | configure systemd to use service' - name: 'node exporter | configure systemd to use service'
systemd: systemd:
daemon_reload: yes daemon_reload: yes
enabled: yes enabled: yes

View File

@ -1,17 +1,17 @@
--- ---
- name: 'prometheus | opcache exporter | get latest release from GitHub' - name: 'opcache exporter | get latest release from GitHub'
shell: curl --silent "https://api.github.com/repos/MyOnlineStore/opcache-exporter/releases/latest" | jq -r .tag_name | sed "s/v//" shell: curl --silent "https://api.github.com/repos/MyOnlineStore/opcache-exporter/releases/latest" | jq -r .tag_name | sed "s/v//"
args: args:
warn: false warn: false
register: prometheus_opcache_exporter_latest_version register: prometheus_opcache_exporter_latest_version
run_once: true run_once: true
- name: 'prometheus | opcache exporter | download' - name: 'opcache exporter | download'
get_url: get_url:
url: https://github.com/MyOnlineStore/opcache-exporter/releases/download/v{{ prometheus_opcache_exporter_version|default(prometheus_opcache_exporter_latest_version.stdout) }}/opcache_exporter-{{ prometheus_opcache_exporter_version|default(prometheus_opcache_exporter_latest_version.stdout) }}-linux-amd64 url: https://github.com/MyOnlineStore/opcache-exporter/releases/download/v{{ prometheus_opcache_exporter_version|default(prometheus_opcache_exporter_latest_version.stdout) }}/opcache_exporter-{{ prometheus_opcache_exporter_version|default(prometheus_opcache_exporter_latest_version.stdout) }}-linux-amd64
dest: /tmp dest: /tmp
- name: 'prometheus | opcache exporter | move to /usr/local/bin' - name: 'opcache exporter | move to /usr/local/bin'
copy: copy:
src: /tmp/opcache_exporter-{{ prometheus_opcache_exporter_version|default(prometheus_opcache_exporter_latest_version.stdout) }}-linux-amd64 src: /tmp/opcache_exporter-{{ prometheus_opcache_exporter_version|default(prometheus_opcache_exporter_latest_version.stdout) }}-linux-amd64
dest: /usr/local/bin/prometheus-opcache-exporter dest: /usr/local/bin/prometheus-opcache-exporter
@ -22,7 +22,7 @@
notify: notify:
- 'prometheus | opcache exporter | restart service' - 'prometheus | opcache exporter | restart service'
- name: 'prometheus | opcache exporter | configuration' - name: 'opcache exporter | configuration'
template: template:
src: conf/prometheus-opcache-exporter.j2 src: conf/prometheus-opcache-exporter.j2
dest: /etc/default/prometheus-opcache-exporter dest: /etc/default/prometheus-opcache-exporter
@ -33,7 +33,7 @@
notify: notify:
- 'prometheus | opcache exporter | restart service' - 'prometheus | opcache exporter | restart service'
- name: 'prometheus | opcache exporter | install unit file to systemd' - name: 'opcache exporter | install unit file to systemd'
template: template:
src: systemd/prometheus-opcache-exporter.service.j2 src: systemd/prometheus-opcache-exporter.service.j2
dest: /etc/systemd/system/prometheus-opcache-exporter.service dest: /etc/systemd/system/prometheus-opcache-exporter.service
@ -41,7 +41,7 @@
group: root group: root
mode: 0600 mode: 0600
- name: 'prometheus | opcache exporter | configure systemd to use service' - name: 'opcache exporter | configure systemd to use service'
systemd: systemd:
daemon_reload: yes daemon_reload: yes
enabled: yes enabled: yes

View File

@ -1,23 +1,23 @@
--- ---
- name: 'prometheus | phpfpm exporter | get latest release from GitHub' - name: 'phpfpm exporter | get latest release from GitHub'
shell: curl --silent "https://api.github.com/repos/Lusitaniae/phpfpm_exporter/releases/latest" | jq -r .tag_name | sed "s/v//" shell: curl --silent "https://api.github.com/repos/Lusitaniae/phpfpm_exporter/releases/latest" | jq -r .tag_name | sed "s/v//"
args: args:
warn: false warn: false
register: prometheus_phpfpm_exporter_latest_version register: prometheus_phpfpm_exporter_latest_version
run_once: true run_once: true
- name: 'prometheus | phpfpm exporter | download' - name: 'phpfpm exporter | download'
get_url: get_url:
url: https://github.com/Lusitaniae/phpfpm_exporter/releases/download/v{{ prometheus_phpfpm_exporter_version|default(prometheus_phpfpm_exporter_latest_version.stdout) }}/phpfpm_exporter-{{ prometheus_phpfpm_exporter_version|default(prometheus_phpfpm_exporter_latest_version.stdout) }}.linux-amd64.tar.gz url: https://github.com/Lusitaniae/phpfpm_exporter/releases/download/v{{ prometheus_phpfpm_exporter_version|default(prometheus_phpfpm_exporter_latest_version.stdout) }}/phpfpm_exporter-{{ prometheus_phpfpm_exporter_version|default(prometheus_phpfpm_exporter_latest_version.stdout) }}.linux-amd64.tar.gz
dest: /tmp dest: /tmp
- name: 'prometheus | phpfpm exporter | unarchive' - name: 'phpfpm exporter | unarchive'
unarchive: unarchive:
remote_src: yes remote_src: yes
src: /tmp/phpfpm_exporter-{{ prometheus_phpfpm_exporter_version|default(prometheus_phpfpm_exporter_latest_version.stdout) }}.linux-amd64.tar.gz src: /tmp/phpfpm_exporter-{{ prometheus_phpfpm_exporter_version|default(prometheus_phpfpm_exporter_latest_version.stdout) }}.linux-amd64.tar.gz
dest: /tmp dest: /tmp
- name: 'prometheus | phpfpm exporter | move to /usr/local/bin' - name: 'phpfpm exporter | move to /usr/local/bin'
copy: copy:
src: /tmp/phpfpm_exporter-{{ prometheus_phpfpm_exporter_version|default(prometheus_phpfpm_exporter_latest_version.stdout) }}.linux-amd64/phpfpm_exporter src: /tmp/phpfpm_exporter-{{ prometheus_phpfpm_exporter_version|default(prometheus_phpfpm_exporter_latest_version.stdout) }}.linux-amd64/phpfpm_exporter
dest: /usr/local/bin/prometheus-phpfpm-exporter dest: /usr/local/bin/prometheus-phpfpm-exporter
@ -26,9 +26,9 @@
group: root group: root
mode: 0755 mode: 0755
notify: notify:
- 'prometheus | phpfpm exporter | restart service' - 'phpfpm exporter | restart service'
- name: 'prometheus | phpfpm exporter | install startup script' - name: 'phpfpm exporter | install startup script'
template: template:
src: scripts/prometheus-phpfpm-exporter-script.sh.j2 src: scripts/prometheus-phpfpm-exporter-script.sh.j2
dest: /usr/local/bin/prometheus-phpfpm-exporter-script.sh dest: /usr/local/bin/prometheus-phpfpm-exporter-script.sh
@ -38,7 +38,7 @@
notify: notify:
- 'prometheus | phpfpm exporter | restart service' - 'prometheus | phpfpm exporter | restart service'
- name: 'prometheus | phpfpm exporter | install unit file to systemd' - name: 'phpfpm exporter | install unit file to systemd'
template: template:
src: systemd/prometheus-phpfpm-exporter.service.j2 src: systemd/prometheus-phpfpm-exporter.service.j2
dest: /etc/systemd/system/prometheus-phpfpm-exporter.service dest: /etc/systemd/system/prometheus-phpfpm-exporter.service
@ -46,7 +46,7 @@
group: root group: root
mode: 0600 mode: 0600
- name: 'prometheus | phpfpm exporter | configure systemd to use service' - name: 'phpfpm exporter | configure systemd to use service'
systemd: systemd:
daemon_reload: yes daemon_reload: yes
enabled: yes enabled: yes

View File

@ -1,23 +1,23 @@
--- ---
- name: 'prometheus | postgres exporter | get latest release from GitHub' - name: 'postgres exporter | get latest release from GitHub'
shell: curl --silent "https://api.github.com/repos/prometheus-community/postgres_exporter/releases/latest" | jq -r .tag_name | sed "s/v//" shell: curl --silent "https://api.github.com/repos/prometheus-community/postgres_exporter/releases/latest" | jq -r .tag_name | sed "s/v//"
args: args:
warn: false warn: false
register: prometheus_postgres_exporter_latest_version register: prometheus_postgres_exporter_latest_version
run_once: true run_once: true
- name: 'prometheus | postgres exporter | download' - name: 'postgres exporter | download'
get_url: get_url:
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 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 dest: /tmp
- name: 'prometheus | postgres exporter | unarchive' - name: 'postgres exporter | unarchive'
unarchive: unarchive:
remote_src: yes remote_src: yes
src: /tmp/postgres_exporter-{{ prometheus_postgres_exporter_version|default(prometheus_postgres_exporter_latest_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 dest: /tmp
- name: 'prometheus | postgres exporter | move to /usr/local/bin' - name: 'postgres exporter | move to /usr/local/bin'
copy: copy:
src: /tmp/postgres_exporter-{{ prometheus_postgres_exporter_version|default(prometheus_postgres_exporter_latest_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 dest: /usr/local/bin/prometheus-postgres-exporter
@ -28,7 +28,7 @@
notify: notify:
- 'prometheus | postgres exporter | restart service' - 'prometheus | postgres exporter | restart service'
- name: 'prometheus | postgres exporter | configuration' - name: 'postgres exporter | configuration'
template: template:
src: conf/prometheus-postgres-exporter.j2 src: conf/prometheus-postgres-exporter.j2
dest: /etc/default/prometheus-postgres-exporter dest: /etc/default/prometheus-postgres-exporter
@ -39,7 +39,7 @@
notify: notify:
- 'prometheus | postgres exporter | restart service' - 'prometheus | postgres exporter | restart service'
- name: 'prometheus | postgres exporter | install unit file to systemd' - name: 'postgres exporter | install unit file to systemd'
template: template:
src: systemd/prometheus-postgres-exporter.service.j2 src: systemd/prometheus-postgres-exporter.service.j2
dest: /etc/systemd/system/prometheus-postgres-exporter.service dest: /etc/systemd/system/prometheus-postgres-exporter.service
@ -47,7 +47,7 @@
group: root group: root
mode: 0600 mode: 0600
- name: 'prometheus | postgres exporter | configure systemd to use service' - name: 'postgres exporter | configure systemd to use service'
systemd: systemd:
daemon_reload: yes daemon_reload: yes
enabled: yes enabled: yes

View File

@ -1,23 +1,23 @@
--- ---
- name: 'prometheus | redis exporter | get latest release from GitHub' - name: 'redis exporter | get latest release from GitHub'
shell: curl --silent "https://api.github.com/repos/oliver006/redis_exporter/releases/latest" | jq -r .tag_name | sed "s/v//" shell: curl --silent "https://api.github.com/repos/oliver006/redis_exporter/releases/latest" | jq -r .tag_name | sed "s/v//"
args: args:
warn: false warn: false
register: prometheus_redis_exporter_latest_version register: prometheus_redis_exporter_latest_version
run_once: true run_once: true
- name: 'prometheus | redis exporter | download' - name: 'redis exporter | download'
get_url: get_url:
url: https://github.com/oliver006/redis_exporter/releases/download/v{{ prometheus_redis_exporter_version|default(prometheus_redis_exporter_latest_version.stdout) }}/redis_exporter-v{{ prometheus_redis_exporter_version|default(prometheus_redis_exporter_latest_version.stdout) }}.linux-amd64.tar.gz url: https://github.com/oliver006/redis_exporter/releases/download/v{{ prometheus_redis_exporter_version|default(prometheus_redis_exporter_latest_version.stdout) }}/redis_exporter-v{{ prometheus_redis_exporter_version|default(prometheus_redis_exporter_latest_version.stdout) }}.linux-amd64.tar.gz
dest: /tmp dest: /tmp
- name: 'prometheus | redis exporter | unarchive' - name: 'redis exporter | unarchive'
unarchive: unarchive:
remote_src: yes remote_src: yes
src: /tmp/redis_exporter-v{{ prometheus_redis_exporter_version|default(prometheus_redis_exporter_latest_version.stdout) }}.linux-amd64.tar.gz src: /tmp/redis_exporter-v{{ prometheus_redis_exporter_version|default(prometheus_redis_exporter_latest_version.stdout) }}.linux-amd64.tar.gz
dest: /tmp dest: /tmp
- name: 'prometheus | redis exporter | move to /usr/local/bin' - name: 'redis exporter | move to /usr/local/bin'
copy: copy:
src: /tmp/redis_exporter-v{{ prometheus_redis_exporter_version|default(prometheus_redis_exporter_latest_version.stdout) }}.linux-amd64/redis_exporter src: /tmp/redis_exporter-v{{ prometheus_redis_exporter_version|default(prometheus_redis_exporter_latest_version.stdout) }}.linux-amd64/redis_exporter
dest: /usr/local/bin/prometheus-redis-exporter dest: /usr/local/bin/prometheus-redis-exporter
@ -26,7 +26,7 @@
group: root group: root
mode: 0755 mode: 0755
- name: 'prometheus | redis exporter | configuration' - name: 'redis exporter | configuration'
template: template:
src: conf/prometheus-redis-exporter.j2 src: conf/prometheus-redis-exporter.j2
dest: /etc/default/prometheus-redis-exporter dest: /etc/default/prometheus-redis-exporter
@ -37,7 +37,7 @@
notify: notify:
- 'prometheus | redis exporter | restart service' - 'prometheus | redis exporter | restart service'
- name: 'prometheus | redis exporter | install unit file to systemd' - name: 'redis exporter | install unit file to systemd'
template: template:
src: systemd/prometheus-redis-exporter.service.j2 src: systemd/prometheus-redis-exporter.service.j2
dest: /etc/systemd/system/prometheus-redis-exporter.service dest: /etc/systemd/system/prometheus-redis-exporter.service
@ -45,7 +45,7 @@
group: root group: root
mode: 0600 mode: 0600
- name: 'prometheus | redis exporter | configure systemd to use service' - name: 'redis exporter | configure systemd to use service'
systemd: systemd:
daemon_reload: yes daemon_reload: yes
enabled: yes enabled: yes

View File

@ -1,23 +1,23 @@
--- ---
- name: 'prometheus | varnish exporter | get latest release from GitHub' - name: 'varnish exporter | get latest release from GitHub'
shell: curl --silent "https://api.github.com/repos/jonnenauha/prometheus_varnish_exporter/releases/latest" | jq -r .tag_name | sed "s/v//" shell: curl --silent "https://api.github.com/repos/jonnenauha/prometheus_varnish_exporter/releases/latest" | jq -r .tag_name | sed "s/v//"
args: args:
warn: false warn: false
register: prometheus_varnish_exporter_latest_version register: prometheus_varnish_exporter_latest_version
run_once: true run_once: true
- name: 'prometheus | varnish exporter | download' - name: 'varnish exporter | download'
get_url: get_url:
url: https://github.com/jonnenauha/prometheus_varnish_exporter/releases/download/{{ prometheus_varnish_exporter_version|default(prometheus_varnish_exporter_latest_version.stdout) }}/prometheus_varnish_exporter-{{ prometheus_varnish_exporter_version|default(prometheus_varnish_exporter_latest_version.stdout) }}.linux-amd64.tar.gz url: https://github.com/jonnenauha/prometheus_varnish_exporter/releases/download/{{ prometheus_varnish_exporter_version|default(prometheus_varnish_exporter_latest_version.stdout) }}/prometheus_varnish_exporter-{{ prometheus_varnish_exporter_version|default(prometheus_varnish_exporter_latest_version.stdout) }}.linux-amd64.tar.gz
dest: /tmp dest: /tmp
- name: 'prometheus | varnish exporter | unarchive' - name: 'varnish exporter | unarchive'
unarchive: unarchive:
remote_src: yes remote_src: yes
src: /tmp/prometheus_varnish_exporter-{{ prometheus_varnish_exporter_version|default(prometheus_varnish_exporter_latest_version.stdout) }}.linux-amd64.tar.gz src: /tmp/prometheus_varnish_exporter-{{ prometheus_varnish_exporter_version|default(prometheus_varnish_exporter_latest_version.stdout) }}.linux-amd64.tar.gz
dest: /tmp dest: /tmp
- name: 'prometheus | varnish exporter | move to /usr/local/bin' - name: 'varnish exporter | move to /usr/local/bin'
copy: copy:
src: /tmp/prometheus_varnish_exporter-{{ prometheus_varnish_exporter_version|default(prometheus_varnish_exporter_latest_version.stdout) }}.linux-amd64/prometheus_varnish_exporter src: /tmp/prometheus_varnish_exporter-{{ prometheus_varnish_exporter_version|default(prometheus_varnish_exporter_latest_version.stdout) }}.linux-amd64/prometheus_varnish_exporter
dest: /usr/local/bin/prometheus-varnish-exporter dest: /usr/local/bin/prometheus-varnish-exporter
@ -28,7 +28,7 @@
notify: notify:
- 'prometheus | varnish exporter | restart service' - 'prometheus | varnish exporter | restart service'
- name: 'prometheus | varnish exporter | install unit file to systemd' - name: 'varnish exporter | install unit file to systemd'
template: template:
src: systemd/prometheus-varnish-exporter.service.j2 src: systemd/prometheus-varnish-exporter.service.j2
dest: /etc/systemd/system/prometheus-varnish-exporter.service dest: /etc/systemd/system/prometheus-varnish-exporter.service
@ -36,7 +36,7 @@
group: root group: root
mode: 0600 mode: 0600
- name: 'prometheus | varnish exporter | configure systemd to use service' - name: 'varnish exporter | configure systemd to use service'
systemd: systemd:
daemon_reload: yes daemon_reload: yes
enabled: yes enabled: yes

View File

@ -1,18 +1,18 @@
--- ---
- name: 'prometheus | include asserts' - name: 'include asserts'
include_tasks: 'asserts.yml' include_tasks: 'asserts.yml'
- name: 'prometheus | requirements' - name: 'requirements'
include_tasks: 'requirements.yml' include_tasks: 'requirements.yml'
## prometheus server install ## prometheus server install
- name: 'prometheus | server install' - name: 'server install'
include_tasks: 'server/prometheus.yml' include_tasks: 'server/prometheus.yml'
when: when:
- prometheus_server_enable == "true" - prometheus_server_enable == "true"
## include exporter install ## include exporter install
- name: 'prometheus | exporter install' - name: 'exporters install'
vars: vars:
service: "{{ item }}" service: "{{ item }}"
include_tasks: "exporter/{{ item }}.yml" include_tasks: "exporter/{{ item }}.yml"

View File

@ -1,14 +1,13 @@
--- ---
- name: 'prometheus | update APT Cache' - name: 'requirement | update APT Cache'
apt: apt:
update_cache: yes update_cache: yes
cache_valid_time: 3600 cache_valid_time: 3600
- name: 'prometheus | pre-requirements install' - name: 'requirement | pre-requirements install'
apt: apt:
name: name:
- curl - curl
- jq - jq
state: present state: present
tags: ['prometheus'] tags: ['prometheus']