add wg_hub role with fixed ansible-lint errors

This commit is contained in:
Sergey Malyuk
2025-12-11 10:13:00 +03:00
parent e2f8916b4d
commit 19989e72d8
9 changed files with 193 additions and 0 deletions

View File

@@ -0,0 +1,24 @@
---
- name: Converge
hosts: all
vars:
wg_hub_iface_name: adm
wg_hub_ipv4_vpn_addr: 10.0.0.254
wg_hub_ipv4_vpn_cidr: 24
wg_hub_wg_port: 51820
wg_hub_wg_pkey: gABk6e/n3UDgudEVlUrEVcVdn0tc0YVDeCASsI10QFA=
wg_hub_wg_pubkey: EvcoZ21/p0AHz5y95jwjVIR9puljc2kXqh/f3U1A4nk=
wg_hub_hide_secrets: false
# dns_server: 127.0.0.1:5300 # doesn't work in Github Actions environment
peers:
- wg_hub_host_id: alpha
wg_hub_ipv4_vpn_addr: 10.0.0.1
wg_hub_wg_pubkey: LfEJgNiJ05nx4nWB0Pj3wS3WRyFq567fsdDh4XZqRF0=
wg_psk: i3JCrQOfptZhgpL+BTm/65MPW/ljJexCgiuWMIqZJYo=
- wg_hub_host_id: beta
wg_hub_ipv4_vpn_addr: 10.0.0.2
wg_hub_wg_pubkey: oq3Fcwwfxsi5f5UHcZKtxMwQ2aSeHOUe3r35soUUYzU=
wg_psk: Z/z7Qo8hW97UcImYE/ZbCxpNmizfVhvl0dzygtvtYYg=
roles:
- role: genlab.common.wg_hub

View File

@@ -0,0 +1,27 @@
---
dependency:
name: galaxy
driver:
name: docker
platforms:
- name: ubuntu
image: geerlingguy/docker-${MOLECULE_DISTRO:-ubuntu2204}-ansible:latest
pre_build_image: true
command: ${MOLECULE_DOCKER_COMMAND:-""}
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:rw
cgroupns_mode: host
privileged: true
provisioner:
name: ansible
verifier:
name: ansible
lint: |
set -e
yamllint .
ansible-lint .

View File

@@ -0,0 +1,13 @@
---
- name: Verify
hosts: all
gather_facts: false
any_errors_fatal: true
vars:
iface_name: adm
tasks:
- name: "Check that the Wireguard service is running"
ansible.builtin.service:
name: wg-quick@{{ iface_name }}
state: started