PVE guest and host detection (#127)

* Distinguish between proxmox host and guest setup

* Update CHANGELOG.md
master 8.4.0
Tobias Richter 3 years ago committed by GitHub
parent 5f5320010f
commit 5caaea2047
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -6,6 +6,10 @@ SPDX-License-Identifier: GPL-3.0-or-later
Changelog Changelog
--------- ---------
**8.4.0**
- add support for installing wireguard in pve lxc guest (contribution by @tobias-richter)
**8.3.0** **8.3.0**
- add Molecule test for CentOS 7 `kernel-plus` - add Molecule test for CentOS 7 `kernel-plus`

@ -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

@ -11,13 +11,29 @@
when: ansible_lsb.id is defined and ansible_lsb.id == "Raspbian" when: ansible_lsb.id is defined and ansible_lsb.id == "Raspbian"
register: wireguard__register_raspbian_setup register: wireguard__register_raspbian_setup
- include_tasks: - name: pve variants
file: "setup-debian-pve-variant.yml" 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: apply:
tags: tags:
- wg-install - wg-install
when: ansible_kernel.find("pve") != -1 when:
register: wireguard__register_pve_variant_setup - ansible_virtualization_role == "guest"
register: wireguard__register_pve_guest_variant_setup
when:
- ansible_kernel.find("pve") != -1
- include_tasks: - include_tasks:
file: "setup-debian-vanilla.yml" file: "setup-debian-vanilla.yml"
@ -26,4 +42,5 @@
- wg-install - wg-install
when: when:
- wireguard__register_raspbian_setup is skipped - 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

Loading…
Cancel
Save