-
Notifications
You must be signed in to change notification settings - Fork 171
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* remove support for Fedora 35 / add support for Fedora 36 * remove Fedora 34 + add Fedora 36 to Molecule test * fix Jinja2 spacing * fix Jinja2 spacing * improve the task key order to: name, when, tags, block * handlers/main.yml: names should start with an uppercase letter * tasks/main.yml: names should start with an uppercase letter * add .yamllint * add Github release action to push new release to Ansible Galaxy * add Molecule setup for openSUSE 15.4 * molecule/kvm-single-server: add verify.yml / enable verifier * update CHANGELOG
- Loading branch information
Showing
14 changed files
with
180 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
--- | ||
# This workflow requires a GALAXY_API_KEY secret present in the GitHub | ||
# repository or organization. | ||
# | ||
# See: https://github.com/marketplace/actions/publish-ansible-role-to-galaxy | ||
# See: https://github.com/ansible/galaxy/issues/46 | ||
|
||
name: Release | ||
on: | ||
push: | ||
tags: | ||
- '*' | ||
|
||
defaults: | ||
run: | ||
working-directory: 'githubixx.ansible_role_wireguard' | ||
|
||
jobs: | ||
release: | ||
name: Release | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out the codebase. | ||
uses: actions/checkout@v2 | ||
with: | ||
path: 'githubixx.ansible_role_wireguard' | ||
|
||
- name: Set up Python 3. | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: '3.x' | ||
|
||
- name: Install Ansible. | ||
run: pip3 install ansible-core | ||
|
||
- name: Trigger a new import on Galaxy. | ||
run: >- | ||
ansible-galaxy role import --api-key ${{ secrets.GALAXY_API_KEY }} | ||
$(echo ${{ github.repository }} | cut -d/ -f1) $(echo ${{ github.repository }} | cut -d/ -f2) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
--- | ||
extends: default | ||
|
||
rules: | ||
line-length: | ||
max: 150 | ||
level: warning | ||
|
||
comments-indentation: disable |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -93,4 +93,3 @@ scenario: | |
|
||
verifier: | ||
name: ansible | ||
enabled: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
--- | ||
# Copyright (C) 2022 Robert Wimmer | ||
# SPDX-License-Identifier: GPL-3.0-or-later | ||
|
||
- name: Verify setup | ||
hosts: all | ||
vars: | ||
hosts_count: "{{ groups['vpn'] | length }}" | ||
tasks: | ||
- name: Count WireGuard interfaces | ||
ansible.builtin.shell: | | ||
set -o errexit | ||
set -o pipefail | ||
set -o nounset | ||
wg | grep "peer: " | wc -l | ||
exit 0 | ||
args: | ||
executable: "/bin/bash" | ||
register: wireguard__interfaces_count | ||
changed_when: false | ||
|
||
- name: Print WireGuard interface count | ||
ansible.builtin.debug: | ||
var: wireguard__interfaces_count.stdout | ||
|
||
- name: Print hosts count in vpn group | ||
ansible.builtin.debug: | ||
var: hosts_count | ||
|
||
- name: There should be as much WireGuard interfaces as hosts in vpn group minus one | ||
ansible.builtin.assert: | ||
that: | ||
- "hosts_count|int -1 == wireguard__interfaces_count.stdout|int" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.