diff --git a/prometheus/tasks/main.yml b/prometheus/tasks/main.yml index ce4f8e2c3a41b0b832598f3e9973f243668bd6ee..a5f55c2e2caf06ea9b1c17dffddaa1ac54362292 100644 --- a/prometheus/tasks/main.yml +++ b/prometheus/tasks/main.yml @@ -5,6 +5,16 @@ name: - prometheus state: present + when: ansible_distribution_file_variety == "Debian" + tags: + - prometheus + +- name: Install prometheus + portage: + package: + - app-metrics/prometheus + state: present + when: ansible_distribution == "Gentoo" tags: - prometheus @@ -14,6 +24,18 @@ dest: /etc/default/prometheus notify: - Restart prometheus + when: ansible_distribution_file_variety == "Debian" + tags: + - prometheus + - config + +- name: Configure prometheus command arguments + template: + src: confd-prometheus.j2 + dest: /etc/conf.d/prometheus + notify: + - Restart prometheus + when: ansible_distribution == "Gentoo" tags: - prometheus - config diff --git a/prometheus/templates/confd-prometheus.j2 b/prometheus/templates/confd-prometheus.j2 new file mode 100644 index 0000000000000000000000000000000000000000..b233503c67f0eb2185aa5260cc3d8d27e41e8f41 --- /dev/null +++ b/prometheus/templates/confd-prometheus.j2 @@ -0,0 +1,3 @@ +# arguments for Prometheus +command_args="{{ prometheus_args }}" +supervisor="supervise-daemon"