2018-12-06 02:59:47 +08:00
|
|
|
---
|
|
|
|
- name: include ceph-container-common
|
|
|
|
include_role:
|
|
|
|
name: ceph-container-common
|
|
|
|
allow_duplicates: false
|
|
|
|
|
|
|
|
- name: make sure the node_exporter service is down
|
|
|
|
service:
|
|
|
|
name: node_exporter
|
|
|
|
state: stopped
|
|
|
|
failed_when: false
|
|
|
|
|
2019-04-08 21:40:25 +08:00
|
|
|
# Make sure we re-create the container
|
|
|
|
- name: remove old node-exporter container
|
|
|
|
command: "{{ container_binary }} rm -f node-exporter"
|
|
|
|
changed_when: false
|
|
|
|
failed_when: false
|
|
|
|
|
|
|
|
- name: start node-exporter container
|
|
|
|
shell: |
|
|
|
|
{{ container_binary }} run --detach --name node-exporter \
|
|
|
|
-v /proc:/host/proc:ro -v /sys:/host/sys:ro \
|
|
|
|
--net=host \
|
|
|
|
{{ node_exporter_container_image }} \
|
|
|
|
'--path.procfs=/host/proc' \
|
|
|
|
'--path.sysfs=/host/sys' \
|
|
|
|
'--no-collector.timex'
|
2018-12-06 02:59:47 +08:00
|
|
|
notify: restart node-exporter service
|
|
|
|
|
|
|
|
- name: ship systemd service
|
2019-04-08 21:40:25 +08:00
|
|
|
template:
|
2018-12-06 02:59:47 +08:00
|
|
|
src: node_exporter.service
|
|
|
|
dest: "/etc/systemd/system/"
|
|
|
|
owner: root
|
|
|
|
group: root
|
|
|
|
mode: 0644
|
|
|
|
notify: restart node-exporter service
|