Skip to content

Commit 5068657

Browse files
authored
Merge pull request #24 from bgraef/main
add podman and update to ol deployment
2 parents 1d8dd84 + 554e3e2 commit 5068657

File tree

4 files changed

+81
-1
lines changed

4 files changed

+81
-1
lines changed

ol/create_instance.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -295,10 +295,18 @@
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

ol/default_vars.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,7 @@ vm_vcpus: 2
3434
vm_ram_mb: 2048
3535
vm_net: default
3636
vm_root_pass:
37-
cleanup_tmp: no
37+
cleanup_tmp: no
38+
39+
update_all: false
40+
use_podman: false

ol/provision_podman.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
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'

ol/update_all_rpms.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
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

0 commit comments

Comments
 (0)