From 377df0b6841bf61f128c8b9098cc1bf6d506a5b7 Mon Sep 17 00:00:00 2001 From: Mitch Riedstra Date: Sat, 28 Sep 2019 21:06:36 -0400 Subject: Update the role, add some more documentation, and a license --- tasks/main.yml | 43 ++++++++----------------------------------- 1 file changed, 8 insertions(+), 35 deletions(-) (limited to 'tasks/main.yml') diff --git a/tasks/main.yml b/tasks/main.yml index 10648a0..3f2c2a4 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -27,7 +27,7 @@ - name: Extract Prometheus shell: | if ! [ -e "{{prometheus_home_dir}}/{{prometheus_extract_dir}}" ] ; then - sudo su - '{{prometheus_user}}' -c 'tar xzf prometheus-{{prometheus_version}}.tgz' + su - '{{prometheus_user}}' -c 'tar xzf prometheus-{{prometheus_version}}.tgz' fi changed_when: false - name: Link prometheus directory @@ -46,40 +46,13 @@ - prometheus.yml - name: Write prometheus template template: - src: prometheus/prometheus.yml + src: '{{prometheus_template_source}}' dest: '{{prometheus_home_dir}}/conf/prometheus.yml' owner: '{{prometheus_user}}' mode: '0600' -- name: Write Systemd Unite - template: - src: prometheus/systemd.unit - dest: /etc/systemd/system/prometheus.service - when: ansible_facts['distribution'].lower() == "ubuntu" -- name: 'Enable Prometheus [Ubuntu]' - systemd: - enabled: yes - daemon_reload: yes - name: prometheus - when: ansible_facts['distribution'].lower() == "ubuntu" -- name: Create Runit Directory - file: - state: directory - dest: /etc/sv.local/prometheus - owner: root - group: adm - mode: '0755' - when: ansible_facts['distribution'].lower() == "void" -- name: Write runit service - template: - src: prometheus/runit/run - dest: /etc/sv.local/prometheus/run - owner: root - group: adm - mode: '0755' - when: ansible_facts['distribution'].lower() == "void" -- name: Enable Runit service - file: - state: link - src: /etc/sv.local/prometheus - dest: /var/service/prometheus - when: ansible_facts['distribution'].lower() == "void" +- name: Run Runit Specific tasks + include_tasks: systemd.yml + when: ansible_facts['distribution'].lower() == "ubuntu" or ansible_facts['distribution'].lower() == "centos" +- name: Run Runit Specific tasks + include_tasks: runit.yml + when: ansible_facts['distribution'].lower() == "void" or ansible_facts['distribution'].lower() == "alpine" -- cgit v1.2.3