kubespray/roles/kernel-upgrade/tasks/centos-7.yml

33 lines
680 B
YAML
Raw Normal View History

2017-01-10 23:11:42 +08:00
---
- name: install ELRepo key
rpm_key:
state: present
key: '{{ elrepo_key_url }}'
2017-01-10 23:11:42 +08:00
- name: install elrepo repository
yum:
name: '{{elrepo_url}}'
state: present
- name: upgrade kernel
yum:
name: "{{elrepo_kernel_package}}"
state: present
enablerepo: elrepo-kernel
2017-01-10 23:11:42 +08:00
register: upgrade
- name: change default grub entry
lineinfile:
dest: '/etc/default/grub'
regexp: '^GRUB_DEFAULT=.*'
line: 'GRUB_DEFAULT=0'
when: upgrade.changed
register: grub_entry
- name: re-generate grub-config
command: grub2-mkconfig -o /boot/grub2/grub.cfg
when: upgrade.changed and grub_entry.changed
- include: reboot.yml
when: upgrade.changed