diff options
| author | 2022-02-20 17:09:26 +0100 | |
|---|---|---|
| committer | 2022-02-21 20:19:14 +0100 | |
| commit | 9c809811dfb6b931c30985b78c8573eacbc0a6e3 (patch) | |
| tree | b30e79c398b3f48e643bd56581ecc14d8476e44c /roles/prometheus/tasks | |
| parent | Save host allocation file in the repository (diff) | |
Deploy Prometheus & node-exporter
To start off, we are only scraping Prometheus itself and node-exporter.
Diffstat (limited to 'roles/prometheus/tasks')
| -rw-r--r-- | roles/prometheus/tasks/main.yml | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/roles/prometheus/tasks/main.yml b/roles/prometheus/tasks/main.yml new file mode 100644 index 0000000..08aff38 --- /dev/null +++ b/roles/prometheus/tasks/main.yml @@ -0,0 +1,33 @@ +--- +- name: install prometheus + package: + name: prometheus + state: present + tags: + - role::prometheus + +- name: configure prometheus command line options + lineinfile: + path: /etc/default/prometheus + regexp: ^ARGS.* + line: ARGS="{{ prometheus_cmdline_options }}" + tags: + - role::prometheus + when: + - prometheus_cmdline_options is defined + notify: + - restart the prometheus service + +- name: configure prometheus + copy: + content: | + # Ansible managed + {{ prometheus_configuration | to_nice_yaml }} + dest: /etc/prometheus/prometheus.yml + owner: prometheus + group: prometheus + mode: 0400 + tags: + - role::prometheus + notify: + - reload the prometheus service |