-
Notifications
You must be signed in to change notification settings - Fork 1
/
CentOS7x_Stop-Updating-Kernel3x-playbook.yml
54 lines (43 loc) · 1.74 KB
/
CentOS7x_Stop-Updating-Kernel3x-playbook.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
---
################################################################################
# description: Stop updating OS Kernel 3x on CentOS7x
# usage: ansible-playbook CentOS7x_Stop-Updating-Kernel3x-playbook.yml --extra-vars 'HostOrGroup=YourServerOrGroupNameGoesHere'
# author: Ernest G. Wilson II <ErnestGWilsonII@gmail.com> (https://github.com/ernestgwilsonii)
# license: MIT
################################################################################
# Ansible Playbook options
# REF: http://docs.ansible.com/ansible/playbooks.html
#####################################################
- name: Stop updating OS Kernel 3x on CentOS7x
hosts: "{{ HostOrGroup|default ('FATAL ERROR --> HostOrGroup NOT SET! You must specify either a Host or a Group name!') }}"
serial: "100%"
gather_facts: False
tasks:
# Update various configuration files
# REF: http://docs.ansible.com/ansible/lineinfile_module.html
#############################################################
- name: Make sure /etc/yum.conf has exclude=kernel-3*
lineinfile:
dest=/etc/yum.conf
state=present
line='exclude=kernel-3*'
- name: Make sure /etc/yum.conf has exclude=kernel-headers-3*
lineinfile:
dest=/etc/yum.conf
state=present
line='exclude=kernel-headers-3*'
- name: Make sure /etc/yum.conf has exclude=kernel-tools-3*
lineinfile:
dest=/etc/yum.conf
state=present
line='exclude=kernel-tools-3*'
- name: Make sure /etc/yum.conf has exclude=kernel-tools-libs-3*
lineinfile:
dest=/etc/yum.conf
state=present
line='exclude=kernel-tools-libs-3*'
- name: Make sure /etc/yum.conf has installonly_limit=3
lineinfile:
dest=/etc/yum.conf
state=present
line='installonly_limit=3'