PVE guest and host detection (#127)
* Distinguish between proxmox host and guest setup * Update CHANGELOG.md
This commit is contained in:
parent
5f5320010f
commit
5caaea2047
4 changed files with 45 additions and 8 deletions
|
@ -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`
|
||||
|
|
16
tasks/setup-debian-pve-guest-variant.yml
Normal file
16
tasks/setup-debian-pve-guest-variant.yml
Normal file
|
@ -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"
|
||||
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"
|
||||
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue