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>
group: root
mode: 0644
+- name: add the cfg80211 module
+ modprobe:
+ name: cfg80211
+ state: present
+
- name: start the node_exporter service
systemd:
name: node_exporter
--path.procfs=/host/proc \
--path.sysfs=/host/sys \
--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
Restart=always
RestartSec=10s