aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@osmocom.org>2020-11-18 17:39:17 +0100
committerHarald Welte <laforge@osmocom.org>2020-11-18 22:57:07 +0100
commitcf9625379a26a5a0659ad855ad0e723f10941223 (patch)
tree08f9ce8daf4f8ca2c22188ecb340304a93fbcfeb
parent8edbe0f134e5a909f2a25a542c4a814d9ef23e38 (diff)
ansible: add role for 'podman'
podman has one particularly interesting feature which docker rejected years ago: The ability to run a container in a pre-existing namespace. This is quite useful for some of our test setups, particularly those that involve hdlc net-devices Change-Id: I4b14599f39c07ec83fa4222f9d040d443caae3e6
-rw-r--r--ansible/roles/podman/tasks/debian.yml33
-rw-r--r--ansible/roles/podman/tasks/main.yml7
2 files changed, 40 insertions, 0 deletions
diff --git a/ansible/roles/podman/tasks/debian.yml b/ansible/roles/podman/tasks/debian.yml
new file mode 100644
index 0000000..907d75c
--- /dev/null
+++ b/ansible/roles/podman/tasks/debian.yml
@@ -0,0 +1,33 @@
+---
+
+- name: add apt https support
+ apt:
+ cache_valid_time: 3600
+ update_cache: yes
+ pkg:
+ - apt-transport-https
+ - gnupg
+ - cron
+ - ca-certificates
+ when: ansible_distribution_major_version < 11
+
+- name: add docker gpg key to apt keyring
+ apt_key:
+ id: 2472D6D0D2F66AF87ABA8DA34D64390375060AA4
+ url: https://ftp.uni-stuttgart.de/opensuse/repositories/devel:/kubic:/libcontainers:/stable/Debian_{{ ansible_distribution_version }}/Release.key
+ when: ansible_distribution_major_version < 11
+
+- apt_repository:
+ repo: "deb https://ftp.uni-stuttgart.de/opensuse/repositories/devel:/kubic:/libcontainers:/stable/Debian_{{ ansible_distribution_version }}/ /"
+ state: present
+ update_cache: yes
+ when: ansible_distribution_major_version < 11
+
+- name: install podman
+ apt:
+ pkg:
+ - podman
+ - runc
+ - buildah
+ - skopeo
+ - dnsmasq
diff --git a/ansible/roles/podman/tasks/main.yml b/ansible/roles/podman/tasks/main.yml
new file mode 100644
index 0000000..049f5c2
--- /dev/null
+++ b/ansible/roles/podman/tasks/main.yml
@@ -0,0 +1,7 @@
+---
+
+- name: Include tasks for Debian
+ include_tasks: debian.yml
+ when: (ansible_distribution in ['Debian', 'Raspbian'])
+
+# TODO: add other distributions below