From 1b5f7ea0b516686fdd444b82f8090c30b9e25aed Mon Sep 17 00:00:00 2001 From: "Andreas B. Mundt" Date: Fri, 12 Nov 2021 12:42:40 +0100 Subject: [PATCH] Minor fixes and improvements. --- roles/educontainer/tasks/main.yml | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/roles/educontainer/tasks/main.yml b/roles/educontainer/tasks/main.yml index 52d31ca..46b8f5c 100644 --- a/roles/educontainer/tasks/main.yml +++ b/roles/educontainer/tasks/main.yml @@ -11,6 +11,7 @@ - name: stop all containers command: machinectl stop {{ contname }}{{ "%02d" | format(item|int) }} + register: stop_cont loop: "{{ containers | reverse}}" tags: - never @@ -18,6 +19,16 @@ - reset - purge +- name: wait for containers to shut down + pause: + seconds: 30 + when: stop_cont.changed | default(false) + tags: + - never + - stop + - reset + - purge + - name: purge all containers command: machinectl remove {{ contname }}{{ "%02d" | format(item|int) }} loop: "{{ containers | reverse }}" @@ -33,6 +44,7 @@ tags: - never - reset + - purge - name: start all containers command: machinectl start {{ contname }}{{ "%02d" | format(item|int) }} @@ -48,7 +60,7 @@ command: cmd: > debootstrap - --include=systemd-container,openssh-server,sudo,python3 + --include=systemd-container,openssh-server,sudo,python3,auto-apt-proxy --components=main,contrib,non-free stable {{ contname }}00 http://deb.debian.org/debian args: @@ -63,6 +75,11 @@ dest: /var/lib/machines/{{ contname }}00/etc/apt/sources.list remote_src: yes +- name: configure locale + lineinfile: + path: /var/lib/machines/{{ contname }}00/etc/profile + line: 'export LANG=C' + - name: upgrade container command: cmd: > @@ -93,7 +110,7 @@ path: /var/lib/machines/{{ contname }}00/etc/ssh/sshd_config insertafter: '#PermitEmptyPasswords no' line: 'PermitEmptyPasswords yes' - # when: user_account.changed | default(false) + when: user_account.changed | default(false) - name: prepare directories file: