mirror of
https://github.com/prometheus-community/ansible
synced 2024-11-22 03:43:09 +00:00
fix: cleanup unused playbooks now that prepare stages have been merged into one
Signed-off-by: gardar <gardar@users.noreply.github.com>
This commit is contained in:
parent
050c9d3347
commit
1c809bc7fc
19 changed files with 0 additions and 1293 deletions
|
@ -1,33 +0,0 @@
|
|||
---
|
||||
- name: Run localhost preparation
|
||||
hosts: localhost
|
||||
gather_facts: false
|
||||
tasks:
|
||||
- name: Download alertmanager binary to local folder
|
||||
become: false
|
||||
ansible.builtin.get_url:
|
||||
url: "https://github.com/prometheus/alertmanager/releases/download/v{{ alertmanager_version\
|
||||
\ }}/alertmanager-{{ alertmanager_version }}.linux-amd64.tar.gz"
|
||||
dest: "/tmp/alertmanager-{{ alertmanager_version }}.linux-amd64.tar.gz"
|
||||
mode: 0644
|
||||
register: _download_archive
|
||||
until: _download_archive is succeeded
|
||||
retries: 5
|
||||
delay: 2
|
||||
check_mode: false
|
||||
|
||||
- name: Unpack alertmanager binaries
|
||||
become: false
|
||||
ansible.builtin.unarchive:
|
||||
src: "/tmp/alertmanager-{{ alertmanager_version }}.linux-amd64.tar.gz"
|
||||
dest: "/tmp"
|
||||
creates: "/tmp/alertmanager-{{ alertmanager_version }}.linux-amd64/alertmanager"
|
||||
check_mode: false
|
||||
|
||||
- name: Link to alertmanager binaries directory
|
||||
become: false
|
||||
ansible.builtin.file:
|
||||
src: "/tmp/alertmanager-{{ alertmanager_version }}.linux-amd64"
|
||||
dest: "/tmp/alertmanager-linux-amd64"
|
||||
state: link
|
||||
check_mode: false
|
|
@ -1,80 +0,0 @@
|
|||
---
|
||||
- name: Run local preparation
|
||||
hosts: localhost
|
||||
gather_facts: false
|
||||
tasks:
|
||||
- name: Download bind_exporter binary to local folder
|
||||
become: false
|
||||
ansible.builtin.get_url:
|
||||
url: "https://github.com/prometheus-community/bind_exporter/releases/download/v{{\
|
||||
\ bind_exporter_version }}/bind_exporter-{{ bind_exporter_version\
|
||||
\ }}.linux-{{ go_arch }}.tar.gz"
|
||||
dest: "/tmp/bind_exporter-{{ bind_exporter_version }}.linux-{{ go_arch\
|
||||
\ }}.tar.gz"
|
||||
mode: 0644
|
||||
register: _download_binary
|
||||
until: _download_binary is succeeded
|
||||
retries: 5
|
||||
delay: 2
|
||||
check_mode: false
|
||||
|
||||
- name: Unpack bind_exporter binary
|
||||
become: false
|
||||
ansible.builtin.unarchive:
|
||||
src: "/tmp/bind_exporter-{{ bind_exporter_version }}.linux-{{ go_arch\
|
||||
\ }}.tar.gz"
|
||||
dest: "/tmp"
|
||||
creates: "/tmp/bind_exporter-{{ bind_exporter_version }}.linux-{{ go_arch\
|
||||
\ }}/bind_exporter"
|
||||
check_mode: false
|
||||
|
||||
- name: Link to bind_exporter binaries directory
|
||||
become: false
|
||||
ansible.builtin.file:
|
||||
src: "/tmp/bind_exporter-{{ bind_exporter_version }}.linux-amd64"
|
||||
dest: "/tmp/bind_exporter-linux-amd64"
|
||||
state: link
|
||||
check_mode: false
|
||||
|
||||
- name: Install pyOpenSSL for certificate generation
|
||||
ansible.builtin.pip:
|
||||
name: "pyOpenSSL"
|
||||
|
||||
- name: Create private key
|
||||
community.crypto.openssl_privatekey:
|
||||
path: "/tmp/tls.key"
|
||||
|
||||
- name: Create CSR
|
||||
community.crypto.openssl_csr:
|
||||
path: "/tmp/tls.csr"
|
||||
privatekey_path: "/tmp/tls.key"
|
||||
|
||||
- name: Create certificate
|
||||
community.crypto.x509_certificate:
|
||||
path: "/tmp/tls.cert"
|
||||
csr_path: "/tmp/tls.csr"
|
||||
privatekey_path: "/tmp/tls.key"
|
||||
provider: selfsigned
|
||||
|
||||
- name: Run target preparation
|
||||
hosts: all
|
||||
any_errors_fatal: true
|
||||
tasks:
|
||||
- name: Create bind_exporter cert dir
|
||||
ansible.builtin.file:
|
||||
path: "{{ bind_exporter_tls_server_config.cert_file | dirname }}"
|
||||
state: directory
|
||||
owner: root
|
||||
group: root
|
||||
mode: u+rwX,g+rwX,o=rX
|
||||
|
||||
- name: Copy cert and key
|
||||
ansible.builtin.copy:
|
||||
src: "{{ item.src }}"
|
||||
dest: "{{ item.dest }}"
|
||||
mode: "{{ item.mode | default('0644') }}"
|
||||
loop:
|
||||
- src: "/tmp/tls.cert"
|
||||
dest: "{{ bind_exporter_tls_server_config.cert_file }}"
|
||||
- src: "/tmp/tls.key"
|
||||
dest: "{{ bind_exporter_tls_server_config.key_file }}"
|
|
@ -1,24 +0,0 @@
|
|||
---
|
||||
- name: Run local preparation
|
||||
hosts: localhost
|
||||
gather_facts: false
|
||||
tasks:
|
||||
- name: Download cadvisor binary to local folder
|
||||
become: false
|
||||
ansible.builtin.get_url:
|
||||
url: "https://github.com/google/cadvisor/releases/download/v{{ cadvisor_version }}/cadvisor-v{{ cadvisor_version }}-linux-{{ go_arch }}"
|
||||
dest: "/tmp/cadvisor-v{{ cadvisor_version }}-linux-{{ go_arch }}"
|
||||
mode: 0644
|
||||
register: _download_binary
|
||||
until: _download_binary is succeeded
|
||||
retries: 5
|
||||
delay: 2
|
||||
check_mode: false
|
||||
|
||||
- name: Link to cadvisor binaries directory
|
||||
become: false
|
||||
ansible.builtin.file:
|
||||
src: "/tmp/cadvisor-v{{ cadvisor_version }}-linux-{{ go_arch }}"
|
||||
dest: "/tmp/cadvisor"
|
||||
state: link
|
||||
check_mode: false
|
|
@ -1,79 +0,0 @@
|
|||
---
|
||||
- name: Run local preparation
|
||||
hosts: localhost
|
||||
gather_facts: false
|
||||
tasks:
|
||||
- name: Download chrony_exporter binary to local folder
|
||||
become: false
|
||||
ansible.builtin.get_url:
|
||||
url: "https://github.com/superq/chrony_exporter/releases/download/v{{ chrony_exporter_version\
|
||||
\ }}/chrony_exporter-{{ chrony_exporter_version }}.linux-{{ go_arch }}.tar.gz"
|
||||
dest: "/tmp/chrony_exporter-{{ chrony_exporter_version }}.linux-{{ go_arch\
|
||||
\ }}.tar.gz"
|
||||
mode: 0644
|
||||
register: _download_binary
|
||||
until: _download_binary is succeeded
|
||||
retries: 5
|
||||
delay: 2
|
||||
check_mode: false
|
||||
|
||||
- name: Unpack chrony_exporter binary
|
||||
become: false
|
||||
ansible.builtin.unarchive:
|
||||
src: "/tmp/chrony_exporter-{{ chrony_exporter_version }}.linux-{{ go_arch\
|
||||
\ }}.tar.gz"
|
||||
dest: "/tmp"
|
||||
creates: "/tmp/chrony_exporter-{{ chrony_exporter_version }}.linux-{{ go_arch\
|
||||
\ }}/chrony_exporter"
|
||||
check_mode: false
|
||||
|
||||
- name: Link to chrony_exporter binaries directory
|
||||
become: false
|
||||
ansible.builtin.file:
|
||||
src: "/tmp/chrony_exporter-{{ chrony_exporter_version }}.linux-amd64"
|
||||
dest: "/tmp/chrony_exporter-linux-amd64"
|
||||
state: link
|
||||
check_mode: false
|
||||
|
||||
- name: Install pyOpenSSL for certificate generation
|
||||
ansible.builtin.pip:
|
||||
name: "pyOpenSSL"
|
||||
|
||||
- name: Create private key
|
||||
community.crypto.openssl_privatekey:
|
||||
path: "/tmp/tls.key"
|
||||
|
||||
- name: Create CSR
|
||||
community.crypto.openssl_csr:
|
||||
path: "/tmp/tls.csr"
|
||||
privatekey_path: "/tmp/tls.key"
|
||||
|
||||
- name: Create certificate
|
||||
community.crypto.x509_certificate:
|
||||
path: "/tmp/tls.cert"
|
||||
csr_path: "/tmp/tls.csr"
|
||||
privatekey_path: "/tmp/tls.key"
|
||||
provider: selfsigned
|
||||
|
||||
- name: Run target preparation
|
||||
hosts: all
|
||||
any_errors_fatal: true
|
||||
tasks:
|
||||
- name: Create chrony_exporter cert dir
|
||||
ansible.builtin.file:
|
||||
path: "{{ chrony_exporter_tls_server_config.cert_file | dirname }}"
|
||||
state: directory
|
||||
owner: root
|
||||
group: root
|
||||
mode: u+rwX,g+rwX,o=rX
|
||||
|
||||
- name: Copy cert and key
|
||||
ansible.builtin.copy:
|
||||
src: "{{ item.src }}"
|
||||
dest: "{{ item.dest }}"
|
||||
mode: "{{ item.mode | default('0644') }}"
|
||||
loop:
|
||||
- src: "/tmp/tls.cert"
|
||||
dest: "{{ chrony_exporter_tls_server_config.cert_file }}"
|
||||
- src: "/tmp/tls.key"
|
||||
dest: "{{ chrony_exporter_tls_server_config.key_file }}"
|
|
@ -1,31 +0,0 @@
|
|||
---
|
||||
- name: Run local preparation
|
||||
hosts: localhost
|
||||
gather_facts: false
|
||||
tasks:
|
||||
- name: Download fail2ban_exporter binary to local folder
|
||||
become: false
|
||||
ansible.builtin.get_url:
|
||||
url: "https://gitlab.com/hectorjsmith/fail2ban-prometheus-exporter/-/releases/v{{ fail2ban_exporter_version }}/downloads/\
|
||||
fail2ban_exporter_{{ fail2ban_exporter_version }}_linux_{{ go_arch }}.tar.gz"
|
||||
dest: "/tmp/fail2ban_exporter_{{ fail2ban_exporter_version }}_linux_{{ go_arch }}.tar.gz"
|
||||
mode: 0644
|
||||
register: _download_binary
|
||||
until: _download_binary is succeeded
|
||||
retries: 5
|
||||
delay: 2
|
||||
check_mode: false
|
||||
|
||||
- name: Create local directory for binary
|
||||
ansible.builtin.file:
|
||||
path: "{{ fail2ban_exporter_binary_local_dir }}"
|
||||
state: directory
|
||||
mode: '0755'
|
||||
|
||||
- name: Unpack fail2ban_exporter binary
|
||||
become: false
|
||||
ansible.builtin.unarchive:
|
||||
src: "/tmp/fail2ban_exporter_{{ fail2ban_exporter_version }}_linux_{{ go_arch }}.tar.gz"
|
||||
dest: "{{ fail2ban_exporter_binary_local_dir }}"
|
||||
creates: "{{ fail2ban_exporter_binary_local_dir }}/fail2ban_exporter"
|
||||
check_mode: false
|
|
@ -1,78 +0,0 @@
|
|||
---
|
||||
- name: Run local preparation
|
||||
hosts: localhost
|
||||
gather_facts: false
|
||||
tasks:
|
||||
- name: Download ipmi_exporter binary to local folder
|
||||
become: false
|
||||
ansible.builtin.get_url:
|
||||
url: "https://github.com/prometheus-community/ipmi_exporter/releases/download/v{{\
|
||||
\ ipmi_exporter_version }}/ipmi_exporter-{{ ipmi_exporter_version }}.linux-{{\
|
||||
\ go_arch }}.tar.gz"
|
||||
dest: "/tmp/ipmi_exporter-{{ ipmi_exporter_version }}.linux-{{ go_arch }}.tar.gz"
|
||||
mode: 0644
|
||||
register: _download_binary
|
||||
until: _download_binary is succeeded
|
||||
retries: 5
|
||||
delay: 2
|
||||
check_mode: false
|
||||
|
||||
- name: Unpack ipmi_exporter binary
|
||||
become: false
|
||||
ansible.builtin.unarchive:
|
||||
src: "/tmp/ipmi_exporter-{{ ipmi_exporter_version }}.linux-{{ go_arch }}.tar.gz"
|
||||
dest: "/tmp"
|
||||
creates: "/tmp/ipmi_exporter-{{ ipmi_exporter_version }}.linux-{{ go_arch\
|
||||
\ }}/ipmi_exporter"
|
||||
check_mode: false
|
||||
|
||||
- name: Link to ipmi_exporter binaries directory
|
||||
become: false
|
||||
ansible.builtin.file:
|
||||
src: "/tmp/ipmi_exporter-{{ ipmi_exporter_version }}.linux-amd64"
|
||||
dest: "/tmp/ipmi_exporter-linux-amd64"
|
||||
state: link
|
||||
check_mode: false
|
||||
|
||||
- name: Install pyOpenSSL for certificate generation
|
||||
ansible.builtin.pip:
|
||||
name: "pyOpenSSL"
|
||||
|
||||
- name: Create private key
|
||||
community.crypto.openssl_privatekey:
|
||||
path: "/tmp/tls.key"
|
||||
|
||||
- name: Create CSR
|
||||
community.crypto.openssl_csr:
|
||||
path: "/tmp/tls.csr"
|
||||
privatekey_path: "/tmp/tls.key"
|
||||
|
||||
- name: Create certificate
|
||||
community.crypto.x509_certificate:
|
||||
path: "/tmp/tls.cert"
|
||||
csr_path: "/tmp/tls.csr"
|
||||
privatekey_path: "/tmp/tls.key"
|
||||
provider: selfsigned
|
||||
|
||||
- name: Run target preparation
|
||||
hosts: all
|
||||
any_errors_fatal: true
|
||||
tasks:
|
||||
- name: Create ipmi_exporter cert dir
|
||||
ansible.builtin.file:
|
||||
path: "{{ ipmi_exporter_tls_server_config.cert_file | dirname }}"
|
||||
state: directory
|
||||
owner: root
|
||||
group: root
|
||||
mode: u+rwX,g+rwX,o=rX
|
||||
|
||||
- name: Copy cert and key
|
||||
ansible.builtin.copy:
|
||||
src: "{{ item.src }}"
|
||||
dest: "{{ item.dest }}"
|
||||
mode: "{{ item.mode | default('0644') }}"
|
||||
loop:
|
||||
- src: "/tmp/tls.cert"
|
||||
dest: "{{ ipmi_exporter_tls_server_config.cert_file }}"
|
||||
- src: "/tmp/tls.key"
|
||||
dest: "{{ ipmi_exporter_tls_server_config.key_file }}"
|
|
@ -1,78 +0,0 @@
|
|||
---
|
||||
- name: Run local preparation
|
||||
hosts: localhost
|
||||
gather_facts: false
|
||||
tasks:
|
||||
- name: Download memcached_exporter binary to local folder
|
||||
become: false
|
||||
ansible.builtin.get_url:
|
||||
url: "https://github.com/prometheus/memcached_exporter/releases/download/v{{\
|
||||
\ memcached_exporter_version }}/memcached_exporter-{{ memcached_exporter_version }}.linux-{{\
|
||||
\ go_arch }}.tar.gz"
|
||||
dest: "/tmp/memcached_exporter-{{ memcached_exporter_version }}.linux-{{ go_arch }}.tar.gz"
|
||||
mode: 0644
|
||||
register: _download_binary
|
||||
until: _download_binary is succeeded
|
||||
retries: 5
|
||||
delay: 2
|
||||
check_mode: false
|
||||
|
||||
- name: Unpack memcached_exporter binary
|
||||
become: false
|
||||
ansible.builtin.unarchive:
|
||||
src: "/tmp/memcached_exporter-{{ memcached_exporter_version }}.linux-{{ go_arch }}.tar.gz"
|
||||
dest: "/tmp"
|
||||
creates: "/tmp/memcached_exporter-{{ memcached_exporter_version }}.linux-{{ go_arch\
|
||||
\ }}/memcached_exporter"
|
||||
check_mode: false
|
||||
|
||||
- name: Link to memcached_exporter binaries directory
|
||||
become: false
|
||||
ansible.builtin.file:
|
||||
src: "/tmp/memcached_exporter-{{ memcached_exporter_version }}.linux-amd64"
|
||||
dest: "/tmp/memcached_exporter-linux-amd64"
|
||||
state: link
|
||||
check_mode: false
|
||||
|
||||
- name: Install pyOpenSSL for certificate generation
|
||||
ansible.builtin.pip:
|
||||
name: "pyOpenSSL"
|
||||
|
||||
- name: Create private key
|
||||
community.crypto.openssl_privatekey:
|
||||
path: "/tmp/tls.key"
|
||||
|
||||
- name: Create CSR
|
||||
community.crypto.openssl_csr:
|
||||
path: "/tmp/tls.csr"
|
||||
privatekey_path: "/tmp/tls.key"
|
||||
|
||||
- name: Create certificate
|
||||
community.crypto.x509_certificate:
|
||||
path: "/tmp/tls.cert"
|
||||
csr_path: "/tmp/tls.csr"
|
||||
privatekey_path: "/tmp/tls.key"
|
||||
provider: selfsigned
|
||||
|
||||
- name: Run target preparation
|
||||
hosts: all
|
||||
any_errors_fatal: true
|
||||
tasks:
|
||||
- name: Create memcached_exporter cert dir
|
||||
ansible.builtin.file:
|
||||
path: "{{ memcached_exporter_tls_server_config.cert_file | dirname }}"
|
||||
state: directory
|
||||
owner: root
|
||||
group: root
|
||||
mode: u+rwX,g+rwX,o=rX
|
||||
|
||||
- name: Copy cert and key
|
||||
ansible.builtin.copy:
|
||||
src: "{{ item.src }}"
|
||||
dest: "{{ item.dest }}"
|
||||
mode: "{{ item.mode | default('0644') }}"
|
||||
loop:
|
||||
- src: "/tmp/tls.cert"
|
||||
dest: "{{ memcached_exporter_tls_server_config.cert_file }}"
|
||||
- src: "/tmp/tls.key"
|
||||
dest: "{{ memcached_exporter_tls_server_config.key_file }}"
|
|
@ -1,76 +0,0 @@
|
|||
---
|
||||
- name: Run local preparation
|
||||
hosts: localhost
|
||||
gather_facts: false
|
||||
tasks:
|
||||
- name: Download mongodb_exporter binary to local folder
|
||||
become: false
|
||||
ansible.builtin.get_url:
|
||||
url: "https://github.com/percona/mongodb_exporter/releases/download/v{{ mongodb_exporter_version }}/\
|
||||
mongodb_exporter-{{ mongodb_exporter_version }}.linux-{{ go_arch }}.tar.gz"
|
||||
dest: "/tmp/mongodb_exporter-{{ mongodb_exporter_version }}.linux-{{ go_arch }}.tar.gz"
|
||||
mode: 0644
|
||||
register: _download_binary
|
||||
until: _download_binary is succeeded
|
||||
retries: 5
|
||||
delay: 2
|
||||
check_mode: false
|
||||
|
||||
- name: Unpack mongodb_exporter binary
|
||||
become: false
|
||||
ansible.builtin.unarchive:
|
||||
src: "/tmp/mongodb_exporter-{{ mongodb_exporter_version }}.linux-{{ go_arch }}.tar.gz"
|
||||
dest: "/tmp"
|
||||
creates: "/tmp/mongodb_exporter-{{ mongodb_exporter_version }}.linux-{{ go_arch }}/mongodb_exporter"
|
||||
check_mode: false
|
||||
|
||||
- name: Link to mongodb_exporter binaries directory
|
||||
become: false
|
||||
ansible.builtin.file:
|
||||
src: "/tmp/mongodb_exporter-{{ mongodb_exporter_version }}.linux-{{ go_arch }}"
|
||||
dest: "{{ mongodb_exporter_binary_local_dir }}"
|
||||
state: link
|
||||
check_mode: false
|
||||
|
||||
- name: Install pyOpenSSL for certificate generation
|
||||
ansible.builtin.pip:
|
||||
name: "pyOpenSSL"
|
||||
|
||||
- name: Create private key
|
||||
community.crypto.openssl_privatekey:
|
||||
path: "/tmp/tls.key"
|
||||
|
||||
- name: Create CSR
|
||||
community.crypto.openssl_csr:
|
||||
path: "/tmp/tls.csr"
|
||||
privatekey_path: "/tmp/tls.key"
|
||||
|
||||
- name: Create certificate
|
||||
community.crypto.x509_certificate:
|
||||
path: "/tmp/tls.cert"
|
||||
csr_path: "/tmp/tls.csr"
|
||||
privatekey_path: "/tmp/tls.key"
|
||||
provider: selfsigned
|
||||
|
||||
- name: Run target preparation
|
||||
hosts: all
|
||||
any_errors_fatal: true
|
||||
tasks:
|
||||
- name: Create mongodb_exporter cert dir
|
||||
ansible.builtin.file:
|
||||
path: "{{ mongodb_exporter_tls_server_config.cert_file | dirname }}"
|
||||
state: directory
|
||||
owner: root
|
||||
group: root
|
||||
mode: u+rwX,g+rwX,o=rX
|
||||
|
||||
- name: Copy cert and key
|
||||
ansible.builtin.copy:
|
||||
src: "{{ item.src }}"
|
||||
dest: "{{ item.dest }}"
|
||||
mode: "{{ item.mode | default('0644') }}"
|
||||
loop:
|
||||
- src: "/tmp/tls.cert"
|
||||
dest: "{{ mongodb_exporter_tls_server_config.cert_file }}"
|
||||
- src: "/tmp/tls.key"
|
||||
dest: "{{ mongodb_exporter_tls_server_config.key_file }}"
|
|
@ -1,80 +0,0 @@
|
|||
---
|
||||
- name: Run local preparation
|
||||
hosts: localhost
|
||||
gather_facts: false
|
||||
tasks:
|
||||
- name: Download mysqld_exporter binary to local folder
|
||||
become: false
|
||||
ansible.builtin.get_url:
|
||||
url: "https://github.com/prometheus/mysqld_exporter/releases/download/v{{\
|
||||
\ mysqld_exporter_version }}/mysqld_exporter-{{ mysqld_exporter_version\
|
||||
\ }}.linux-{{ go_arch }}.tar.gz"
|
||||
dest: "/tmp/mysqld_exporter-{{ mysqld_exporter_version }}.linux-{{ go_arch\
|
||||
\ }}.tar.gz"
|
||||
mode: 0644
|
||||
register: _download_binary
|
||||
until: _download_binary is succeeded
|
||||
retries: 5
|
||||
delay: 2
|
||||
check_mode: false
|
||||
|
||||
- name: Unpack mysqld_exporter binary
|
||||
become: false
|
||||
ansible.builtin.unarchive:
|
||||
src: "/tmp/mysqld_exporter-{{ mysqld_exporter_version }}.linux-{{ go_arch\
|
||||
\ }}.tar.gz"
|
||||
dest: "/tmp"
|
||||
creates: "/tmp/mysqld_exporter-{{ mysqld_exporter_version }}.linux-{{ go_arch\
|
||||
\ }}/mysqld_exporter"
|
||||
check_mode: false
|
||||
|
||||
- name: Link to mysqld_exporter binaries directory
|
||||
become: false
|
||||
ansible.builtin.file:
|
||||
src: "/tmp/mysqld_exporter-{{ mysqld_exporter_version }}.linux-amd64"
|
||||
dest: "/tmp/mysqld_exporter-linux-amd64"
|
||||
state: link
|
||||
check_mode: false
|
||||
|
||||
- name: Install pyOpenSSL for certificate generation
|
||||
ansible.builtin.pip:
|
||||
name: "pyOpenSSL"
|
||||
|
||||
- name: Create private key
|
||||
community.crypto.openssl_privatekey:
|
||||
path: "/tmp/tls.key"
|
||||
|
||||
- name: Create CSR
|
||||
community.crypto.openssl_csr:
|
||||
path: "/tmp/tls.csr"
|
||||
privatekey_path: "/tmp/tls.key"
|
||||
|
||||
- name: Create certificate
|
||||
community.crypto.x509_certificate:
|
||||
path: "/tmp/tls.cert"
|
||||
csr_path: "/tmp/tls.csr"
|
||||
privatekey_path: "/tmp/tls.key"
|
||||
provider: selfsigned
|
||||
|
||||
- name: Run target preparation
|
||||
hosts: all
|
||||
any_errors_fatal: true
|
||||
tasks:
|
||||
- name: Create mysqld_exporter cert dir
|
||||
ansible.builtin.file:
|
||||
path: "{{ mysqld_exporter_tls_server_config.cert_file | dirname }}"
|
||||
state: directory
|
||||
owner: root
|
||||
group: root
|
||||
mode: u+rwX,g+rwX,o=rX
|
||||
|
||||
- name: Copy cert and key
|
||||
ansible.builtin.copy:
|
||||
src: "{{ item.src }}"
|
||||
dest: "{{ item.dest }}"
|
||||
mode: "{{ item.mode | default('0644') }}"
|
||||
loop:
|
||||
- src: "/tmp/tls.cert"
|
||||
dest: "{{ mysqld_exporter_tls_server_config.cert_file }}"
|
||||
- src: "/tmp/tls.key"
|
||||
dest: "{{ mysqld_exporter_tls_server_config.key_file }}"
|
|
@ -1,74 +0,0 @@
|
|||
---
|
||||
- name: Run local preparation
|
||||
hosts: localhost
|
||||
gather_facts: false
|
||||
tasks:
|
||||
- name: Download nginx_exporter binary to local folder
|
||||
become: false
|
||||
ansible.builtin.get_url:
|
||||
url: "https://github.com/nginxinc/nginx-prometheus-exporter/releases/download/v{{ nginx_exporter_version }}/\
|
||||
nginx-prometheus-exporter_{{ nginx_exporter_version }}_linux_{{ go_arch }}.tar.gz"
|
||||
dest: "/tmp/nginx-prometheus-exporter_{{ nginx_exporter_version }}_linux_{{ go_arch }}.tar.gz"
|
||||
mode: 0644
|
||||
register: _download_binary
|
||||
until: _download_binary is succeeded
|
||||
retries: 5
|
||||
delay: 2
|
||||
check_mode: false
|
||||
|
||||
- name: Create local directory for binary
|
||||
ansible.builtin.file:
|
||||
path: "{{ nginx_exporter_binary_local_dir }}"
|
||||
state: directory
|
||||
mode: '0755'
|
||||
|
||||
- name: Unpack nginx_exporter binary
|
||||
become: false
|
||||
ansible.builtin.unarchive:
|
||||
src: "/tmp/nginx-prometheus-exporter_{{ nginx_exporter_version }}_linux_{{ go_arch }}.tar.gz"
|
||||
dest: "{{ nginx_exporter_binary_local_dir }}"
|
||||
creates: "{{ nginx_exporter_binary_local_dir }}/nginx-prometheus-exporter"
|
||||
check_mode: false
|
||||
|
||||
- name: Install pyOpenSSL for certificate generation
|
||||
ansible.builtin.pip:
|
||||
name: "pyOpenSSL"
|
||||
|
||||
- name: Create private key
|
||||
community.crypto.openssl_privatekey:
|
||||
path: "/tmp/tls.key"
|
||||
|
||||
- name: Create CSR
|
||||
community.crypto.openssl_csr:
|
||||
path: "/tmp/tls.csr"
|
||||
privatekey_path: "/tmp/tls.key"
|
||||
|
||||
- name: Create certificate
|
||||
community.crypto.x509_certificate:
|
||||
path: "/tmp/tls.cert"
|
||||
csr_path: "/tmp/tls.csr"
|
||||
privatekey_path: "/tmp/tls.key"
|
||||
provider: selfsigned
|
||||
|
||||
- name: Run target preparation
|
||||
hosts: all
|
||||
any_errors_fatal: true
|
||||
tasks:
|
||||
- name: Create nginx_exporter cert dir
|
||||
ansible.builtin.file:
|
||||
path: "{{ nginx_exporter_tls_server_config.cert_file | dirname }}"
|
||||
state: directory
|
||||
owner: root
|
||||
group: root
|
||||
mode: u+rwX,g+rwX,o=rX
|
||||
|
||||
- name: Copy cert and key
|
||||
ansible.builtin.copy:
|
||||
src: "{{ item.src }}"
|
||||
dest: "{{ item.dest }}"
|
||||
mode: "{{ item.mode | default('0644') }}"
|
||||
loop:
|
||||
- src: "/tmp/tls.cert"
|
||||
dest: "{{ nginx_exporter_tls_server_config.cert_file }}"
|
||||
- src: "/tmp/tls.key"
|
||||
dest: "{{ nginx_exporter_tls_server_config.key_file }}"
|
|
@ -1,78 +0,0 @@
|
|||
---
|
||||
- name: Run local preparation
|
||||
hosts: localhost
|
||||
gather_facts: false
|
||||
tasks:
|
||||
- name: Download node_exporter binary to local folder
|
||||
become: false
|
||||
ansible.builtin.get_url:
|
||||
url: "https://github.com/prometheus/node_exporter/releases/download/v{{\
|
||||
\ node_exporter_version }}/node_exporter-{{ node_exporter_version }}.linux-{{\
|
||||
\ go_arch }}.tar.gz"
|
||||
dest: "/tmp/node_exporter-{{ node_exporter_version }}.linux-{{ go_arch }}.tar.gz"
|
||||
mode: 0644
|
||||
register: _download_binary
|
||||
until: _download_binary is succeeded
|
||||
retries: 5
|
||||
delay: 2
|
||||
check_mode: false
|
||||
|
||||
- name: Unpack node_exporter binary
|
||||
become: false
|
||||
ansible.builtin.unarchive:
|
||||
src: "/tmp/node_exporter-{{ node_exporter_version }}.linux-{{ go_arch }}.tar.gz"
|
||||
dest: "/tmp"
|
||||
creates: "/tmp/node_exporter-{{ node_exporter_version }}.linux-{{ go_arch\
|
||||
\ }}/node_exporter"
|
||||
check_mode: false
|
||||
|
||||
- name: Link to node_exporter binaries directory
|
||||
become: false
|
||||
ansible.builtin.file:
|
||||
src: "/tmp/node_exporter-{{ node_exporter_version }}.linux-amd64"
|
||||
dest: "/tmp/node_exporter-linux-amd64"
|
||||
state: link
|
||||
check_mode: false
|
||||
|
||||
- name: Install pyOpenSSL for certificate generation
|
||||
ansible.builtin.pip:
|
||||
name: "pyOpenSSL"
|
||||
|
||||
- name: Create private key
|
||||
community.crypto.openssl_privatekey:
|
||||
path: "/tmp/tls.key"
|
||||
|
||||
- name: Create CSR
|
||||
community.crypto.openssl_csr:
|
||||
path: "/tmp/tls.csr"
|
||||
privatekey_path: "/tmp/tls.key"
|
||||
|
||||
- name: Create certificate
|
||||
community.crypto.x509_certificate:
|
||||
path: "/tmp/tls.cert"
|
||||
csr_path: "/tmp/tls.csr"
|
||||
privatekey_path: "/tmp/tls.key"
|
||||
provider: selfsigned
|
||||
|
||||
- name: Run target preparation
|
||||
hosts: all
|
||||
any_errors_fatal: true
|
||||
tasks:
|
||||
- name: Create node_exporter cert dir
|
||||
ansible.builtin.file:
|
||||
path: "{{ node_exporter_tls_server_config.cert_file | dirname }}"
|
||||
state: directory
|
||||
owner: root
|
||||
group: root
|
||||
mode: u+rwX,g+rwX,o=rX
|
||||
|
||||
- name: Copy cert and key
|
||||
ansible.builtin.copy:
|
||||
src: "{{ item.src }}"
|
||||
dest: "{{ item.dest }}"
|
||||
mode: "{{ item.mode | default('0644') }}"
|
||||
loop:
|
||||
- src: "/tmp/tls.cert"
|
||||
dest: "{{ node_exporter_tls_server_config.cert_file }}"
|
||||
- src: "/tmp/tls.key"
|
||||
dest: "{{ node_exporter_tls_server_config.key_file }}"
|
|
@ -1,80 +0,0 @@
|
|||
---
|
||||
- name: Run local preparation
|
||||
hosts: localhost
|
||||
gather_facts: false
|
||||
tasks:
|
||||
- name: Download postgres_exporter binary to local folder
|
||||
become: false
|
||||
ansible.builtin.get_url:
|
||||
url: "https://github.com/prometheus-community/postgres_exporter/releases/download/v{{\
|
||||
\ postgres_exporter_version }}/postgres_exporter-{{ postgres_exporter_version\
|
||||
\ }}.linux-{{ go_arch }}.tar.gz"
|
||||
dest: "/tmp/postgres_exporter-{{ postgres_exporter_version }}.linux-{{ go_arch\
|
||||
\ }}.tar.gz"
|
||||
mode: 0644
|
||||
register: _download_binary
|
||||
until: _download_binary is succeeded
|
||||
retries: 5
|
||||
delay: 2
|
||||
check_mode: false
|
||||
|
||||
- name: Unpack postgres_exporter binary
|
||||
become: false
|
||||
ansible.builtin.unarchive:
|
||||
src: "/tmp/postgres_exporter-{{ postgres_exporter_version }}.linux-{{ go_arch\
|
||||
\ }}.tar.gz"
|
||||
dest: "/tmp"
|
||||
creates: "/tmp/postgres_exporter-{{ postgres_exporter_version }}.linux-{{ go_arch\
|
||||
\ }}/postgres_exporter"
|
||||
check_mode: false
|
||||
|
||||
- name: Link to postgres_exporter binaries directory
|
||||
become: false
|
||||
ansible.builtin.file:
|
||||
src: "/tmp/postgres_exporter-{{ postgres_exporter_version }}.linux-amd64"
|
||||
dest: "/tmp/postgres_exporter-linux-amd64"
|
||||
state: link
|
||||
check_mode: false
|
||||
|
||||
- name: Install pyOpenSSL for certificate generation
|
||||
ansible.builtin.pip:
|
||||
name: "pyOpenSSL"
|
||||
|
||||
- name: Create private key
|
||||
community.crypto.openssl_privatekey:
|
||||
path: "/tmp/tls.key"
|
||||
|
||||
- name: Create CSR
|
||||
community.crypto.openssl_csr:
|
||||
path: "/tmp/tls.csr"
|
||||
privatekey_path: "/tmp/tls.key"
|
||||
|
||||
- name: Create certificate
|
||||
community.crypto.x509_certificate:
|
||||
path: "/tmp/tls.cert"
|
||||
csr_path: "/tmp/tls.csr"
|
||||
privatekey_path: "/tmp/tls.key"
|
||||
provider: selfsigned
|
||||
|
||||
- name: Run target preparation
|
||||
hosts: all
|
||||
any_errors_fatal: true
|
||||
tasks:
|
||||
- name: Create postgres_exporter cert dir
|
||||
ansible.builtin.file:
|
||||
path: "{{ postgres_exporter_tls_server_config.cert_file | dirname }}"
|
||||
state: directory
|
||||
owner: root
|
||||
group: root
|
||||
mode: u+rwX,g+rwX,o=rX
|
||||
|
||||
- name: Copy cert and key
|
||||
ansible.builtin.copy:
|
||||
src: "{{ item.src }}"
|
||||
dest: "{{ item.dest }}"
|
||||
mode: "{{ item.mode | default('0644') }}"
|
||||
loop:
|
||||
- src: "/tmp/tls.cert"
|
||||
dest: "{{ postgres_exporter_tls_server_config.cert_file }}"
|
||||
- src: "/tmp/tls.key"
|
||||
dest: "{{ postgres_exporter_tls_server_config.key_file }}"
|
|
@ -1,77 +0,0 @@
|
|||
---
|
||||
- name: Run local preparation
|
||||
hosts: localhost
|
||||
gather_facts: false
|
||||
tasks:
|
||||
- name: Download process_exporter binary to local folder
|
||||
become: false
|
||||
ansible.builtin.get_url:
|
||||
url: "https://github.com/ncabatoff/process-exporter/releases/download/v{{\
|
||||
\ process_exporter_version }}/process-exporter-{{ process_exporter_version }}.linux-{{\
|
||||
\ go_arch }}.tar.gz"
|
||||
dest: "/tmp/process_exporter-{{ process_exporter_version }}.linux-{{ go_arch }}.tar.gz"
|
||||
mode: 0644
|
||||
register: _download_binary
|
||||
until: _download_binary is succeeded
|
||||
retries: 5
|
||||
delay: 2
|
||||
check_mode: false
|
||||
|
||||
- name: Unpack process_exporter binary
|
||||
become: false
|
||||
ansible.builtin.unarchive:
|
||||
src: "/tmp/process_exporter-{{ process_exporter_version }}.linux-{{ go_arch }}.tar.gz"
|
||||
dest: "/tmp"
|
||||
creates: "/tmp/process-exporter-{{ process_exporter_version }}.linux-{{ go_arch }}/process-exporter"
|
||||
check_mode: false
|
||||
|
||||
- name: Link to process_exporter binaries directory
|
||||
become: false
|
||||
ansible.builtin.file:
|
||||
src: "/tmp/process-exporter-{{ process_exporter_version }}.linux-amd64"
|
||||
dest: "/tmp/process_exporter-linux-amd64"
|
||||
state: link
|
||||
check_mode: false
|
||||
|
||||
- name: Install pyOpenSSL for certificate generation
|
||||
ansible.builtin.pip:
|
||||
name: "pyOpenSSL"
|
||||
|
||||
- name: Create private key
|
||||
community.crypto.openssl_privatekey:
|
||||
path: "/tmp/tls.key"
|
||||
|
||||
- name: Create CSR
|
||||
community.crypto.openssl_csr:
|
||||
path: "/tmp/tls.csr"
|
||||
privatekey_path: "/tmp/tls.key"
|
||||
|
||||
- name: Create certificate
|
||||
community.crypto.x509_certificate:
|
||||
path: "/tmp/tls.cert"
|
||||
csr_path: "/tmp/tls.csr"
|
||||
privatekey_path: "/tmp/tls.key"
|
||||
provider: selfsigned
|
||||
|
||||
- name: Run target preparation
|
||||
hosts: all
|
||||
any_errors_fatal: true
|
||||
tasks:
|
||||
- name: Create process_exporter cert dir
|
||||
ansible.builtin.file:
|
||||
path: "{{ process_exporter_tls_server_config.cert_file | dirname }}"
|
||||
state: directory
|
||||
owner: root
|
||||
group: root
|
||||
mode: u+rwX,g+rwX,o=rX
|
||||
|
||||
- name: Copy cert and key
|
||||
ansible.builtin.copy:
|
||||
src: "{{ item.src }}"
|
||||
dest: "{{ item.dest }}"
|
||||
mode: "{{ item.mode | default('0644') }}"
|
||||
loop:
|
||||
- src: "/tmp/tls.cert"
|
||||
dest: "{{ process_exporter_tls_server_config.cert_file }}"
|
||||
- src: "/tmp/tls.key"
|
||||
dest: "{{ process_exporter_tls_server_config.key_file }}"
|
|
@ -1,33 +0,0 @@
|
|||
---
|
||||
- name: Run local preparation
|
||||
hosts: localhost
|
||||
gather_facts: false
|
||||
tasks:
|
||||
- name: Download prometheus binary to local folder
|
||||
become: false
|
||||
ansible.builtin.get_url:
|
||||
url: "https://github.com/prometheus/prometheus/releases/download/v{{ prometheus_version\
|
||||
\ }}/prometheus-{{ prometheus_version }}.linux-amd64.tar.gz"
|
||||
dest: "/tmp/prometheus-{{ prometheus_version }}.linux-amd64.tar.gz"
|
||||
mode: 0644
|
||||
register: _download_archive
|
||||
until: _download_archive is succeeded
|
||||
retries: 5
|
||||
delay: 2
|
||||
check_mode: false
|
||||
|
||||
- name: Unpack prometheus binaries
|
||||
become: false
|
||||
ansible.builtin.unarchive:
|
||||
src: "/tmp/prometheus-{{ prometheus_version }}.linux-amd64.tar.gz"
|
||||
dest: "/tmp"
|
||||
creates: "/tmp/prometheus-{{ prometheus_version }}.linux-amd64/prometheus"
|
||||
check_mode: false
|
||||
|
||||
- name: Link to prometheus binaries directory
|
||||
become: false
|
||||
ansible.builtin.file:
|
||||
src: "/tmp/prometheus-{{ prometheus_version }}.linux-amd64"
|
||||
dest: "/tmp/prometheus-linux-amd64"
|
||||
state: link
|
||||
check_mode: false
|
|
@ -1,76 +0,0 @@
|
|||
---
|
||||
- name: Run localhost preparation
|
||||
hosts: localhost
|
||||
gather_facts: false
|
||||
tasks:
|
||||
- name: Download pushgateway binary to local folder
|
||||
become: false
|
||||
ansible.builtin.get_url:
|
||||
url: "https://github.com/prometheus/pushgateway/releases/download/v{{ pushgateway_version\
|
||||
\ }}/pushgateway-{{ pushgateway_version }}.linux-{{ go_arch }}.tar.gz"
|
||||
dest: "/tmp/pushgateway-{{ pushgateway_version }}.linux-{{ go_arch }}.tar.gz"
|
||||
mode: 0644
|
||||
register: _download_binary
|
||||
until: _download_binary is succeeded
|
||||
retries: 5
|
||||
delay: 2
|
||||
check_mode: false
|
||||
|
||||
- name: Unpack pushgateway binary
|
||||
become: false
|
||||
ansible.builtin.unarchive:
|
||||
src: "/tmp/pushgateway-{{ pushgateway_version }}.linux-{{ go_arch }}.tar.gz"
|
||||
dest: "/tmp"
|
||||
creates: "/tmp/pushgateway-{{ pushgateway_version }}.linux-{{ go_arch }}/pushgateway"
|
||||
check_mode: false
|
||||
|
||||
- name: Link to pushgateway binaries directory
|
||||
become: false
|
||||
ansible.builtin.file:
|
||||
src: "/tmp/pushgateway-{{ pushgateway_version }}.linux-amd64"
|
||||
dest: "/tmp/pushgateway-linux-amd64"
|
||||
state: link
|
||||
check_mode: false
|
||||
|
||||
- name: Install pyOpenSSL for certificate generation
|
||||
ansible.builtin.pip:
|
||||
name: "pyOpenSSL"
|
||||
|
||||
- name: Create private key
|
||||
community.crypto.openssl_privatekey:
|
||||
path: "/tmp/tls.key"
|
||||
|
||||
- name: Create CSR
|
||||
community.crypto.openssl_csr:
|
||||
path: "/tmp/tls.csr"
|
||||
privatekey_path: "/tmp/tls.key"
|
||||
|
||||
- name: Create certificate
|
||||
community.crypto.x509_certificate:
|
||||
path: "/tmp/tls.cert"
|
||||
csr_path: "/tmp/tls.csr"
|
||||
privatekey_path: "/tmp/tls.key"
|
||||
provider: selfsigned
|
||||
|
||||
- name: Run target preparation
|
||||
hosts: all
|
||||
any_errors_fatal: true
|
||||
tasks:
|
||||
- name: Create pushgateway cert dir
|
||||
ansible.builtin.file:
|
||||
path: "{{ pushgateway_tls_server_config.cert_file | dirname }}"
|
||||
state: directory
|
||||
owner: root
|
||||
group: root
|
||||
mode: u+rwX,g+rwX,o=rX
|
||||
|
||||
- name: Copy cert and key
|
||||
ansible.builtin.copy:
|
||||
src: "{{ item.src }}"
|
||||
dest: "{{ item.dest }}"
|
||||
mode: "{{ item.mode | default('0644') }}"
|
||||
loop:
|
||||
- src: "/tmp/tls.cert"
|
||||
dest: "{{ pushgateway_tls_server_config.cert_file }}"
|
||||
- src: "/tmp/tls.key"
|
||||
dest: "{{ pushgateway_tls_server_config.key_file }}"
|
|
@ -1,78 +0,0 @@
|
|||
---
|
||||
- name: Run local preparation
|
||||
hosts: localhost
|
||||
gather_facts: false
|
||||
tasks:
|
||||
- name: Download redis_exporter binary to local folder
|
||||
become: false
|
||||
ansible.builtin.get_url:
|
||||
url: "https://github.com/oliver006/redis_exporter/releases/download/v{{\
|
||||
\ redis_exporter_version }}/redis_exporter-v{{ redis_exporter_version }}.linux-{{\
|
||||
\ go_arch }}.tar.gz"
|
||||
dest: "/tmp/redis_exporter-v{{ redis_exporter_version }}.linux-{{ go_arch }}.tar.gz"
|
||||
mode: 0644
|
||||
register: _download_binary
|
||||
until: _download_binary is succeeded
|
||||
retries: 5
|
||||
delay: 2
|
||||
check_mode: false
|
||||
|
||||
- name: Unpack redis_exporter binary
|
||||
become: false
|
||||
ansible.builtin.unarchive:
|
||||
src: "/tmp/redis_exporter-v{{ redis_exporter_version }}.linux-{{ go_arch }}.tar.gz"
|
||||
dest: "/tmp"
|
||||
creates: "/tmp/redis_exporter-v{{ redis_exporter_version }}.linux-{{ go_arch\
|
||||
\ }}/redis_exporter"
|
||||
check_mode: false
|
||||
|
||||
- name: Link to redis_exporter binaries directory
|
||||
become: false
|
||||
ansible.builtin.file:
|
||||
src: "/tmp/redis_exporter-v{{ redis_exporter_version }}.linux-amd64"
|
||||
dest: "/tmp/redis_exporter-linux-amd64"
|
||||
state: link
|
||||
check_mode: false
|
||||
|
||||
- name: Install pyOpenSSL for certificate generation
|
||||
ansible.builtin.pip:
|
||||
name: "pyOpenSSL"
|
||||
|
||||
- name: Create private key
|
||||
community.crypto.openssl_privatekey:
|
||||
path: "/tmp/tls.key"
|
||||
|
||||
- name: Create CSR
|
||||
community.crypto.openssl_csr:
|
||||
path: "/tmp/tls.csr"
|
||||
privatekey_path: "/tmp/tls.key"
|
||||
|
||||
- name: Create certificate
|
||||
community.crypto.x509_certificate:
|
||||
path: "/tmp/tls.cert"
|
||||
csr_path: "/tmp/tls.csr"
|
||||
privatekey_path: "/tmp/tls.key"
|
||||
provider: selfsigned
|
||||
|
||||
- name: Run target preparation
|
||||
hosts: all
|
||||
any_errors_fatal: true
|
||||
tasks:
|
||||
- name: Create redis_exporter cert dir
|
||||
ansible.builtin.file:
|
||||
path: "{{ redis_exporter_tls_server_cert_file | dirname }}"
|
||||
state: directory
|
||||
owner: root
|
||||
group: root
|
||||
mode: u+rwX,g+rwX,o=rX
|
||||
|
||||
- name: Copy cert and key
|
||||
ansible.builtin.copy:
|
||||
src: "{{ item.src }}"
|
||||
dest: "{{ item.dest }}"
|
||||
mode: "{{ item.mode | default('0644') }}"
|
||||
loop:
|
||||
- src: "/tmp/tls.cert"
|
||||
dest: "{{ redis_exporter_tls_server_cert_file }}"
|
||||
- src: "/tmp/tls.key"
|
||||
dest: "{{ redis_exporter_tls_server_key_file }}"
|
|
@ -1,78 +0,0 @@
|
|||
---
|
||||
- name: Run local preparation
|
||||
hosts: localhost
|
||||
gather_facts: false
|
||||
tasks:
|
||||
- name: Download smartctl_exporter binary to local folder
|
||||
become: false
|
||||
ansible.builtin.get_url:
|
||||
url: "https://github.com/prometheus-community/smartctl_exporter/releases/download/v{{\
|
||||
\ smartctl_exporter_version }}/smartctl_exporter-{{ smartctl_exporter_version }}.linux-{{\
|
||||
\ go_arch }}.tar.gz"
|
||||
dest: "/tmp/smartctl_exporter-{{ smartctl_exporter_version }}.linux-{{ go_arch }}.tar.gz"
|
||||
mode: 0644
|
||||
register: _download_binary
|
||||
until: _download_binary is succeeded
|
||||
retries: 5
|
||||
delay: 2
|
||||
check_mode: false
|
||||
|
||||
- name: Unpack smartctl_exporter binary
|
||||
become: false
|
||||
ansible.builtin.unarchive:
|
||||
src: "/tmp/smartctl_exporter-{{ smartctl_exporter_version }}.linux-{{ go_arch }}.tar.gz"
|
||||
dest: "/tmp"
|
||||
creates: "/tmp/smartctl_exporter-{{ smartctl_exporter_version }}.linux-{{ go_arch\
|
||||
\ }}/smartctl_exporter"
|
||||
check_mode: false
|
||||
|
||||
- name: Link to smartctl_exporter binaries directory
|
||||
become: false
|
||||
ansible.builtin.file:
|
||||
src: "/tmp/smartctl_exporter-{{ smartctl_exporter_version }}.linux-amd64"
|
||||
dest: "/tmp/smartctl_exporter-linux-amd64"
|
||||
state: link
|
||||
check_mode: false
|
||||
|
||||
- name: Install pyOpenSSL for certificate generation
|
||||
ansible.builtin.pip:
|
||||
name: "pyOpenSSL"
|
||||
|
||||
- name: Create private key
|
||||
community.crypto.openssl_privatekey:
|
||||
path: "/tmp/tls.key"
|
||||
|
||||
- name: Create CSR
|
||||
community.crypto.openssl_csr:
|
||||
path: "/tmp/tls.csr"
|
||||
privatekey_path: "/tmp/tls.key"
|
||||
|
||||
- name: Create certificate
|
||||
community.crypto.x509_certificate:
|
||||
path: "/tmp/tls.cert"
|
||||
csr_path: "/tmp/tls.csr"
|
||||
privatekey_path: "/tmp/tls.key"
|
||||
provider: selfsigned
|
||||
|
||||
- name: Run target preparation
|
||||
hosts: all
|
||||
any_errors_fatal: true
|
||||
tasks:
|
||||
- name: Create smartctl_exporter cert dir
|
||||
ansible.builtin.file:
|
||||
path: "{{ smartctl_exporter_tls_server_config.cert_file | dirname }}"
|
||||
state: directory
|
||||
owner: root
|
||||
group: root
|
||||
mode: u+rwX,g+rwX,o=rX
|
||||
|
||||
- name: Copy cert and key
|
||||
ansible.builtin.copy:
|
||||
src: "{{ item.src }}"
|
||||
dest: "{{ item.dest }}"
|
||||
mode: "{{ item.mode | default('0644') }}"
|
||||
loop:
|
||||
- src: "/tmp/tls.cert"
|
||||
dest: "{{ smartctl_exporter_tls_server_config.cert_file }}"
|
||||
- src: "/tmp/tls.key"
|
||||
dest: "{{ smartctl_exporter_tls_server_config.key_file }}"
|
|
@ -1,80 +0,0 @@
|
|||
---
|
||||
- name: Run local preparation
|
||||
hosts: localhost
|
||||
gather_facts: false
|
||||
tasks:
|
||||
- name: Download smokeping_prober binary to local folder
|
||||
become: false
|
||||
ansible.builtin.get_url:
|
||||
url: "https://github.com/superq/smokeping_prober/releases/download/v{{ smokeping_prober_version\
|
||||
\ }}/smokeping_prober-{{ smokeping_prober_version }}.linux-{{ go_arch\
|
||||
\ }}.tar.gz"
|
||||
dest: "/tmp/smokeping_prober-{{ smokeping_prober_version }}.linux-{{ go_arch\
|
||||
\ }}.tar.gz"
|
||||
mode: 0644
|
||||
register: _download_binary
|
||||
until: _download_binary is succeeded
|
||||
retries: 5
|
||||
delay: 2
|
||||
check_mode: false
|
||||
|
||||
- name: Unpack smokeping_prober binary
|
||||
become: false
|
||||
ansible.builtin.unarchive:
|
||||
src: "/tmp/smokeping_prober-{{ smokeping_prober_version }}.linux-{{ go_arch\
|
||||
\ }}.tar.gz"
|
||||
dest: "/tmp"
|
||||
creates: "/tmp/smokeping_prober-{{ smokeping_prober_version }}.linux-{{\
|
||||
\ go_arch }}/smokeping_prober"
|
||||
check_mode: false
|
||||
|
||||
- name: Link to smokeping_prober binaries directory
|
||||
become: false
|
||||
ansible.builtin.file:
|
||||
src: "/tmp/smokeping_prober-{{ smokeping_prober_version }}.linux-amd64"
|
||||
dest: "/tmp/smokeping_prober-linux-amd64"
|
||||
state: link
|
||||
check_mode: false
|
||||
|
||||
- name: Install pyOpenSSL for certificate generation
|
||||
ansible.builtin.pip:
|
||||
name: "pyOpenSSL"
|
||||
|
||||
- name: Create private key
|
||||
community.crypto.openssl_privatekey:
|
||||
path: "/tmp/tls.key"
|
||||
|
||||
- name: Create CSR
|
||||
community.crypto.openssl_csr:
|
||||
path: "/tmp/tls.csr"
|
||||
privatekey_path: "/tmp/tls.key"
|
||||
|
||||
- name: Create certificate
|
||||
community.crypto.x509_certificate:
|
||||
path: "/tmp/tls.cert"
|
||||
csr_path: "/tmp/tls.csr"
|
||||
privatekey_path: "/tmp/tls.key"
|
||||
provider: selfsigned
|
||||
|
||||
- name: Run target preparation
|
||||
hosts: all
|
||||
any_errors_fatal: true
|
||||
tasks:
|
||||
- name: Create smokeping_prober cert dir
|
||||
ansible.builtin.file:
|
||||
path: "{{ smokeping_prober_tls_server_config.cert_file | dirname }}"
|
||||
state: directory
|
||||
owner: root
|
||||
group: root
|
||||
mode: u+rwX,g+rwX,o=rX
|
||||
|
||||
- name: Copy cert and key
|
||||
ansible.builtin.copy:
|
||||
src: "{{ item.src }}"
|
||||
dest: "{{ item.dest }}"
|
||||
mode: "{{ item.mode | default('0644') }}"
|
||||
loop:
|
||||
- src: "/tmp/tls.cert"
|
||||
dest: "{{ smokeping_prober_tls_server_config.cert_file }}"
|
||||
- src: "/tmp/tls.key"
|
||||
dest: "{{ smokeping_prober_tls_server_config.key_file }}"
|
|
@ -1,80 +0,0 @@
|
|||
---
|
||||
- name: Run local preparation
|
||||
hosts: localhost
|
||||
gather_facts: false
|
||||
tasks:
|
||||
- name: Download systemd_exporter binary to local folder
|
||||
become: false
|
||||
ansible.builtin.get_url:
|
||||
url: "https://github.com/prometheus-community/systemd_exporter/releases/download/v{{\
|
||||
\ systemd_exporter_version }}/systemd_exporter-{{ systemd_exporter_version\
|
||||
\ }}.linux-{{ go_arch }}.tar.gz"
|
||||
dest: "/tmp/systemd_exporter-{{ systemd_exporter_version }}.linux-{{ go_arch\
|
||||
\ }}.tar.gz"
|
||||
mode: 0644
|
||||
register: _download_binary
|
||||
until: _download_binary is succeeded
|
||||
retries: 5
|
||||
delay: 2
|
||||
check_mode: false
|
||||
|
||||
- name: Unpack systemd_exporter binary
|
||||
become: false
|
||||
ansible.builtin.unarchive:
|
||||
src: "/tmp/systemd_exporter-{{ systemd_exporter_version }}.linux-{{ go_arch\
|
||||
\ }}.tar.gz"
|
||||
dest: "/tmp"
|
||||
creates: "/tmp/systemd_exporter-{{ systemd_exporter_version }}.linux-{{\
|
||||
\ go_arch }}/systemd_exporter"
|
||||
check_mode: false
|
||||
|
||||
- name: Link to systemd_exporter binaries directory
|
||||
become: false
|
||||
ansible.builtin.file:
|
||||
src: "/tmp/systemd_exporter-{{ systemd_exporter_version }}.linux-amd64"
|
||||
dest: "/tmp/systemd_exporter-linux-amd64"
|
||||
state: link
|
||||
check_mode: false
|
||||
|
||||
- name: Install pyOpenSSL for certificate generation
|
||||
ansible.builtin.pip:
|
||||
name: "pyOpenSSL"
|
||||
|
||||
- name: Create private key
|
||||
community.crypto.openssl_privatekey:
|
||||
path: "/tmp/tls.key"
|
||||
|
||||
- name: Create CSR
|
||||
community.crypto.openssl_csr:
|
||||
path: "/tmp/tls.csr"
|
||||
privatekey_path: "/tmp/tls.key"
|
||||
|
||||
- name: Create certificate
|
||||
community.crypto.x509_certificate:
|
||||
path: "/tmp/tls.cert"
|
||||
csr_path: "/tmp/tls.csr"
|
||||
privatekey_path: "/tmp/tls.key"
|
||||
provider: selfsigned
|
||||
|
||||
- name: Run target preparation
|
||||
hosts: all
|
||||
any_errors_fatal: true
|
||||
tasks:
|
||||
- name: Create systemd_exporter cert dir
|
||||
ansible.builtin.file:
|
||||
path: "{{ systemd_exporter_tls_server_config.cert_file | dirname }}"
|
||||
state: directory
|
||||
owner: root
|
||||
group: root
|
||||
mode: u+rwX,g+rwX,o=rX
|
||||
|
||||
- name: Copy cert and key
|
||||
ansible.builtin.copy:
|
||||
src: "{{ item.src }}"
|
||||
dest: "{{ item.dest }}"
|
||||
mode: "{{ item.mode | default('0644') }}"
|
||||
loop:
|
||||
- src: "/tmp/tls.cert"
|
||||
dest: "{{ systemd_exporter_tls_server_config.cert_file }}"
|
||||
- src: "/tmp/tls.key"
|
||||
dest: "{{ systemd_exporter_tls_server_config.key_file }}"
|
Loading…
Reference in a new issue