Skip to content

Commit

Permalink
Merge pull request #11 from bastelfreak/optional
Browse files Browse the repository at this point in the history
dont make `$destination_addresses` as optional, remove useless validation
  • Loading branch information
bastelfreak authored Jul 27, 2021
2 parents 1495626 + 0c63cd6 commit ac252b8
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions manifests/interface.pp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
define wireguard::interface (
String[1] $public_key,
String[1] $endpoint,
Optional[Array[Stdlib::IP::Address]] $destination_addresses = [$facts['networking']['ip'], $facts['networking']['ip6'],],
Array[Stdlib::IP::Address] $destination_addresses = [$facts['networking']['ip'], $facts['networking']['ip6'],],
String[1] $interface = $title,
Integer[1024, 65000] $dport = Integer(regsubst($title, '^\D+(\d+)$', '\1')),
String[1] $input_interface = $facts['networking']['primary'],
Expand All @@ -44,8 +44,6 @@
require wireguard
if $manage_firewall {
assert_type(Array[Stdlib::IP::Address], $source_addresses)
assert_type(Array[Stdlib::IP::Address], $destination_addresses)
ferm::rule { "allow_wg_${interface}":
action => 'ACCEPT',
chain => 'INPUT',
Expand Down

0 comments on commit ac252b8

Please sign in to comment.