Support for Proxmox (#99)

* add PVE to the recipe

* Update tasks/setup-debian-pve-variant.yml

Co-authored-by: Robert Wimmer <2039811+githubixx@users.noreply.github.com>

* Update tasks/setup-debian-pve-variant.yml

Co-authored-by: Robert Wimmer <2039811+githubixx@users.noreply.github.com>

* Update tasks/setup-debian-pve-variant.yml

Co-authored-by: Robert Wimmer <2039811+githubixx@users.noreply.github.com>

* Update tasks/setup-debian.yml

Co-authored-by: Robert Wimmer <2039811+githubixx@users.noreply.github.com>

* On Proxmox ansible_lsb.id variable is not set

* change when condition for include task setup-debian-vanilla.yml to a list

* add Molecule test for Proxmox

* use file module to delete /var/lib/apt/lists/lock for Proxmox in Molecule test

Co-authored-by: Steve Fan <29133953+stevefan1999-personal@users.noreply.github.com>
master
Robert Wimmer 4 years ago committed by GitHub
parent 364b1fe4f0
commit 663d3b9a5f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -15,6 +15,13 @@
ignore_errors: true
when: ansible_distribution|lower == 'archlinux'
- name: (Proxmox) Delete /var/lib/apt/lists/lock
file:
name: /var/lib/apt/lists/lock
state: absent
ignore_errors: true
when: ansible_kernel.find("pve") != -1
- name: Include WireGuard role
include_role:
name: githubixx.ansible_role_wireguard

@ -97,6 +97,15 @@ platforms:
ip: 192.168.10.90
groups:
- vpn
- name: test-wg-proxmox
box: rantanevich/proxmox
interfaces:
- auto_config: true
network_name: private_network
type: static
ip: 192.168.10.100
groups:
- vpn
provisioner:
name: ansible
@ -155,6 +164,11 @@ provisioner:
wireguard_port: 51820
wireguard_persistent_keepalive: "30"
wireguard_endpoint: "192.168.10.90"
test-wg-proxmox:
wireguard_address: "10.10.10.100/24"
wireguard_port: 51820
wireguard_persistent_keepalive: "30"
wireguard_endpoint: "192.168.10.100"
scenario:
name: kvm

@ -0,0 +1,27 @@
---
# Copyright (C) 2018-2020 Robert Wimmer
# Copyright (C) 2019-2020 Ties de Kock
# Copyright (C) 2021 Steve Fan
# 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: yes
tags:
- wg-install
- name: (Proxmox) Install kernel headers for the currently running kernel to compile WireGuard with DKMS
apt:
name:
- "pve-headers-{{ ansible_kernel }}"
state: present
- name: (Proxmox) Install WireGuard packages
apt:
name:
- "wireguard"
state: present
tags:
- wg-install

@ -1,10 +1,17 @@
---
# Copyright (C) 2020 Stefan Haun
# Copyright (C) 2021 Steve Fan
# SPDX-License-Identifier: GPL-3.0-or-later
- include_tasks: "setup-debian-raspbian.yml"
when: ansible_lsb.id == "Raspbian"
when: ansible_lsb.id is defined and ansible_lsb.id == "Raspbian"
register: wireguard__register_raspbian_setup
- include_tasks: "setup-debian-pve-variant.yml"
when: ansible_kernel.find("pve") != -1
register: wireguard__register_pve_variant_setup
- include_tasks: "setup-debian-vanilla.yml"
when: wireguard__register_raspbian_setup is skipped
when:
- wireguard__register_raspbian_setup is skipped
- wireguard__register_pve_variant_setup is skipped

Loading…
Cancel
Save