-
Notifications
You must be signed in to change notification settings - Fork 70
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #801 from openstack-k8s-operators/update/kpatch
Enable kpatch support for update
- Loading branch information
Showing
13 changed files
with
173 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
--- | ||
# Copyright 2024 Red Hat, Inc. | ||
# All Rights Reserved. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); you may | ||
# not use this file except in compliance with the License. You may obtain | ||
# a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||
# License for the specific language governing permissions and limitations | ||
# under the License. | ||
|
||
|
||
- name: Converge | ||
hosts: all | ||
gather_facts: false | ||
tasks: | ||
- name: "Call edpm_update role" | ||
ansible.builtin.include_role: | ||
name: osp.edpm.edpm_update | ||
vars: | ||
edpm_update_enable_containers_update: false | ||
edpm_service_types: [] | ||
edpm_update_enable_kpatch: true | ||
|
||
# We have to run the verifications in this play to | ||
# ensure we have access to the internally changed | ||
# facts. | ||
- name: Conduct some verifications | ||
block: | ||
- name: Ensure kernel related packages are excluded | ||
ansible.builtin.assert: | ||
that: | ||
- _exclude_packages is defined | ||
- "'kernel' in _exclude_packages" | ||
- "'kernel-core' in _exclude_packages" | ||
|
||
- name: Gather all installed packages | ||
ansible.builtin.package_facts: | ||
|
||
- name: Check service status if we have kpatch-patch installed | ||
when: | ||
- ansible_facts.packages["kpatch-patch"] is defined | ||
block: | ||
- name: Gather services | ||
ansible.builtin.service_facts: | ||
|
||
- name: Ensure kpatch.service is running | ||
ansible.builtin.assert: | ||
that: | ||
- ansible_facts.services['kpatch.service'] is defined | ||
- ansible_facts.services['kpatch.service'].state == 'running' | ||
- ansible_facts.services['kpatch.service'].status == 'enabled' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
--- | ||
dependency: | ||
name: galaxy | ||
options: | ||
role-file: collections.yml | ||
driver: | ||
name: delegated | ||
options: | ||
managed: false | ||
ansible_connection_options: | ||
ansible_connection: local | ||
platforms: | ||
- name: edpm-0.localdomain | ||
groups: | ||
- compute | ||
provisioner: | ||
log: true | ||
name: ansible | ||
|
||
scenario: | ||
test_sequence: | ||
- prepare | ||
- converge | ||
- cleanup | ||
- destroy | ||
verifier: | ||
name: ansible |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
--- | ||
# Copyright 2024 Red Hat, Inc. | ||
# All Rights Reserved. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); you may | ||
# not use this file except in compliance with the License. You may obtain | ||
# a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||
# License for the specific language governing permissions and limitations | ||
# under the License. | ||
|
||
- name: Run prepare playbook | ||
ansible.builtin.import_playbook: ../default/prepare.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
--- | ||
- name: Ensure we know about kernel version | ||
when: | ||
- ansible_facts['kernel'] is undefined | ||
ansible.builtin.setup: | ||
gather_subset: | ||
- '!all,!min' | ||
- 'kernel' | ||
|
||
- name: Ensure kpatch package is installed | ||
become: true | ||
ansible.builtin.package: | ||
name: kpatch | ||
state: present | ||
|
||
- name: Install kpatch-patch if available # noqa: package-latest | ||
failed_when: false | ||
become: true | ||
ansible.builtin.package: | ||
name: "kpatch-patch = {{ ansible_facts['kernel'] }}" | ||
state: latest | ||
|
||
- name: Ensure further update stages will not update kernel | ||
vars: | ||
_kernel: | ||
- kernel | ||
- kernel-core | ||
ansible.builtin.set_fact: | ||
_exclude_packages: "{{ edpm_update_exclude_packages + _kernel }}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters