summaryrefslogtreecommitdiff
path: root/manifests/interface.pp
diff options
context:
space:
mode:
Diffstat (limited to 'manifests/interface.pp')
-rw-r--r--manifests/interface.pp19
1 files changed, 19 insertions, 0 deletions
diff --git a/manifests/interface.pp b/manifests/interface.pp
new file mode 100644
index 0000000..8254359
--- /dev/null
+++ b/manifests/interface.pp
@@ -0,0 +1,19 @@
+define wpa_supplicant::interface (
+ String $interface = $name,
+ Array[Hash] $networks = [],
+) {
+ service { "wpa_supplicant@${interface}.service":
+ ensure => running,
+ enable => true,
+ }
+
+ file { "/etc/wpa_supplicant/wpa_supplicant-${interface}.conf":
+ ensure => file,
+ content => epp('wpa_supplicant/wpa_supplicant.conf.epp', {
+ networks => $networks
+ }),
+ } ~> exec { "Reload wpa_supplicant for ${interface}":
+ command => [ 'wpa_cli', 'reconfigure', '-i', $interface, ],
+ path => [ '/bin', '/usr/bin', ],
+ }
+}