2020-10-01 00:59:50 +00:00
|
|
|
---
|
|
|
|
- name: ensure podman group
|
|
|
|
group:
|
|
|
|
name: podman
|
|
|
|
state: present
|
|
|
|
system: True
|
|
|
|
|
|
|
|
- name: ensure podman user
|
|
|
|
user:
|
|
|
|
name: podman
|
|
|
|
state: present
|
|
|
|
group: podman
|
|
|
|
system: True
|
|
|
|
|
|
|
|
- name: ensure podman is installed
|
|
|
|
apt:
|
2021-08-16 01:30:56 +00:00
|
|
|
name:
|
2022-03-26 22:06:26 +00:00
|
|
|
- catatonit
|
2021-08-16 01:30:56 +00:00
|
|
|
- fuse-overlayfs
|
2021-09-09 02:39:07 +00:00
|
|
|
- podman
|
|
|
|
- slirp4netns
|
2021-08-16 01:30:56 +00:00
|
|
|
- uidmap
|
2020-10-01 00:59:50 +00:00
|
|
|
state: present
|
|
|
|
|
2021-09-09 02:39:07 +00:00
|
|
|
- name: ensure containers.conf is configured
|
2022-03-26 22:06:26 +00:00
|
|
|
copy:
|
2021-09-09 02:39:07 +00:00
|
|
|
src: containers.conf
|
|
|
|
dest: /etc/containers/containers.conf
|
|
|
|
owner: root
|
|
|
|
group: root
|
|
|
|
mode: 0644
|
|
|
|
|
2022-03-26 22:06:26 +00:00
|
|
|
- name: Check if podman lingers
|
|
|
|
stat: path=/var/lib/systemd/linger/podman
|
|
|
|
register: linger
|
|
|
|
|
|
|
|
- name: enable lingering for podman
|
|
|
|
command: loginctl enable-linger podman
|
|
|
|
when: not linger.stat.exists
|
|
|
|
|
2021-08-16 01:30:56 +00:00
|
|
|
- name: enable podman
|
|
|
|
systemd:
|
|
|
|
name: podman
|
|
|
|
state: started
|
2022-03-26 22:06:26 +00:00
|
|
|
enabled: True
|
|
|
|
scope: user
|
|
|
|
changed_when: False
|
|
|
|
become: True
|
|
|
|
become_user: podman
|
|
|
|
|
|
|
|
- name: check if subuid is configured
|
|
|
|
shell: grep podman /etc/subuid
|
|
|
|
register: subuid
|
2021-08-16 01:30:56 +00:00
|
|
|
changed_when: False
|
2022-03-26 22:06:26 +00:00
|
|
|
check_mode: False
|
|
|
|
failed_when: False
|
|
|
|
|
|
|
|
- name: check if subgid is configured
|
|
|
|
shell: grep podman /etc/subgid
|
|
|
|
register: subgid
|
|
|
|
changed_when: False
|
|
|
|
check_mode: False
|
|
|
|
failed_when: False
|
|
|
|
|
|
|
|
- name: configure subuid
|
|
|
|
shell: usermod --add-subuids 200000-201000 podman
|
|
|
|
when: subuid.rc != 0
|
|
|
|
|
|
|
|
- name: configure subgid
|
|
|
|
shell: usermod --add-subgids 200000-201000 podman
|
|
|
|
when: subgid.rc != 0
|
2020-10-01 00:59:50 +00:00
|
|
|
...
|