mirror of
https://github.com/prometheus-community/ansible
synced 2024-11-22 11:53:12 +00:00
enhancement(node_exporter): add skip_install variable
This is similar to prometheus_skip_install variable and does what the name says: when set, it won't try to re-download the node exporter binary Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
parent
ba3be35fe7
commit
c1a80960f6
5 changed files with 16 additions and 3 deletions
|
@ -19,6 +19,7 @@ All variables which can be overridden are stored in [defaults/main.yml](defaults
|
||||||
| Name | Default Value | Description |
|
| Name | Default Value | Description |
|
||||||
| -------------- | ------------- | -----------------------------------|
|
| -------------- | ------------- | -----------------------------------|
|
||||||
| `node_exporter_version` | 1.1.2 | Node exporter package version. Also accepts `latest` as parameter. |
|
| `node_exporter_version` | 1.1.2 | Node exporter package version. Also accepts `latest` as parameter. |
|
||||||
|
| `node_exporter_skip_install` | false | Node exporter installation tasks gets skipped when set to true. |
|
||||||
| `node_exporter_binary_local_dir` | "" | Enables the use of local packages instead of those distributed on github. The parameter may be set to a directory where the `node_exporter` binary is stored on the host where ansible is run. This overrides the `node_exporter_version` parameter |
|
| `node_exporter_binary_local_dir` | "" | Enables the use of local packages instead of those distributed on github. The parameter may be set to a directory where the `node_exporter` binary is stored on the host where ansible is run. This overrides the `node_exporter_version` parameter |
|
||||||
| `node_exporter_binary_url` | `https://github.com/prometheus/node_exporter/releases/download/v{{ node_exporter_version }}/node_exporter-{{ node_exporter_version }}.linux-{{ go_arch }}.tar.gz` | URL of the node exporter binaries .tar.gz file |
|
| `node_exporter_binary_url` | `https://github.com/prometheus/node_exporter/releases/download/v{{ node_exporter_version }}/node_exporter-{{ node_exporter_version }}.linux-{{ go_arch }}.tar.gz` | URL of the node exporter binaries .tar.gz file |
|
||||||
| `node_exporter_checksums_url` | `https://github.com/prometheus/node_exporter/releases/download/v{{ node_exporter_version }}/sha256sums.txt` | URL of the node exporter checksums file |
|
| `node_exporter_checksums_url` | `https://github.com/prometheus/node_exporter/releases/download/v{{ node_exporter_version }}/sha256sums.txt` | URL of the node exporter checksums file |
|
||||||
|
|
|
@ -4,6 +4,7 @@ node_exporter_binary_local_dir: ""
|
||||||
node_exporter_binary_url: "https://github.com/{{ _node_exporter_repo }}/releases/download/v{{ node_exporter_version }}/\
|
node_exporter_binary_url: "https://github.com/{{ _node_exporter_repo }}/releases/download/v{{ node_exporter_version }}/\
|
||||||
node_exporter-{{ node_exporter_version }}.linux-{{ go_arch }}.tar.gz"
|
node_exporter-{{ node_exporter_version }}.linux-{{ go_arch }}.tar.gz"
|
||||||
node_exporter_checksums_url: "https://github.com/{{ _node_exporter_repo }}/releases/download/v{{ node_exporter_version }}/sha256sums.txt"
|
node_exporter_checksums_url: "https://github.com/{{ _node_exporter_repo }}/releases/download/v{{ node_exporter_version }}/sha256sums.txt"
|
||||||
|
node_exporter_skip_install: false
|
||||||
|
|
||||||
node_exporter_web_listen_address: "0.0.0.0:9100"
|
node_exporter_web_listen_address: "0.0.0.0:9100"
|
||||||
node_exporter_web_telemetry_path: "/metrics"
|
node_exporter_web_telemetry_path: "/metrics"
|
||||||
|
|
|
@ -11,6 +11,10 @@ argument_specs:
|
||||||
node_exporter_version:
|
node_exporter_version:
|
||||||
description: "Node exporter package version. Also accepts latest as parameter."
|
description: "Node exporter package version. Also accepts latest as parameter."
|
||||||
default: "1.1.2"
|
default: "1.1.2"
|
||||||
|
node_exporter_skip_install:
|
||||||
|
description: "Node exporter installation tasks gets skipped when set to true."
|
||||||
|
type: bool
|
||||||
|
default: false
|
||||||
node_exporter_binary_local_dir:
|
node_exporter_binary_local_dir:
|
||||||
description:
|
description:
|
||||||
- "Enables the use of local packages instead of those distributed on github."
|
- "Enables the use of local packages instead of those distributed on github."
|
||||||
|
|
|
@ -18,7 +18,9 @@
|
||||||
when: node_exporter_system_user != "root"
|
when: node_exporter_system_user != "root"
|
||||||
|
|
||||||
- name: Discover latest version
|
- name: Discover latest version
|
||||||
when: node_exporter_binary_local_dir | length == 0
|
when:
|
||||||
|
- node_exporter_binary_local_dir | length == 0
|
||||||
|
- not node_exporter_skip_install
|
||||||
block:
|
block:
|
||||||
|
|
||||||
- name: Download node_exporter binary to local folder
|
- name: Download node_exporter binary to local folder
|
||||||
|
@ -61,5 +63,7 @@
|
||||||
mode: 0755
|
mode: 0755
|
||||||
owner: root
|
owner: root
|
||||||
group: root
|
group: root
|
||||||
when: node_exporter_binary_local_dir | length > 0
|
when:
|
||||||
|
- node_exporter_binary_local_dir | length > 0
|
||||||
|
- not node_exporter_skip_install
|
||||||
notify: restart node_exporter
|
notify: restart node_exporter
|
||||||
|
|
|
@ -82,9 +82,12 @@
|
||||||
when:
|
when:
|
||||||
- node_exporter_version == "latest"
|
- node_exporter_version == "latest"
|
||||||
- node_exporter_binary_local_dir | length == 0
|
- node_exporter_binary_local_dir | length == 0
|
||||||
|
- not node_exporter_skip_install
|
||||||
|
|
||||||
- name: Get node_exporter binary checksum
|
- name: Get node_exporter binary checksum
|
||||||
when: node_exporter_binary_local_dir | length == 0
|
when:
|
||||||
|
- node_exporter_binary_local_dir | length == 0
|
||||||
|
- not node_exporter_skip_install
|
||||||
block:
|
block:
|
||||||
- name: Get checksum list from github
|
- name: Get checksum list from github
|
||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
|
|
Loading…
Reference in a new issue