Skip to content

Commit

Permalink
Added support of ubuntu trusty
Browse files Browse the repository at this point in the history
  • Loading branch information
UnderGreen committed Jul 1, 2016
1 parent 071d478 commit 142ca4c
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 0 deletions.
1 change: 1 addition & 0 deletions meta/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ galaxy_info:
- jessie
- name: Ubuntu
versions:
- trusty
- xenial
galaxy_tags:
- monitoring
12 changes: 12 additions & 0 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,22 @@
owner: root
group: root
mode: 0644
when: ansible_service_mgr == 'systemd'
notify:
- service reenable
- restart node exporter

- name: create init service unit
template:
src: etc/init/prometheus-node-exporter.conf.j2
dest: /etc/init/prometheus-node-exporter.conf
owner: root
group: root
mode: 0644
when: ansible_service_mgr == 'upstart'
notify:
- restart node exporter

- name: ensure prometheus node exporter service is enabled
service:
name: prometheus-node-exporter
Expand Down
14 changes: 14 additions & 0 deletions templates/etc/init/prometheus-node-exporter.conf.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
description "Prometheus Node Exporter"
start on (local-filesystems and net-device-up IFACE!=lo)
stop on runlevel [016]

respawn
setuid root
setgid {{ prometheus_exporters_common_group }}

script
exec >> "{{ prometheus_exporters_common_log_dir }}/node-exporter.log"
exec 2>&1
exec {{ prometheus_exporters_common_root_dir }}/node_exporter_current/node_exporter -collectors.enabled={{ prometheus_node_exporter_enabled_collectors | join(',') }} {% for flag, flag_value in prometheus_node_exporter_config_flags.iteritems() %}-{{ flag }}={{ flag_value }} {% endfor %}

end script

0 comments on commit 142ca4c

Please sign in to comment.