Skip to content

Commit

Permalink
PVE guest and host detection (#127)
Browse files Browse the repository at this point in the history
* Distinguish between proxmox host and guest setup

* Update CHANGELOG.md
  • Loading branch information
tobias-richter authored Oct 8, 2021
1 parent 5f53200 commit 5caaea2
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 8 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ SPDX-License-Identifier: GPL-3.0-or-later
Changelog
---------

**8.4.0**

- add support for installing wireguard in pve lxc guest (contribution by @tobias-richter)

**8.3.0**

- add Molecule test for CentOS 7 `kernel-plus`
Expand Down
16 changes: 16 additions & 0 deletions tasks/setup-debian-pve-guest-variant.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
# Copyright (C) 2021 Tobias Richter
# SPDX-License-Identifier: GPL-3.0-or-later

- name: (Proxmox) Add WireGuard repository
apt_repository:
repo: "deb http://deb.debian.org/debian buster-backports main"
state: "{{ 'present' if (ansible_distribution_version | int <= 10) else 'absent' }}"
update_cache: true

- name: (Proxmox lxc) Install wireguard-tools.
apt:
install_recommends: no
name:
- wireguard-tools
state: present
File renamed without changes.
33 changes: 25 additions & 8 deletions tasks/setup-debian.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,29 @@
when: ansible_lsb.id is defined and ansible_lsb.id == "Raspbian"
register: wireguard__register_raspbian_setup

- include_tasks:
file: "setup-debian-pve-variant.yml"
apply:
tags:
- wg-install
when: ansible_kernel.find("pve") != -1
register: wireguard__register_pve_variant_setup
- name: pve variants
block:
- include_tasks:
file: "setup-debian-pve-host-variant.yml"
apply:
tags:
- wg-install
when:
- ansible_virtualization_role == "host"
register: wireguard__register_pve_host_variant_setup

- include_tasks:
file: "setup-debian-pve-guest-variant.yml"
apply:
tags:
- wg-install
when:
- ansible_virtualization_role == "guest"
register: wireguard__register_pve_guest_variant_setup

when:
- ansible_kernel.find("pve") != -1


- include_tasks:
file: "setup-debian-vanilla.yml"
Expand All @@ -26,4 +42,5 @@
- wg-install
when:
- wireguard__register_raspbian_setup is skipped
- wireguard__register_pve_variant_setup is skipped
- wireguard__register_pve_guest_variant_setup is skipped
- wireguard__register_pve_host_variant_setup is skipped

0 comments on commit 5caaea2

Please sign in to comment.