ceph-node-exporter: use modprobe ansible module

Instead of using the modprobe command from the path in the systemd
unit script, we can use the modprobe ansible module.
That way we don't have to manage the binary path based on the linux
distribution.

Resolves: #4072

Signed-off-by: Dimitri Savineau <dsavinea@redhat.com>
pull/4076/head
Dimitri Savineau 2019-06-11 09:35:28 -04:00 committed by Guillaume Abrioux
parent 069076bbfd
commit dbf81b6b5b
2 changed files with 5 additions and 3 deletions

View File

@ -7,6 +7,11 @@
group: root group: root
mode: 0644 mode: 0644
- name: add the cfg80211 module
modprobe:
name: cfg80211
state: present
- name: start the node_exporter service - name: start the node_exporter service
systemd: systemd:
name: node_exporter name: node_exporter

View File

@ -18,9 +18,6 @@ ExecStart=/usr/bin/{{ container_binary }} run --name=node-exporter \
--path.procfs=/host/proc \ --path.procfs=/host/proc \
--path.sysfs=/host/sys \ --path.sysfs=/host/sys \
--no-collector.timex \ --no-collector.timex \
# Make sure the cfg80211 is loaded before running the container, the node
# exporter needs this module loaded to test for presence of wi-fi devices
ExecStartPre=/usr/sbin/modprobe cfg80211
ExecStop=-/usr/bin/{{ container_binary }} stop node-exporter ExecStop=-/usr/bin/{{ container_binary }} stop node-exporter
Restart=always Restart=always
RestartSec=10s RestartSec=10s