From cdf2b4afd31b10df695985d7bdd3a587534feb92 Mon Sep 17 00:00:00 2001 From: binary Date: Thu, 11 Mar 2021 16:01:06 +0100 Subject: Use ansible distribution instead of in-house solution. --- roles/prometheus/tasks/main.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'roles') diff --git a/roles/prometheus/tasks/main.yml b/roles/prometheus/tasks/main.yml index ba5095b..e5a01ce 100644 --- a/roles/prometheus/tasks/main.yml +++ b/roles/prometheus/tasks/main.yml @@ -8,7 +8,7 @@ package: name=prometheus state=present - name: install node_exporter - package: name="{{ packages[os_distribution].node_exporter }}" state=present + package: name="{{ packages[ansible_distribution | lower].node_exporter }}" state=present - name: generate prometheus configuration template: @@ -23,8 +23,8 @@ - name: start and enable node_exporter service: name=node_exporter state=restarted enabled=true - when: os_type == "bsd" + when: ansible_distribution in "OpenBSD FreeBSD" - name: start and enable node_exporter service: name=node-exporter state=restarted enabled=true - when: os_type != "bsd" + when: ansible_distribution not in "OpenBSD FreeBSD" -- cgit v1.2.3