3
\me$ @ s6 U d Z ddlZddlZddlmZ ddlmZmZ ddlm Z ddl
mZ ddlm
Z
mZ ddlmZ ed Zd
d dedged
gedgdZe
eeZ ejeZedddgZdZdZd,ZedddZedddZee dddZedd d!Z edd"d#Z!e d$d%d&Z"d'd( Z#e$ee edd)d*d+Z%dS )-Z Wireguard N)dedent)subputil)Cloud)Config)
MetaSchemaget_meta_doc)PER_INSTANCEaI Wireguard module provides a dynamic interface for configuring
Wireguard (as a peer or server) in an easy way.
This module takes care of:
- writing interface configuration files
- enabling and starting interfaces
- installing wireguard-tools package
- loading wireguard kernel module
- executing readiness probes
What's a readiness probe?
The idea behind readiness probes is to ensure Wireguard connectivity
before continuing the cloud-init process. This could be useful if you
need access to specific services like an internal APT Repository Server
(e.g Landscape) to install/update packages.
Example:
An edge device can't access the internet but uses cloud-init modules which
will install packages (e.g landscape, packages, ubuntu_advantage). Those
modules will fail due to missing internet connection. The "wireguard" module
fixes that problem as it waits until all readinessprobes (which can be
arbitrary commands - e.g. checking if a proxy server is reachable over
Wireguard network) are finished before continuing the cloud-init
"config" stage.
.. note::
In order to use DNS with Wireguard you have to install ``resolvconf``
package or symlink it to systemd's ``resolvectl``, otherwise ``wg-quick``
commands will throw an error message that executable ``resolvconf`` is
missing which leads wireguard module to fail.
Zcc_wireguardz$Module to configure Wireguard tunnelZubuntu wireguarda # Configure one or more WG interfaces and provide optional readinessprobes
wireguard:
interfaces:
- name: wg0
config_path: /etc/wireguard/wg0.conf
content: |
[Interface]
PrivateKey =