Make sure stuff exists when needed.

This commit is contained in:
Andreas B. Mundt 2021-11-16 20:39:23 +01:00 committed by Andreas B. Mundt
parent 85836e311e
commit 90d340a1d5
2 changed files with 17 additions and 1 deletions

View file

@ -29,9 +29,13 @@
contpwd: ""
## Adjust the number of containers here:
containers: "{{ range(0, 9 + 1) | list }}"
extra_pkgs: [apt-cacher-ng]
pre_tasks:
- name: install apt-cacher-ng
apt:
name: apt-cacher-ng
state: latest
- name: enable apt-cacher-ng
lineinfile:
path: /etc/apt/apt.conf.d/30proxy

View file

@ -56,6 +56,13 @@
###########
- name: install packages
apt:
name:
- systemd-container
- debootstrap
state: latest
- name: debootstrap minimal system
command:
cmd: >
@ -153,6 +160,11 @@
loop: "{{ containers[1:] }}"
notify: enable and restart containers
- name: prepare nspawn config directory
file:
path: /etc/systemd/nspawn
state: directory
- name: provide container configuration
template:
src: contcfg.nspawn.j2