Clark Boylan 2b37cf7a9e Force cgroupfs cgroup manager with podman on ubuntu
Per https://github.com/containers/podman-compose/issues/209 it seems
this is a known thing with non root containers, podman, and Ubuntu. Just
apply the necessary woraround in a config file so that we don't have to
be aware of it every time we try to use podman in this way. It also
makes using podman-compose simpler.

Change-Id: Ic024e242d99b7f0d4fbd4cf2c3489022b364672d
2023-05-18 14:25:52 -07:00

39 lines
1.2 KiB
YAML

- name: Add kubic project repository
include_role:
name: ensure-package-repositories
vars:
repositories_keys:
- url: "https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_{{ ansible_distribution_version }}/Release.key"
repositories_list:
- repo: "deb https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_{{ ansible_distribution_version }}/ /"
- name: Install podman
package:
name:
- podman
- uidmap
- slirp4netns
- fuse-overlayfs
- containernetworking-plugins
state: present
become: yes
# NOTE(pabelanger): Remove default registries.conf file, so we can manage it
# ourself. It could have v1 syntax, which doesn't work with v2.
- name: Remove /etc/containers/registries.conf
become: true
file:
state: absent
path: /etc/containers/registries.conf
- name: Create containers config dir
file:
path: '{{ ansible_user_dir }}/.config/containers'
state: directory
- name: Force cgroup manager to cgroupfs for Ubuntu
copy:
content: |
[engine]
cgroup_manager = "cgroupfs"
dest: '{{ ansible_user_dir }}/.config/containers/containers.conf'