diff options
| author | Mitch Riedstra <mitch@riedstra.us> | 2019-09-28 21:06:36 -0400 |
|---|---|---|
| committer | Mitch Riedstra <mitch@riedstra.us> | 2019-09-28 21:06:36 -0400 |
| commit | 377df0b6841bf61f128c8b9098cc1bf6d506a5b7 (patch) | |
| tree | 789bc2d3dc46cf1da0a4c62b8e6f49b1ad7fb83b /tasks/main.yml | |
| parent | 4d82dba8e2ce90364cb899a293c75ba37cbb791f (diff) | |
| download | prometheus-377df0b6841bf61f128c8b9098cc1bf6d506a5b7.tar.gz prometheus-377df0b6841bf61f128c8b9098cc1bf6d506a5b7.tar.xz | |
Update the role, add some more documentation, and a license
Diffstat (limited to 'tasks/main.yml')
| -rw-r--r-- | tasks/main.yml | 43 |
1 files changed, 8 insertions, 35 deletions
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" |
