Skip to content
Snippets Groups Projects
Commit dc515e5a authored by Matthew Mosesohn's avatar Matthew Mosesohn Committed by GitHub
Browse files

Remove kernel-upgrade role (#1798)

This role only support Red Hat type distros and is not maintained
or used by many users. It should be removed because it creates
feature disparity between supported OSes and is not maintained.
parent 56763d42
No related branches found
No related tags found
No related merge requests found
...@@ -26,7 +26,6 @@ ...@@ -26,7 +26,6 @@
any_errors_fatal: "{{ any_errors_fatal | default(true) }}" any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
roles: roles:
- { role: kubespray-defaults} - { role: kubespray-defaults}
- { role: kernel-upgrade, tags: kernel-upgrade, when: kernel_upgrade is defined and kernel_upgrade }
- { role: kubernetes/preinstall, tags: preinstall } - { role: kubernetes/preinstall, tags: preinstall }
- { role: docker, tags: docker } - { role: docker, tags: docker }
- role: rkt - role: rkt
......
...@@ -114,9 +114,6 @@ bin_dir: /usr/local/bin ...@@ -114,9 +114,6 @@ bin_dir: /usr/local/bin
## as a backend). Options are "script" or "vault" ## as a backend). Options are "script" or "vault"
#cert_management: script #cert_management: script
## Please specify true if you want to perform a kernel upgrade
kernel_upgrade: false
# Set to true to allow pre-checks to fail and continue deployment # Set to true to allow pre-checks to fail and continue deployment
#ignore_assert_errors: false #ignore_assert_errors: false
......
---
elrepo_key_url: 'https://www.elrepo.org/RPM-GPG-KEY-elrepo.org'
elrepo_rpm: elrepo-release-7.0-3.el7.elrepo.noarch.rpm
elrepo_mirror: http://www.elrepo.org
elrepo_url: '{{elrepo_mirror}}/{{elrepo_rpm}}'
elrepo_kernel_package: "kernel-lt"
---
- name: install ELRepo key
rpm_key:
state: present
key: '{{ elrepo_key_url }}'
- name: install elrepo repository
yum:
name: '{{elrepo_url}}'
state: present
- name: upgrade kernel
yum:
name: "{{elrepo_kernel_package}}"
state: present
enablerepo: elrepo-kernel
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
\ No newline at end of file
---
- include: centos-7.yml
when: ansible_distribution in ["CentOS","RedHat"] and
ansible_distribution_major_version >= 7 and not is_atomic
\ No newline at end of file
---
# Reboot the machine gets more complicated as we want to support bastion hosts. A simple wait_for task would not work
# as we can not directly reach the hosts (except the bastion). In case a basion is used, we first check for it to come
# back. After it is back, we check for all the hosts by delegating to the bastion.
- name: Rebooting server
shell: nohup bash -c "sleep 5 && shutdown -r now 'Reboot required for updated kernel'" &
- name: Wait for some seconds
pause:
seconds: 10
- set_fact:
is_bastion: "{{ inventory_hostname == 'bastion' }}"
wait_for_delegate: "localhost"
- set_fact:
wait_for_delegate: "{{hostvars['bastion']['ansible_ssh_host']}}"
when: "'bastion' in groups['all']"
- name: wait for bastion to come back
wait_for:
host: "{{ ansible_ssh_host }}"
port: 22
delay: 10
timeout: 300
become: false
delegate_to: localhost
when: is_bastion
- name: waiting for server to come back (using bastion if necessary)
wait_for:
host: "{{ ansible_ssh_host }}"
port: 22
delay: 10
timeout: 300
become: false
delegate_to: "{{ wait_for_delegate }}"
when: not is_bastion
...@@ -22,7 +22,6 @@ ...@@ -22,7 +22,6 @@
any_errors_fatal: "{{ any_errors_fatal | default(true) }}" any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
roles: roles:
- { role: kubespray-defaults} - { role: kubespray-defaults}
- { role: kernel-upgrade, tags: kernel-upgrade, when: kernel_upgrade is defined and kernel_upgrade }
- { role: kubernetes/preinstall, tags: preinstall } - { role: kubernetes/preinstall, tags: preinstall }
- { role: docker, tags: docker } - { role: docker, tags: docker }
- role: rkt - role: rkt
......
...@@ -26,7 +26,6 @@ ...@@ -26,7 +26,6 @@
any_errors_fatal: "{{ any_errors_fatal | default(true) }}" any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
roles: roles:
- { role: kubespray-defaults} - { role: kubespray-defaults}
- { role: kernel-upgrade, tags: kernel-upgrade, when: kernel_upgrade is defined and kernel_upgrade }
- { role: kubernetes/preinstall, tags: preinstall } - { role: kubernetes/preinstall, tags: preinstall }
- { role: docker, tags: docker } - { role: docker, tags: docker }
- role: rkt - role: rkt
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment