Skip to content

Commit

Permalink
Provide hiera integration
Browse files Browse the repository at this point in the history
  • Loading branch information
bahner authored Feb 18, 2022
1 parent 4ac046f commit 62b7da5
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
# @param package_ensure the ensure state of the package
# @param config_directory the path to the wireguard directory
# @param purge_unknown_keys by default Puppet will purge unknown wireguard keys from `$config_directory`
# @param interfaces hash of interfaces to create. Provides hiera integration.
#
# @author Tim Meusel <[email protected]>
#
Expand All @@ -15,6 +16,7 @@
Enum['installed', 'latest', 'absent'] $package_ensure = 'installed',
Stdlib::Absolutepath $config_directory = '/etc/wireguard',
Boolean $purge_unknown_keys = true,
Hash[String[1], Any] $interfaces = {},
) {
if $manage_package {
package { 'wireguard-tools':
Expand All @@ -39,4 +41,10 @@
group => 'systemd-network',
* => $options,
}

$interfaces.each |$interfacename, $interfaceattributes| {
wireguard::interface { $interfacename:
* => $interfaceattributes,
}
}
}

0 comments on commit 62b7da5

Please sign in to comment.