File tree Expand file tree Collapse file tree 4 files changed +81
-1
lines changed Expand file tree Collapse file tree 4 files changed +81
-1
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
301305
306+ - name : Provision Podman and Container Tools
307+ ansible.builtin.import_playbook : provision_podman.yml
308+ when : use_podman
309+
302310- name : Print instances
303311 hosts : all
304312 become : true
Original file line number Diff line number Diff line change @@ -34,4 +34,7 @@ vm_vcpus: 2
3434vm_ram_mb : 2048
3535vm_net : default
3636vm_root_pass :
37- cleanup_tmp : no
37+ cleanup_tmp : no
38+
39+ update_all : false
40+ use_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 Podman and Container Tools
8+ hosts : server
9+ vars_files :
10+ - default_vars.yml
11+ become : true
12+
13+ tasks :
14+
15+ - name : Install Oracle Linux 8 container tools packages
16+ ansible.builtin.dnf :
17+ name :
18+ - " @container-tools:ol8"
19+ - conntrack
20+ - curl
21+ state : present
22+ when : ansible_distribution == 'OracleLinux' and ansible_distribution_major_version == '8'
23+
24+ - name : Install Oracle Linux 9 container tools packages
25+ ansible.builtin.dnf :
26+ name :
27+ - podman
28+ - podman-docker
29+ - conntrack
30+ - curl
31+ state : present
32+ when : ansible_distribution == 'OracleLinux' and ansible_distribution_major_version == '9'
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