File tree Expand file tree Collapse file tree 3 files changed +42
-0
lines changed Expand file tree Collapse file tree 3 files changed +42
-0
lines changed Original file line number Diff line number Diff line change 295295 - name : Configure instance
296296 ansible.builtin.include_tasks : " host_setup.yml"
297297
298+ - name : Update all rpm packages
299+ ansible.builtin.import_playbook : update_all_rpms.yml
300+ when : update_all
301+
298302- name : Provision KVM server
299303 ansible.builtin.import_playbook : provision_kvm.yml
300304 when : use_kvm
Original file line number Diff line number Diff line change @@ -36,4 +36,5 @@ vm_net: default
3636vm_root_pass :
3737cleanup_tmp : no
3838
39+ update_all : false
3940use_podman : false
Original file line number Diff line number Diff line change 1+ ---
2+ # Copyright (c) 2024 Oracle and/or its affiliates.
3+ # This software is made available to you under the terms of the Universal Permissive License (UPL), Version 1.0.
4+ # The Universal Permissive License (UPL), Version 1.0 (see COPYING or https://oss.oracle.com/licenses/upl)
5+ # See LICENSE.TXT for details.
6+
7+ - name : Install latest Oracle Linux packages
8+ hosts : server
9+ vars_files :
10+ - default_vars.yml
11+ become : true
12+
13+ tasks :
14+
15+ - name : Update all Oracle Linux packages
16+ ansible.builtin.dnf :
17+ name : " *"
18+ state : latest
19+ update_only : true
20+ when : ansible_distribution == 'OracleLinux'
21+
22+ - name : Check if a reboot is required
23+ ansible.builtin.command : /usr/bin/needs-restarting -r
24+ register : reboot_required
25+ ignore_errors : true
26+ changed_when : false
27+ failed_when : reboot_required.rc == 2
28+ when : ansible_distribution == 'OracleLinux'
29+
30+ - name : Print reboot is required
31+ ansible.builtin.debug :
32+ var : reboot_required
33+ when : debug_enabled
34+
35+ - name : Reboot (if needed) to apply latest kernel and updates
36+ ansible.builtin.reboot :
37+ when : ansible_distribution == 'OracleLinux' and reboot_required.rc == 1
You can’t perform that action at this time.
0 commit comments