From c1f413f9665b59cd0d648d9d8ba77bee6b455421 Mon Sep 17 00:00:00 2001 From: Roman Danko Date: Mon, 10 Aug 2020 23:58:59 +0200 Subject: [PATCH] Switched to ELRepo for Centos (#59) * Switched to ELRepo for Centos (#50) - added switch to differentiate setup of Centos7/8 - replaced old repository by officialy recomended - added step to remove old dkms wireguard package - switched to install KMOD wireguard package * Updated CHANGELOG after switching to ELRepo for Centos * Update CHANGELOG.md Co-authored-by: Robert Wimmer <2039811+githubixx@users.noreply.github.com> * Updted CHANGELOG: added notice about old wireguard Centos repository removal Co-authored-by: Robert Wimmer <2039811+githubixx@users.noreply.github.com> --- CHANGELOG.md | 8 ++++++++ tasks/main.yml | 8 +++++++- tasks/setup-centos-7.yml | 29 +++++++++++++++++++++++++++++ tasks/setup-centos-8.yml | 24 ++++++++++++++++++++++++ tasks/setup-centos.yml | 19 ------------------- 5 files changed, 68 insertions(+), 20 deletions(-) create mode 100644 tasks/setup-centos-7.yml create mode 100644 tasks/setup-centos-8.yml delete mode 100644 tasks/setup-centos.yml diff --git a/CHANGELOG.md b/CHANGELOG.md index a1a4441..07484dd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,14 @@ Changelog --------- +**7.0.0** + +- Switched to install from ELRepo KMOD package for CentOS (see https://www.wireguard.com/install/). This change may break installation for systems with custom kernels. The role previously supported custom kernel implicitly because it was using DKMS package (contribution by @elcomtik) + + Role removes DKMS wireguard package, however it doesn't remove jdoss-wireguard-epel-7 repository. If you don't need this repository, do cleanup by: + * remove `/etc/yum.repos.d/wireguard.repo` + + **6.3.1** - Support Openstack Debian images (contribution by @pallinger) diff --git a/tasks/main.yml b/tasks/main.yml index ac056c0..b27cbb2 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -2,7 +2,13 @@ - name: Gather instance facts setup: -- include_tasks: "setup-{{ ansible_distribution|lower }}.yml" +- include_tasks: "{{ item }}" + with_first_found: + - "setup-{{ ansible_distribution|lower }}-{{ ansible_distribution_major_version }}.yml" + - "setup-{{ ansible_distribution|lower }}-{{ ansible_distribution_version }}.yml" + - "setup-{{ ansible_distribution|lower }}-{{ ansible_distribution_release }}.yml" + - "setup-{{ ansible_distribution|lower }}.yml" + - "setup-{{ ansible_os_family|lower }}.yml" - name: Enable WireGuard kernel module modprobe: diff --git a/tasks/setup-centos-7.yml b/tasks/setup-centos-7.yml new file mode 100644 index 0000000..cddcccd --- /dev/null +++ b/tasks/setup-centos-7.yml @@ -0,0 +1,29 @@ +--- +- name: (CentOS 7) Install EPEL & ELRepo repository + yum: + name: + - epel-release + - https://www.elrepo.org/elrepo-release-7.el7.elrepo.noarch.rpm + update_cache: yes + +- name: (CentOS 7) Install yum-plugin-elrepo + yum: + name: yum-plugin-elrepo + update_cache: yes + +- name: (CentOS 7) Ensure wireguard DKMS package is removed + yum: + name: + - "wireguard-dkms" + state: absent + tags: + - wg-install + +- name: (CentOS 7) Install wireguard packages + yum: + name: + - "kmod-wireguard" + - "wireguard-tools" + state: present + tags: + - wg-install diff --git a/tasks/setup-centos-8.yml b/tasks/setup-centos-8.yml new file mode 100644 index 0000000..edce375 --- /dev/null +++ b/tasks/setup-centos-8.yml @@ -0,0 +1,24 @@ +--- +- name: (CentOS 8) Install EPEL & ELRepo repository + yum: + name: + - epel-release + - elrepo-release + update_cache: yes + +- name: (CentOS 8) Ensure wireguard DKMS package is removed + yum: + name: + - "wireguard-dkms" + state: absent + tags: + - wg-install + +- name: (CentOS 8) Install wireguard packages + yum: + name: + - "kmod-wireguard" + - "wireguard-tools" + state: present + tags: + - wg-install diff --git a/tasks/setup-centos.yml b/tasks/setup-centos.yml deleted file mode 100644 index 4a17708..0000000 --- a/tasks/setup-centos.yml +++ /dev/null @@ -1,19 +0,0 @@ ---- -- name: (CentOS) Add WireGuard repository - get_url: - url: https://copr.fedorainfracloud.org/coprs/jdoss/wireguard/repo/epel-7/jdoss-wireguard-epel-7.repo - dest: /etc/yum.repos.d/wireguard.repo - -- name: (CentOS) Install EPEL repository - yum: - name: epel-release - update_cache: yes - -- name: (CentOS) Install wireguard packages - yum: - name: - - "wireguard-dkms" - - "wireguard-tools" - state: present - tags: - - wg-install