56 lines
1.2 KiB
YAML
56 lines
1.2 KiB
YAML
---
|
|
- name: Disable kernel installation from base repository
|
|
become: true
|
|
lineinfile:
|
|
path: /etc/yum.repos.d/CentOS-Base.repo
|
|
line: exclude=kernel*
|
|
|
|
- name: Enable Centos-plus repository
|
|
become: true
|
|
lineinfile:
|
|
path: /etc/yum.repos.d/CentOS-centosplus.repo
|
|
regexp: "#?enabled=(0|1)"
|
|
line: enabled=1
|
|
|
|
- name: Enable kernel installation from plus repository
|
|
become: true
|
|
lineinfile:
|
|
path: /etc/yum.repos.d/CentOS-centosplus.repo
|
|
line: includepkgs=kernel*
|
|
|
|
# Note that the order of the next four tasks is very specific and intentional
|
|
# See this wiki page: https://plone.lucidsolutions.co.nz/linux/centos/7/install-centos-plus-kernel-kernel-plus/view
|
|
- name: Install kernel-plus
|
|
become: true
|
|
dnf:
|
|
name:
|
|
- kernel-plus
|
|
- kernel-plus-devel
|
|
state: latest
|
|
|
|
- name: Uninstall kernel-tools
|
|
become: true
|
|
dnf:
|
|
name:
|
|
- kernel-tools
|
|
- kernel-tools-libs
|
|
state: absent
|
|
|
|
- name: Install kernel-plus-tools
|
|
become: true
|
|
dnf:
|
|
name:
|
|
- kernel-plus-tools
|
|
- kernel-plus-tools-libs
|
|
state: latest
|
|
|
|
- name: Uninstall kernel
|
|
become: true
|
|
dnf:
|
|
name:
|
|
- kernel
|
|
- kernel-devel
|
|
- kernel-core
|
|
- kernel-modules
|
|
state: absent
|