Minor fixes and improvements.
This commit is contained in:
parent
426a6e8895
commit
1b5f7ea0b5
1 changed files with 19 additions and 2 deletions
|
@ -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:
|
||||
|
|
Loading…
Add table
Reference in a new issue