|
| 1 | +--- |
| 2 | +# Copyright 2024 Red Hat, Inc. |
| 3 | +# All Rights Reserved. |
| 4 | +# |
| 5 | +# Licensed under the Apache License, Version 2.0 (the "License"); you may |
| 6 | +# not use this file except in compliance with the License. You may obtain |
| 7 | +# a copy of the License at |
| 8 | +# |
| 9 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | +# |
| 11 | +# Unless required by applicable law or agreed to in writing, software |
| 12 | +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
| 13 | +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
| 14 | +# License for the specific language governing permissions and limitations |
| 15 | +# under the License. |
| 16 | + |
| 17 | + |
| 18 | +- name: Converge |
| 19 | + hosts: all |
| 20 | + gather_facts: false |
| 21 | + tasks: |
| 22 | + - name: "Call edpm_update role" |
| 23 | + ansible.builtin.include_role: |
| 24 | + name: osp.edpm.edpm_update |
| 25 | + vars: |
| 26 | + edpm_update_enable_containers_update: false |
| 27 | + edpm_service_types: [] |
| 28 | + edpm_update_enable_kpatch: true |
| 29 | + |
| 30 | + # We have to run the verifications in this play to |
| 31 | + # ensure we have access to the internally changed |
| 32 | + # facts. |
| 33 | + - name: Conduct some verifications |
| 34 | + block: |
| 35 | + - name: Ensure kernel related packages are excluded |
| 36 | + ansible.builtin.assert: |
| 37 | + that: |
| 38 | + - _exclude_packages is defined |
| 39 | + - "'kernel' in _exclude_packages" |
| 40 | + - "'kernel-core' in _exclude_packages" |
| 41 | + |
| 42 | + - name: Gather all installed packages |
| 43 | + ansible.builtin.package_facts: |
| 44 | + |
| 45 | + - name: Check service status if we have kpatch-patch installed |
| 46 | + when: |
| 47 | + - ansible_facts.packages["kpatch-patch"] is defined |
| 48 | + block: |
| 49 | + - name: Gather services |
| 50 | + ansible.builtin.service_facts: |
| 51 | + |
| 52 | + - name: Ensure kpatch.service is running |
| 53 | + ansible.builtin.assert: |
| 54 | + that: |
| 55 | + - ansible_facts.services['kpatch.service'] is defined |
| 56 | + - ansible_facts.services['kpatch.service'].state == 'running' |
| 57 | + - ansible_facts.services['kpatch.service'].status == 'enabled' |
0 commit comments