@ -2,17 +2,28 @@
# Copyright (C) 2020 Roman Danko
# Copyright (C) 2020 Roman Danko
# SPDX-License-Identifier: GPL-3.0-or-later
# SPDX-License-Identifier: GPL-3.0-or-later
- name : (CentOS 7) Install EPEL & ELRepo repository
- name : (CentOS 7) Tasks for standard kernel
yum:
block:
name:
- name : (CentOS 7) Install EPEL & ELRepo repository
- epel-release
yum:
- https://www.elrepo.org/elrepo-release-7.el7.elrepo.noarch.rpm
name:
update_cache : true
- epel-release
- https://www.elrepo.org/elrepo-release-7.el7.elrepo.noarch.rpm
update_cache : true
- name : (CentOS 7) Install yum-plugin-elrepo
- name : (CentOS 7) Install yum-plugin-elrepo
yum:
yum:
name : yum-plugin-elrepo
name : yum-plugin-elrepo
update_cache : true
update_cache : true
- name : (CentOS 7) Install WireGuard packages
yum:
name:
- "kmod-wireguard"
- "wireguard-tools"
state : present
when:
- wireguard_centos7_installation_method == "standard"
- name : (CentOS 7) Ensure WireGuard DKMS package is removed
- name : (CentOS 7) Ensure WireGuard DKMS package is removed
yum:
yum:
@ -20,9 +31,39 @@
- "wireguard-dkms"
- "wireguard-dkms"
state : absent
state : absent
- name : (CentOS 7) Install WireGuard packages
- name : (CentOS 7) Tasks for kernel-plus
yum:
block:
name:
- name : (CentOS 7) Install EPEL repository & yum utils
- "kmod-wireguard"
yum:
- "wireguard-tools"
name:
state : present
- epel-release
- yum-utils
update_cache : true
- name : (CentOS 7) Enable CentosPlus repo
command : yum-config-manager --setopt=centosplus.includepkgs=kernel-plus --enablerepo=centosplus --save
changed_when : false
- name : (CentOS 7) Update to kernel-plus
replace:
path : /etc/sysconfig/kernel
regexp : '^DEFAULTKERNEL=kernel$'
replace : 'DEFAULTKERNEL=kernel-plus'
- name : (CentOS 7) Install WireGuard packages
yum:
name:
- "kernel-plus"
- "wireguard-tools"
state : present
register : centos7_yum_updates
- name : (CentOS 7) Reboot Instance to update kernel
reboot:
reboot_timeout : "{{ wireguard_centos7_kernel_plus_reboot_timeout }}"
when:
- centos7_yum_updates.changes is defined
- centos7_yum_updates.changes.installed|flatten|select('regex', '^kernel-plus$') is any
when:
- wireguard_centos7_installation_method == "kernel-plus"