diff options
Diffstat (limited to 'roles/prometheus/tasks/main.yml')
| -rw-r--r-- | roles/prometheus/tasks/main.yml | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/roles/prometheus/tasks/main.yml b/roles/prometheus/tasks/main.yml index 9feeacaf..7b713581 100644 --- a/roles/prometheus/tasks/main.yml +++ b/roles/prometheus/tasks/main.yml @@ -44,6 +44,26 @@ mode: "0644" notify: "Restart prometheus" +# NOTE: show systemd configurations using: systemctl cat prometheus +- name: "Configure prometheus port via environment file" + become: true + ansible.builtin.copy: + content: | + PROMETHEUS_ARGS="--web.listen-address=0.0.0.0:{{ prometheus_port }}" + dest: "/etc/conf.d/prometheus" + mode: "0644" + notify: "Restart prometheus" + +# NOTE: show systemd configurations using: systemctl cat prometheus-node-exporter +- name: "Configure node-exporter port via environment file" + become: true + ansible.builtin.copy: + content: | + NODE_EXPORTER_ARGS="--web.listen-address=:{{ prometheus_node_exporter_port }}" + dest: "/etc/conf.d/prometheus-node-exporter" + mode: "0644" + notify: "Restart node-exporter" + - name: "Start and enable prometheus services" become: true ansible.builtin.systemd_service: |
