-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpost_upgrade.yml
38 lines (30 loc) · 997 Bytes
/
post_upgrade.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# Oracle Linux Automation Manager
#
# Copyright (c) 2023 Oracle and/or its affiliates.
# Licensed under the Universal Permissive License v 1.0 as shown at
# https://oss.oracle.com/licenses/upl.
#
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
#
# Description: Removes residual Oracle Linux 7 packages
#
- name: Post Upgrade
hosts: all
become: yes # Enable privilege escalation
tasks:
- name: Display current release
ansible.builtin.shell: |
cat /etc/*release
uname -r
register: system_info
- name: Print current release and kernel
ansible.builtin.debug:
var: system_info.stdout_lines
- name: Check for residual Oracle Linux 7 packages
shell: "rpm -qa | grep el7 "
register: ol7_packages
changed_when: false
- name: Remove residual Leapp packages
command: "dnf remove -y {{ item }}"
with_items: "{{ ol7_packages.stdout_lines }}"
when: ol7_packages.stdout_lines | length > 0