Skip to content

Commit

Permalink
Merge branch 't/190-kernel-module' of gregorydlogan/ansible-role-wire…
Browse files Browse the repository at this point in the history
…guard into master

Pull request githubixx#200
Fixes githubixx#190
  Enable skipping of wg kernel module install
  • Loading branch information
gregorydlogan committed Feb 20, 2024
2 parents a83f07a + 26eb653 commit 46fe5ef
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,12 @@ wireguard_interface_restart: false
# Set to "false" if package cache should not be updated (only relevant if
# the package manager in question supports this option)
wireguard_update_cache: "true"
# Normally the role installs and activates the wireguard kernel module where
# appropriate. In some cases we might not be able load kernel modules, like
# unprivileged LXC guests. If you set this to false you have to ensure
# the wireguard module is available in the kernel!
wireguard_install_kernel_module: true
```

There are also a few Linux distribution specific settings:
Expand Down
6 changes: 6 additions & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,12 @@ wireguard_interface_restart: false
# the package manager in question supports this option)
wireguard_update_cache: "true"

# Normally the role installs and activates the wireguard kernel module where
# appropriate. In some cases we might not be able load kernel modules, like
# unprivileged LXC guests. If you set this to false you have to ensure
# the wireguard module is available in the kernel!
wireguard_install_kernel_module: true

#######################################
# Settings only relevant for:
# - Ubuntu
Expand Down
5 changes: 4 additions & 1 deletion tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,10 @@
failed_when: wireguard__register_module_enabled is failure
tags:
- wg-install
when: not ansible_os_family == 'Darwin'
- wg-install-kernel-module
when:
- not ansible_os_family == 'Darwin'
- wireguard_install_kernel_module

- name: Set default for WireGuard interface restart behavior
ansible.builtin.set_fact:
Expand Down

0 comments on commit 46fe5ef

Please sign in to comment.