From 2d141b32a43dc100217dbca8ea5bed87084b66b6 Mon Sep 17 00:00:00 2001 From: Ludovic Cartier Date: Fri, 11 Nov 2022 21:08:07 +0100 Subject: [PATCH] remove prometheus in tasks' name --- tasks/asserts.yml | 9 ++++----- tasks/exporter/apache.yml | 10 +++++----- tasks/exporter/blackbox.yml | 14 +++++++------- tasks/exporter/memcached.yml | 12 ++++++------ tasks/exporter/mongodb.yml | 16 ++++++++-------- tasks/exporter/mysqld.yml | 14 +++++++------- tasks/exporter/node.yml | 12 ++++++------ tasks/exporter/opcache.yml | 12 ++++++------ tasks/exporter/phpfpm.yml | 16 ++++++++-------- tasks/exporter/postgresql.yml | 14 +++++++------- tasks/exporter/redis.yml | 14 +++++++------- tasks/exporter/varnish.yml | 12 ++++++------ tasks/main.yml | 8 ++++---- tasks/requirements.yml | 5 ++--- 14 files changed, 83 insertions(+), 85 deletions(-) diff --git a/tasks/asserts.yml b/tasks/asserts.yml index e5147a0..ff6e3a2 100644 --- a/tasks/asserts.yml +++ b/tasks/asserts.yml @@ -1,12 +1,12 @@ --- -- name: 'prometheus | assert | check if ansible version >= 2.7' +- name: 'assert | check if ansible version >= 2.7' assert: 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 tags: - prometheus -- name: 'prometheus | assert | gather the package facts' +- name: 'assert | gather the package facts' ansible.builtin.package_facts: manager: auto when: @@ -15,7 +15,7 @@ tags: - prometheus -- name: 'prometheus | assert | check if docker-ce is installed' +- name: 'assert | check if docker-ce is installed' assert: that: "'docker-ce' in ansible_facts.packages" when: @@ -24,7 +24,7 @@ tags: - prometheus -- name: 'prometheus | assert | check if docker pyhon libraries are installed' +- name: 'assert | check if docker pyhon libraries are installed' assert: that: #- "'python-docker' in ansible_facts.packages" @@ -34,4 +34,3 @@ - prometheus_server_enable == "true" tags: - prometheus - diff --git a/tasks/exporter/apache.yml b/tasks/exporter/apache.yml index 9f85ce6..a5bf098 100644 --- a/tasks/exporter/apache.yml +++ b/tasks/exporter/apache.yml @@ -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//" args: warn: false register: prometheus_apache_exporter_latest_version run_once: true -- name: 'prometheus | apache exporter | download' +- name: 'apache exporter | download' 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 dest: /tmp -- name: 'prometheus | apache exporter | unarchive' +- name: 'apache exporter | unarchive' unarchive: remote_src: yes src: /tmp/apache_exporter-{{ prometheus_apache_exporter_version|default(prometheus_apache_exporter_latest_version.stdout) }}.linux-amd64.tar.gz dest: /tmp -- name: 'prometheus | apache exporter | move to /usr/local/bin' +- name: 'apache exporter | move to /usr/local/bin' copy: 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 @@ -28,7 +28,7 @@ notify: - 'prometheus | apache exporter | restart service' -- name: 'prometheus | apache exporter | install unit file to systemd' +- name: 'apache exporter | install unit file to systemd' template: src: systemd/prometheus-apache-exporter.service.j2 dest: /etc/systemd/system/prometheus-apache-exporter.service diff --git a/tasks/exporter/blackbox.yml b/tasks/exporter/blackbox.yml index f4a86ec..e31cd54 100644 --- a/tasks/exporter/blackbox.yml +++ b/tasks/exporter/blackbox.yml @@ -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//" args: warn: false register: prometheus_blackbox_exporter_latest_version run_once: true -- name: 'prometheus | blackbox exporter | download' +- name: 'blackbox exporter | download' 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 dest: /tmp -- name: 'prometheus | blackbox exporter | unarchive' +- name: 'blackbox exporter | unarchive' unarchive: remote_src: yes src: /tmp/blackbox_exporter-{{ prometheus_blackbox_exporter_version|default(prometheus_blackbox_exporter_latest_version.stdout) }}.linux-amd64.tar.gz dest: /tmp -- name: 'prometheus | blackbox exporter | move to /usr/local/bin' +- name: 'blackbox exporter | move to /usr/local/bin' copy: 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 @@ -28,7 +28,7 @@ notify: - 'prometheus | blackbox exporter | restart service' -- name: 'prometheus | blackbox exporter | configuration' +- name: 'blackbox exporter | configuration' template: src: conf/prometheus-blackbox-exporter.j2 dest: /etc/default/prometheus-blackbox-exporter @@ -39,7 +39,7 @@ notify: - 'prometheus | blackbox exporter | restart service' -- name: 'prometheus | blackbox exporter | install unit file to systemd' +- name: 'blackbox exporter | install unit file to systemd' template: src: systemd/prometheus-blackbox-exporter.service.j2 dest: /etc/systemd/system/prometheus-blackbox-exporter.service @@ -49,7 +49,7 @@ notify: - 'prometheus | blackbox exporter | restart service' -- name: 'prometheus | blackbox exporter | configure systemd to use service' +- name: 'blackbox exporter | configure systemd to use service' systemd: daemon_reload: yes enabled: yes diff --git a/tasks/exporter/memcached.yml b/tasks/exporter/memcached.yml index dd1d2c2..00f46e5 100644 --- a/tasks/exporter/memcached.yml +++ b/tasks/exporter/memcached.yml @@ -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//" args: 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 dest: /tmp -- name: 'prometheus | memcached exporter | unarchive' +- name: 'memcached exporter | unarchive' unarchive: remote_src: yes src: /tmp/memcached_exporter-{{ prometheus_memcached_exporter_version|default(prometheus_memcached_exporter_latest_version.stdout) }}.linux-amd64.tar.gz dest: /tmp -- name: 'prometheus | memcached exporter | move to /usr/local/bin' +- name: 'memcached exporter | move to /usr/local/bin' copy: 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 @@ -28,7 +28,7 @@ notify: - 'prometheus | memcached exporter | restart service' -- name: 'prometheus | memcached exporter | install unit file to systemd' +- name: 'memcached exporter | install unit file to systemd' template: src: systemd/prometheus-memcached-exporter.service.j2 dest: /etc/systemd/system/prometheus-memcached-exporter.service @@ -38,7 +38,7 @@ notify: - 'prometheus | memcached exporter | restart service' -# - name: 'prometheus | memcached exporter | configuration' +# - name: 'memcached exporter | configuration' # template: # src: conf/prometheus-memcached-exporter.j2 # dest: /etc/default/prometheus-memcached-exporter @@ -49,7 +49,7 @@ # notify: # - 'prometheus | memcached exporter | restart service' -- name: 'prometheus | memcached exporter | configure systemd to use service' +- name: 'memcached exporter | configure systemd to use service' systemd: daemon_reload: yes enabled: yes diff --git a/tasks/exporter/mongodb.yml b/tasks/exporter/mongodb.yml index 9868ac0..8299d9e 100644 --- a/tasks/exporter/mongodb.yml +++ b/tasks/exporter/mongodb.yml @@ -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//" args: warn: false register: prometheus_mongodb_exporter_latest_version run_once: true -- name: 'prometheus | mongodb exporter | download' +- name: 'mongodb exporter | download' 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 dest: /tmp -- name: 'prometheus | mongodb exporter | unarchive' +- name: 'mongodb exporter | unarchive' unarchive: remote_src: yes 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 < v0.2 | move to /usr/local/bin' +- name: 'mongodb exporter < v0.2 | move to /usr/local/bin' copy: src: /tmp/mongodb_exporter dest: /usr/local/bin/prometheus-mongodb-exporter @@ -30,7 +30,7 @@ when: - 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: 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 @@ -43,7 +43,7 @@ when: - prometheus_mongodb_exporter_latest_version.stdout > '0.2' -- name: 'prometheus | mongodb exporter | configuration' +- name: 'mongodb exporter | configuration' template: src: conf/prometheus-mongodb-exporter.j2 dest: /etc/default/prometheus-mongodb-exporter @@ -53,7 +53,7 @@ notify: - 'prometheus | mongodb exporter | restart service' -- name: 'prometheus | mongodb exporter | install unit file to systemd' +- name: 'mongodb exporter | install unit file to systemd' template: src: systemd/prometheus-mongodb-exporter.service.j2 dest: /etc/systemd/system/prometheus-mongodb-exporter.service @@ -63,7 +63,7 @@ notify: - 'prometheus | mongodb exporter | restart service' -- name: 'prometheus | mongodb exporter | configure systemd to use service' +- name: 'mongodb exporter | configure systemd to use service' systemd: daemon_reload: yes enabled: yes diff --git a/tasks/exporter/mysqld.yml b/tasks/exporter/mysqld.yml index 0f2f940..05a65dc 100644 --- a/tasks/exporter/mysqld.yml +++ b/tasks/exporter/mysqld.yml @@ -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//" args: warn: false register: prometheus_mysqld_exporter_latest_version run_once: true -- name: 'prometheus | mysqld exporter | download' +- name: 'mysqld exporter | download' 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 dest: /tmp -- name: 'prometheus | mysqld exporter | unarchive' +- name: 'mysqld exporter | unarchive' unarchive: remote_src: yes 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' +- name: 'mysqld exporter | move to /usr/local/bin' copy: 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 @@ -28,7 +28,7 @@ notify: - 'prometheus | mysqld exporter | restart service' -- name: 'prometheus | mysqld exporter | configuration' +- name: 'mysqld exporter | configuration' template: src: conf/prometheus-mysqld-exporter.j2 dest: /etc/default/prometheus-mysqld-exporter @@ -41,7 +41,7 @@ notify: - 'prometheus | mysqld exporter | restart service' -- name: 'prometheus | mysqld exporter | install unit file to systemd' +- name: 'mysqld exporter | install unit file to systemd' template: src: systemd/prometheus-mysqld-exporter.service.j2 dest: /etc/systemd/system/prometheus-mysqld-exporter.service @@ -49,7 +49,7 @@ group: root mode: 0600 -- name: 'prometheus | mysqld exporter | configure systemd to use service' +- name: 'mysqld exporter | configure systemd to use service' systemd: daemon_reload: yes enabled: yes diff --git a/tasks/exporter/node.yml b/tasks/exporter/node.yml index 0a00b03..745e9f1 100644 --- a/tasks/exporter/node.yml +++ b/tasks/exporter/node.yml @@ -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//" args: warn: false register: prometheus_node_exporter_latest_version run_once: true -- name: 'prometheus | node exporter | download' +- name: 'node exporter | download' 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 dest: /tmp -- name: 'prometheus | node exporter | unarchive' +- name: 'node exporter | unarchive' unarchive: remote_src: yes 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' +- name: 'node exporter | move to /usr/local/bin' copy: 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 @@ -28,7 +28,7 @@ notify: - 'prometheus | node exporter | restart service' -- name: 'prometheus | node exporter | install unit file to systemd' +- name: 'node exporter | install unit file to systemd' template: src: systemd/prometheus-node-exporter.service.j2 dest: /etc/systemd/system/prometheus-node-exporter.service @@ -36,7 +36,7 @@ group: root mode: 0600 -- name: 'prometheus | node exporter | configure systemd to use service' +- name: 'node exporter | configure systemd to use service' systemd: daemon_reload: yes enabled: yes diff --git a/tasks/exporter/opcache.yml b/tasks/exporter/opcache.yml index e9d3223..cb9b252 100644 --- a/tasks/exporter/opcache.yml +++ b/tasks/exporter/opcache.yml @@ -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//" args: warn: false register: prometheus_opcache_exporter_latest_version run_once: true -- name: 'prometheus | opcache exporter | download' +- name: 'opcache exporter | download' 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 dest: /tmp -- name: 'prometheus | opcache exporter | move to /usr/local/bin' +- name: 'opcache exporter | move to /usr/local/bin' copy: src: /tmp/opcache_exporter-{{ prometheus_opcache_exporter_version|default(prometheus_opcache_exporter_latest_version.stdout) }}-linux-amd64 dest: /usr/local/bin/prometheus-opcache-exporter @@ -22,7 +22,7 @@ notify: - 'prometheus | opcache exporter | restart service' -- name: 'prometheus | opcache exporter | configuration' +- name: 'opcache exporter | configuration' template: src: conf/prometheus-opcache-exporter.j2 dest: /etc/default/prometheus-opcache-exporter @@ -33,7 +33,7 @@ notify: - 'prometheus | opcache exporter | restart service' -- name: 'prometheus | opcache exporter | install unit file to systemd' +- name: 'opcache exporter | install unit file to systemd' template: src: systemd/prometheus-opcache-exporter.service.j2 dest: /etc/systemd/system/prometheus-opcache-exporter.service @@ -41,7 +41,7 @@ group: root mode: 0600 -- name: 'prometheus | opcache exporter | configure systemd to use service' +- name: 'opcache exporter | configure systemd to use service' systemd: daemon_reload: yes enabled: yes diff --git a/tasks/exporter/phpfpm.yml b/tasks/exporter/phpfpm.yml index bf378dd..e672096 100644 --- a/tasks/exporter/phpfpm.yml +++ b/tasks/exporter/phpfpm.yml @@ -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//" args: warn: false register: prometheus_phpfpm_exporter_latest_version run_once: true -- name: 'prometheus | phpfpm exporter | download' +- name: 'phpfpm exporter | download' 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 dest: /tmp -- name: 'prometheus | phpfpm exporter | unarchive' +- name: 'phpfpm exporter | unarchive' unarchive: remote_src: yes src: /tmp/phpfpm_exporter-{{ prometheus_phpfpm_exporter_version|default(prometheus_phpfpm_exporter_latest_version.stdout) }}.linux-amd64.tar.gz dest: /tmp -- name: 'prometheus | phpfpm exporter | move to /usr/local/bin' +- name: 'phpfpm exporter | move to /usr/local/bin' copy: 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 @@ -26,9 +26,9 @@ group: root mode: 0755 notify: - - 'prometheus | phpfpm exporter | restart service' + - 'phpfpm exporter | restart service' -- name: 'prometheus | phpfpm exporter | install startup script' +- name: 'phpfpm exporter | install startup script' template: src: scripts/prometheus-phpfpm-exporter-script.sh.j2 dest: /usr/local/bin/prometheus-phpfpm-exporter-script.sh @@ -38,7 +38,7 @@ notify: - 'prometheus | phpfpm exporter | restart service' -- name: 'prometheus | phpfpm exporter | install unit file to systemd' +- name: 'phpfpm exporter | install unit file to systemd' template: src: systemd/prometheus-phpfpm-exporter.service.j2 dest: /etc/systemd/system/prometheus-phpfpm-exporter.service @@ -46,7 +46,7 @@ group: root mode: 0600 -- name: 'prometheus | phpfpm exporter | configure systemd to use service' +- name: 'phpfpm exporter | configure systemd to use service' systemd: daemon_reload: yes enabled: yes diff --git a/tasks/exporter/postgresql.yml b/tasks/exporter/postgresql.yml index 971a0c8..4e3975d 100644 --- a/tasks/exporter/postgresql.yml +++ b/tasks/exporter/postgresql.yml @@ -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//" args: warn: false register: prometheus_postgres_exporter_latest_version run_once: true -- name: 'prometheus | postgres exporter | download' +- name: 'postgres exporter | download' 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 dest: /tmp -- name: 'prometheus | postgres exporter | unarchive' +- name: 'postgres exporter | unarchive' unarchive: remote_src: yes 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' +- name: 'postgres exporter | move to /usr/local/bin' copy: 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 @@ -28,7 +28,7 @@ notify: - 'prometheus | postgres exporter | restart service' -- name: 'prometheus | postgres exporter | configuration' +- name: 'postgres exporter | configuration' template: src: conf/prometheus-postgres-exporter.j2 dest: /etc/default/prometheus-postgres-exporter @@ -39,7 +39,7 @@ notify: - 'prometheus | postgres exporter | restart service' -- name: 'prometheus | postgres exporter | install unit file to systemd' +- name: 'postgres exporter | install unit file to systemd' template: src: systemd/prometheus-postgres-exporter.service.j2 dest: /etc/systemd/system/prometheus-postgres-exporter.service @@ -47,7 +47,7 @@ group: root mode: 0600 -- name: 'prometheus | postgres exporter | configure systemd to use service' +- name: 'postgres exporter | configure systemd to use service' systemd: daemon_reload: yes enabled: yes diff --git a/tasks/exporter/redis.yml b/tasks/exporter/redis.yml index 9d49d3f..b44a214 100644 --- a/tasks/exporter/redis.yml +++ b/tasks/exporter/redis.yml @@ -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//" args: warn: false register: prometheus_redis_exporter_latest_version run_once: true -- name: 'prometheus | redis exporter | download' +- name: 'redis exporter | download' 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 dest: /tmp -- name: 'prometheus | redis exporter | unarchive' +- name: 'redis exporter | unarchive' unarchive: remote_src: yes src: /tmp/redis_exporter-v{{ prometheus_redis_exporter_version|default(prometheus_redis_exporter_latest_version.stdout) }}.linux-amd64.tar.gz dest: /tmp -- name: 'prometheus | redis exporter | move to /usr/local/bin' +- name: 'redis exporter | move to /usr/local/bin' copy: 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 @@ -26,7 +26,7 @@ group: root mode: 0755 -- name: 'prometheus | redis exporter | configuration' +- name: 'redis exporter | configuration' template: src: conf/prometheus-redis-exporter.j2 dest: /etc/default/prometheus-redis-exporter @@ -37,7 +37,7 @@ notify: - 'prometheus | redis exporter | restart service' -- name: 'prometheus | redis exporter | install unit file to systemd' +- name: 'redis exporter | install unit file to systemd' template: src: systemd/prometheus-redis-exporter.service.j2 dest: /etc/systemd/system/prometheus-redis-exporter.service @@ -45,7 +45,7 @@ group: root mode: 0600 -- name: 'prometheus | redis exporter | configure systemd to use service' +- name: 'redis exporter | configure systemd to use service' systemd: daemon_reload: yes enabled: yes diff --git a/tasks/exporter/varnish.yml b/tasks/exporter/varnish.yml index 0450a52..b76d04b 100644 --- a/tasks/exporter/varnish.yml +++ b/tasks/exporter/varnish.yml @@ -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//" args: warn: false register: prometheus_varnish_exporter_latest_version run_once: true -- name: 'prometheus | varnish exporter | download' +- name: 'varnish exporter | download' 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 dest: /tmp -- name: 'prometheus | varnish exporter | unarchive' +- name: 'varnish exporter | unarchive' unarchive: remote_src: yes src: /tmp/prometheus_varnish_exporter-{{ prometheus_varnish_exporter_version|default(prometheus_varnish_exporter_latest_version.stdout) }}.linux-amd64.tar.gz dest: /tmp -- name: 'prometheus | varnish exporter | move to /usr/local/bin' +- name: 'varnish exporter | move to /usr/local/bin' copy: 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 @@ -28,7 +28,7 @@ notify: - 'prometheus | varnish exporter | restart service' -- name: 'prometheus | varnish exporter | install unit file to systemd' +- name: 'varnish exporter | install unit file to systemd' template: src: systemd/prometheus-varnish-exporter.service.j2 dest: /etc/systemd/system/prometheus-varnish-exporter.service @@ -36,7 +36,7 @@ group: root mode: 0600 -- name: 'prometheus | varnish exporter | configure systemd to use service' +- name: 'varnish exporter | configure systemd to use service' systemd: daemon_reload: yes enabled: yes diff --git a/tasks/main.yml b/tasks/main.yml index 9d1ec7a..a00f581 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -1,18 +1,18 @@ --- -- name: 'prometheus | include asserts' +- name: 'include asserts' include_tasks: 'asserts.yml' -- name: 'prometheus | requirements' +- name: 'requirements' include_tasks: 'requirements.yml' ## prometheus server install -- name: 'prometheus | server install' +- name: 'server install' include_tasks: 'server/prometheus.yml' when: - prometheus_server_enable == "true" ## include exporter install -- name: 'prometheus | exporter install' +- name: 'exporters install' vars: service: "{{ item }}" include_tasks: "exporter/{{ item }}.yml" diff --git a/tasks/requirements.yml b/tasks/requirements.yml index 0258232..403fb88 100644 --- a/tasks/requirements.yml +++ b/tasks/requirements.yml @@ -1,14 +1,13 @@ --- -- name: 'prometheus | update APT Cache' +- name: 'requirement | update APT Cache' apt: update_cache: yes cache_valid_time: 3600 -- name: 'prometheus | pre-requirements install' +- name: 'requirement | pre-requirements install' apt: name: - curl - jq state: present tags: ['prometheus'] -