From f6a6e4680a6061622bee2351daadaa30f60f953d Mon Sep 17 00:00:00 2001 From: Robert Wimmer <2039811+githubixx@users.noreply.github.com> Date: Wed, 30 Nov 2022 20:59:35 +0100 Subject: [PATCH] Support elementary OS (#171) * add support for elementary OS * update README * add skip_ansible_lint for two tasks * ignore two ansible-lint warnings for Raspbian Buster tasks * update CHANGELOG * update comment in defaults/main.yml and README --- CHANGELOG.md | 5 +++++ README.md | 8 +++++++- defaults/main.yml | 4 +++- tasks/main.yml | 4 ++++ tasks/setup-debian-raspbian-buster.yml | 4 ++-- tasks/setup-elementary os.yml | 13 +++++++++++++ 6 files changed, 34 insertions(+), 4 deletions(-) create mode 100644 tasks/setup-elementary os.yml diff --git a/CHANGELOG.md b/CHANGELOG.md index 67f47a3..c829601 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,11 @@ SPDX-License-Identifier: GPL-3.0-or-later # Changelog +## 11.1.0 + +- add support for elementary OS 6 +- ignore some minor linter warnings + ## 11.0.0 - add support for Rocky Linux 9 (original PR from @vincentDcmps: https://github.com/githubixx/ansible-role-wireguard/pull/163) diff --git a/README.md b/README.md index 4578a0d..0778bd1 100644 --- a/README.md +++ b/README.md @@ -29,6 +29,10 @@ This role should work with: - openSUSE Leap 15.3 - openSUSE Leap 15.4 +Best effort: + +- elementary OS 6 + Molecule tests are [available](https://github.com/githubixx/ansible-role-wireguard#testing) (see further down below). It should also work with `Raspbian Buster` but for this one there is no test available. MacOS (see below) should also work partitially but is only best effort. MacOS @@ -141,7 +145,9 @@ There are also a few Linux distribution specific settings: ```yaml ####################################### -# Settings only relevant for Ubuntu +# Settings only relevant for: +# - Ubuntu +# - elementary OS ####################################### # Set to "false" if package cache should not be updated diff --git a/defaults/main.yml b/defaults/main.yml index 826aff7..2a7666d 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -68,7 +68,9 @@ wireguard_interface_restart: false # wireguard_private_key: ####################################### -# Settings only relevant for Ubuntu +# Settings only relevant for: +# - Ubuntu +# - elementary OS ####################################### # Set to "false" if package cache should not be updated diff --git a/tasks/main.yml b/tasks/main.yml index cfcd181..09dfe5b 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -41,6 +41,8 @@ {%- else -%} false {%- endif %} + tags: + - skip_ansible_lint - name: Make sure wg syncconf option is available when: @@ -76,6 +78,8 @@ {%- else -%} 'syncconf' {%- endif %} + tags: + - skip_ansible_lint - name: Register if config/private key already exists on target host ansible.builtin.stat: diff --git a/tasks/setup-debian-raspbian-buster.yml b/tasks/setup-debian-raspbian-buster.yml index a687ea8..3cc2b26 100644 --- a/tasks/setup-debian-raspbian-buster.yml +++ b/tasks/setup-debian-raspbian-buster.yml @@ -33,7 +33,7 @@ ansible.builtin.apt: name: - "raspberrypi-kernel" - state: latest + state: latest # noqa package-latest register: wireguard__register_kernel_update - name: (Raspbian) Reboot after kernel update (Ansible >= 2.8) @@ -76,7 +76,7 @@ ansible.builtin.apt: name: - "raspberrypi-kernel-headers" - state: latest + state: latest # noqa package-latest - name: (Raspbian) Install WireGuard packages ansible.builtin.apt: diff --git a/tasks/setup-elementary os.yml b/tasks/setup-elementary os.yml new file mode 100644 index 0000000..0aebefa --- /dev/null +++ b/tasks/setup-elementary os.yml @@ -0,0 +1,13 @@ +--- +# Copyright (C) 2022 Robert Wimmer +# SPDX-License-Identifier: GPL-3.0-or-later + +- name: (elementary OS) Update APT package cache + ansible.builtin.apt: + update_cache: "{{ wireguard_ubuntu_update_cache }}" + cache_valid_time: "{{ wireguard_ubuntu_cache_valid_time }}" + +- name: (elementary OS) Install wireguard package + ansible.builtin.apt: + name: "wireguard" + state: present