This commit is contained in:
@@ -1,9 +1,7 @@
|
||||
---
|
||||
|
||||
- name: Install and configure Docker
|
||||
hosts:
|
||||
- ci_servers
|
||||
- ci_runners
|
||||
hosts: ci_servers
|
||||
become: true
|
||||
|
||||
roles:
|
||||
|
||||
@@ -0,0 +1,59 @@
|
||||
---
|
||||
|
||||
- name: Install and configure Podman
|
||||
hosts: ci_runners
|
||||
become: true
|
||||
|
||||
vars:
|
||||
# Packages common to both Debian and RHEL families
|
||||
podman_base_packages:
|
||||
- podman
|
||||
- podman-docker
|
||||
|
||||
# Debian/Ubuntu specific packages
|
||||
podman_debian_packages:
|
||||
- podman-compose
|
||||
|
||||
# RHEL-family specific packages (adjust or add epel-release if compose is needed)
|
||||
podman_rhel_packages: []
|
||||
|
||||
# Set to true if you need the Docker-compatible API socket (e.g., for Woodpecker CI)
|
||||
podman_enable_socket: true
|
||||
|
||||
tasks:
|
||||
- name: Gather distribution-specific facts
|
||||
ansible.builtin.setup:
|
||||
gather_subset:
|
||||
- "!all"
|
||||
- distribution
|
||||
- os_family
|
||||
|
||||
- name: Install Podman packages on Debian/Ubuntu
|
||||
ansible.builtin.apt:
|
||||
name: "{{ podman_base_packages + podman_debian_packages }}"
|
||||
state: present
|
||||
update_cache: true
|
||||
cache_valid_time: 3600
|
||||
when: ansible_facts['os_family'] == 'Debian'
|
||||
|
||||
- name: Install Podman packages on RHEL/Rocky/AlmaLinux/CentOS
|
||||
ansible.builtin.dnf:
|
||||
name: "{{ podman_base_packages + podman_rhel_packages }}"
|
||||
state: present
|
||||
when: ansible_facts['os_family'] == 'RedHat'
|
||||
|
||||
- name: Enable and start system-wide Podman socket
|
||||
ansible.builtin.systemd:
|
||||
name: podman.socket
|
||||
state: started
|
||||
enabled: true
|
||||
when: podman_enable_socket
|
||||
|
||||
- name: Verify Podman installation
|
||||
ansible.builtin.command: podman --version
|
||||
register: podman_version_output
|
||||
changed_when: false
|
||||
|
||||
- name: Show installed Podman version
|
||||
ansible.builtin.debug:
|
||||
msg: "Installed {{ podman_version_output.stdout }}"
|
||||
@@ -12,6 +12,8 @@
|
||||
import_playbook: munin.yml
|
||||
- name: Gitea
|
||||
import_playbook: gitea.yml
|
||||
- name: Podman
|
||||
import_playbook: podman.yml
|
||||
- name: Docker
|
||||
import_playbook: docker.yml
|
||||
- name: Apache
|
||||
|
||||
Reference in New Issue
Block a user