summaryrefslogtreecommitdiff
path: root/manifests/networkd_instance.pp
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2022-01-03 17:22:13 +0100
committerHugo Hörnquist <hugo@lysator.liu.se>2022-01-03 18:19:26 +0100
commit5a71c9c5083c0a30102485f09f2f55c65d988ebf (patch)
tree71f27643650dd214c051706f79ca42b27bfb5498 /manifests/networkd_instance.pp
parentNetwork rewrites. (diff)
downloadnetworking-5a71c9c5083c0a30102485f09f2f55c65d988ebf.tar.gz
networking-5a71c9c5083c0a30102485f09f2f55c65d988ebf.tar.xz
networking
Diffstat (limited to '')
-rw-r--r--manifests/networkd_instance.pp21
1 files changed, 21 insertions, 0 deletions
diff --git a/manifests/networkd_instance.pp b/manifests/networkd_instance.pp
new file mode 100644
index 0000000..4089e75
--- /dev/null
+++ b/manifests/networkd_instance.pp
@@ -0,0 +1,21 @@
+define networking::networkd_instance (
+ Hash[String,Hash] $content,
+ Enum['present','absent'] $ensure = 'present',
+ String $path = $networking::networkd::path,
+ String $filename = $name,
+ Integer $priority = 20,
+ Enum['network', 'netdev', 'link'] $type = 'network',
+ String $real_filename = "${priority}-${filename}.${type}",
+ String $file = "${path}/${real_filename}",
+) {
+
+ include ::networking::networkd
+
+ file { $file:
+ ensure => $ensure,
+ content => epp('networking/unit_file.epp', {
+ data => $content
+ }),
+ notify => if $networking::networkd::notify_ { Exec['reload networkd'] } else { [] },
+ }
+}