Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[#180] Switch over to lt kernel and remove old kernels #182

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions ansible-scylla-loader/tasks/RedHat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

- name: Install the ELRepo kernel
yum:
name: kernel-ml
name: kernel-lt
state: present
lock_timeout: 60
when: elrepo_kernel == True and (ansible_distribution == "CentOS" or ansible_distribution == "RedHat")
Expand Down Expand Up @@ -96,4 +96,3 @@
state: latest
lock_timeout: 60
become: true

22 changes: 19 additions & 3 deletions ansible-scylla-node/tasks/RedHat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,14 @@
name: "https://www.elrepo.org/elrepo-release-{{ ansible_facts['distribution_major_version'] }}.el{{ ansible_facts['distribution_major_version'] }}.elrepo.noarch.rpm"
state: present

- name: enable epel kernels
shell: |
yum-config-manager --enable elrepo-kernel

- name: Install ELRepo mainline kernel
yum:
name: kernel-ml
name: kernel-lt
state: present
enablerepo: elrepo-kernel
lock_timeout: 60
register: kernel_installed

Expand All @@ -54,6 +57,11 @@
command: grub2-mkconfig -o /boot/grub2/grub.cfg
when: kernel_installed.changed

- name: Needs restarting?
command: needs-restarting -r
register: restart_required
ignore_errors: yes

- name: Reboot host and wait for it to restart
reboot:
msg: "Reboot initiated by Ansible"
Expand All @@ -62,7 +70,15 @@
pre_reboot_delay: 0
post_reboot_delay: 30
test_command: whoami
when: reboot_after_kernel_upgrade|bool and kernel_installed.changed
when: (reboot_after_kernel_upgrade|bool and kernel_installed.changed) or restart_required.rc == 1

- name: Remove old kernels
package:
name:
- kernel
- kernel-ml
state: absent

when: elrepo_kernel|bool and install_type == 'online' and (ansible_distribution == "CentOS" or ansible_distribution == "RedHat")
become: true

Expand Down