Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add podman and update to ol deployment #24

Merged
merged 2 commits into from
Jul 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions ol/create_instance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -295,10 +295,18 @@
- name: Configure instance
ansible.builtin.include_tasks: "host_setup.yml"

- name: Update all rpm packages
ansible.builtin.import_playbook: update_all_rpms.yml
when: update_all

- name: Provision KVM server
ansible.builtin.import_playbook: provision_kvm.yml
when: use_kvm

- name: Provision Podman and Container Tools
ansible.builtin.import_playbook: provision_podman.yml
when: use_podman

- name: Print instances
hosts: all
become: true
Expand Down
5 changes: 4 additions & 1 deletion ol/default_vars.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,7 @@ vm_vcpus: 2
vm_ram_mb: 2048
vm_net: default
vm_root_pass:
cleanup_tmp: no
cleanup_tmp: no

update_all: false
use_podman: false
32 changes: 32 additions & 0 deletions ol/provision_podman.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
# Copyright (c) 2024 Oracle and/or its affiliates.
# This software is made available to you under the terms of the Universal Permissive License (UPL), Version 1.0.
# The Universal Permissive License (UPL), Version 1.0 (see COPYING or https://oss.oracle.com/licenses/upl)
# See LICENSE.TXT for details.

- name: Install Podman and Container Tools
hosts: server
vars_files:
- default_vars.yml
become: true

tasks:

- name: Install Oracle Linux 8 container tools packages
ansible.builtin.dnf:
name:
- "@container-tools:ol8"
- conntrack
- curl
state: present
when: ansible_distribution == 'OracleLinux' and ansible_distribution_major_version == '8'

- name: Install Oracle Linux 9 container tools packages
ansible.builtin.dnf:
name:
- podman
- podman-docker
- conntrack
- curl
state: present
when: ansible_distribution == 'OracleLinux' and ansible_distribution_major_version == '9'
37 changes: 37 additions & 0 deletions ol/update_all_rpms.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
# Copyright (c) 2024 Oracle and/or its affiliates.
# This software is made available to you under the terms of the Universal Permissive License (UPL), Version 1.0.
# The Universal Permissive License (UPL), Version 1.0 (see COPYING or https://oss.oracle.com/licenses/upl)
# See LICENSE.TXT for details.

- name: Install latest Oracle Linux packages
hosts: server
vars_files:
- default_vars.yml
become: true

tasks:

- name: Update all Oracle Linux packages
ansible.builtin.dnf:
name: "*"
state: latest
update_only: true
when: ansible_distribution == 'OracleLinux'

- name: Check if a reboot is required
ansible.builtin.command: /usr/bin/needs-restarting -r
register: reboot_required
ignore_errors: true
changed_when: false
failed_when: reboot_required.rc == 2
when: ansible_distribution == 'OracleLinux'

- name: Print reboot is required
ansible.builtin.debug:
var: reboot_required
when: debug_enabled

- name: Reboot (if needed) to apply latest kernel and updates
ansible.builtin.reboot:
when: ansible_distribution == 'OracleLinux' and reboot_required.rc == 1