Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add examples, document systemd-networkd and wg-quick #68

Merged
merged 2 commits into from
Oct 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,13 @@ This is enabled by default but can be disabled by setting the `manage_firewall`
parameter to false in the `wireguard::interface` defined resource. You need to
have the `ferm` class in your catalog to use the feature.

This module uses [systemd-networkd](https://www.freedesktop.org/software/systemd/man/systemd-networkd.html).
You need to have a systemd-networkd service resource in your catalog. We recommend
[voxpupuli/systemd](https://github.com/voxpupuli/puppet-systemd#systemd) with
`manage_networkd` set to true.
This module can uses [systemd-networkd](https://www.freedesktop.org/software/systemd/man/systemd-networkd.html) or [wg-quick](https://manpages.debian.org/wg-quick) to
configure tunnels. For the former, you need to have a systemd-networkd
service resource in your catalog. We recommend [voxpupuli/systemd](https://github.com/voxpupuli/puppet-systemd#systemd)
with `manage_networkd` set to true. You do not need to configure your
entire network with `systemd-networkd`, only the tunnels. That said,
`wg-quick` might be better a better match if you do not want to touch
`systemd`.

Furthermore, this module assumes that you've a dualstack machine. Your IPv4 and
IPv6 addresses will be automatically set to the `destination_addresses` array
Expand Down Expand Up @@ -80,6 +83,8 @@ wireguard::interface {'as1234':
}
````

More examples are available in the [REFERENCE.md](./REFERENCE.md) file.

## Parameter reference

All parameters are documented with puppet-strings. You can view the
Expand Down
8 changes: 8 additions & 0 deletions manifests/interface.pp
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,14 @@
# ],
# }
#
# @example create two sides of a session using the public key from the other side
# wireguard::interface { 'wg0':
# source_addresses => ['2003:4f8:c17:4cf::1', '149.9.255.4'],
# public_key => $facts['wireguard_pubkeys']['nodeB'],
# endpoint => 'nodeB.example.com:53668',
# addresses => [{'Address' => '192.168.123.6/30',},{'Address' => 'fe80::beef:1/64'},],
# }
#
define wireguard::interface (
Enum['present', 'absent'] $ensure = 'present',
Wireguard::Peers $peers = [],
Expand Down