Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

apache_exporter_version: 0.5.0

# Must we perform download and propagation from localhost (true) or not (false)
apache_exporter_download_localhost: true

apache_exporter_system_group: apache-exp
apache_exporter_system_user: "{{ apache_exporter_system_group }}"

Expand Down
8 changes: 5 additions & 3 deletions tasks/install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,12 @@
get_url:
url: "{{ apache_exporter_download_url }}"
dest: "/tmp/apache_exporter-{{ apache_exporter_version }}.linux-{{ go_arch }}.tar.gz"
become: "{{ false if not apache_exporter_download_localhost is defined else omit }}"
register: __download_binary
until: __download_binary is succeeded
retries: 5
delay: 2
delegate_to: localhost
delegate_to: "{{ 'localhost' if apache_exporter_download_localhost else inventory_hostname }}"
check_mode: false
become: false

Expand All @@ -32,8 +33,8 @@
src: "/tmp/apache_exporter-{{ apache_exporter_version }}.linux-{{ go_arch }}.tar.gz"
dest: "/tmp"
creates: "/tmp/apache_exporter-{{ apache_exporter_version }}.linux-{{ go_arch }}/apache_exporter"
delegate_to: localhost
check_mode: false
delegate_to: "{{ 'localhost' if apache_exporter_download_localhost else inventory_hostname }}"
become: "{{ false if not apache_exporter_download_localhost else omit }}"
become: false

- name: Create local bin dir
Expand All @@ -49,4 +50,5 @@
mode: 0750
owner: "{{ apache_exporter_system_user }}"
group: "{{ apache_exporter_system_group }}"
remote_src: "{{ false if apache_exporter_download_localhost else true }}"
notify: restart apache_exporter