refactor: consolidate all roles into ansible/roles/ and update ansible.cfg
- Move all roles from playbooks/roles/ to roles/ - Update roles_path in ansible.cfg - Add cast user to common role - Create standalone podman role - Add semaphore role with Podman + Quadlet support
This commit is contained in:
18
ansible/roles/podman/defaults/main.yml
Normal file
18
ansible/roles/podman/defaults/main.yml
Normal file
@@ -0,0 +1,18 @@
|
||||
---
|
||||
podman_packages:
|
||||
- podman
|
||||
- fuse-overlayfs
|
||||
- slirp4netns
|
||||
- containernetworking-plugins
|
||||
|
||||
# Rootless user
|
||||
podman_rootless_user: cast
|
||||
|
||||
# Registries
|
||||
podman_registries:
|
||||
- prefix: "docker.io"
|
||||
location: "docker.io"
|
||||
- prefix: "quay.io"
|
||||
location: "quay.io"
|
||||
- prefix: "ghcr.io"
|
||||
location: "ghcr.io"
|
||||
49
ansible/roles/podman/tasks/main.yml
Normal file
49
ansible/roles/podman/tasks/main.yml
Normal file
@@ -0,0 +1,49 @@
|
||||
---
|
||||
- name: Install Podman and dependencies
|
||||
ansible.builtin.package:
|
||||
name: "{{ podman_packages }}"
|
||||
state: present
|
||||
|
||||
- name: Enable lingering for rootless user
|
||||
ansible.builtin.command:
|
||||
cmd: loginctl enable-linger {{ podman_rootless_user }}
|
||||
changed_when: false
|
||||
ignore_errors: true
|
||||
|
||||
- name: Configure subuid for rootless user
|
||||
ansible.builtin.lineinfile:
|
||||
path: /etc/subuid
|
||||
line: "{{ podman_rootless_user }}:100000:65536"
|
||||
create: yes
|
||||
mode: '0644'
|
||||
|
||||
- name: Configure subgid for rootless user
|
||||
ansible.builtin.lineinfile:
|
||||
path: /etc/subgid
|
||||
line: "{{ podman_rootless_user }}:100000:65536"
|
||||
create: yes
|
||||
mode: '0644'
|
||||
|
||||
- name: Create Quadlet directory
|
||||
ansible.builtin.file:
|
||||
path: /etc/containers/systemd
|
||||
state: directory
|
||||
owner: root
|
||||
group: root
|
||||
mode: '0755'
|
||||
|
||||
- name: Deploy containers.conf
|
||||
ansible.builtin.template:
|
||||
src: containers.conf.j2
|
||||
dest: /etc/containers/containers.conf
|
||||
owner: root
|
||||
group: root
|
||||
mode: '0644'
|
||||
|
||||
- name: Deploy registries.conf
|
||||
ansible.builtin.template:
|
||||
src: registries.conf.j2
|
||||
dest: /etc/containers/registries.conf
|
||||
owner: root
|
||||
group: root
|
||||
mode: '0644'
|
||||
9
ansible/roles/podman/templates/containers.conf.j2
Normal file
9
ansible/roles/podman/templates/containers.conf.j2
Normal file
@@ -0,0 +1,9 @@
|
||||
[containers]
|
||||
dns = ["sundial.local.mk-labs.cloud"]
|
||||
pids_limit = 2048
|
||||
log_driver = "journald"
|
||||
|
||||
[engine]
|
||||
runtime = "crun"
|
||||
cgroup_manager = "systemd"
|
||||
events_logger = "journald"
|
||||
13
ansible/roles/podman/templates/registries.conf.j2
Normal file
13
ansible/roles/podman/templates/registries.conf.j2
Normal file
@@ -0,0 +1,13 @@
|
||||
unqualified-search-registries = ["docker.io"]
|
||||
|
||||
[[registry]]
|
||||
prefix = "docker.io"
|
||||
location = "docker.io"
|
||||
|
||||
[[registry]]
|
||||
prefix = "quay.io"
|
||||
location = "quay.io"
|
||||
|
||||
[[registry]]
|
||||
prefix = "ghcr.io"
|
||||
location = "ghcr.io"
|
||||
Reference in New Issue
Block a user