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
|
- name: stop all containers
|
||||||
command: machinectl stop {{ contname }}{{ "%02d" | format(item|int) }}
|
command: machinectl stop {{ contname }}{{ "%02d" | format(item|int) }}
|
||||||
|
register: stop_cont
|
||||||
loop: "{{ containers | reverse}}"
|
loop: "{{ containers | reverse}}"
|
||||||
tags:
|
tags:
|
||||||
- never
|
- never
|
||||||
|
@ -18,6 +19,16 @@
|
||||||
- reset
|
- reset
|
||||||
- purge
|
- 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
|
- name: purge all containers
|
||||||
command: machinectl remove {{ contname }}{{ "%02d" | format(item|int) }}
|
command: machinectl remove {{ contname }}{{ "%02d" | format(item|int) }}
|
||||||
loop: "{{ containers | reverse }}"
|
loop: "{{ containers | reverse }}"
|
||||||
|
@ -33,6 +44,7 @@
|
||||||
tags:
|
tags:
|
||||||
- never
|
- never
|
||||||
- reset
|
- reset
|
||||||
|
- purge
|
||||||
|
|
||||||
- name: start all containers
|
- name: start all containers
|
||||||
command: machinectl start {{ contname }}{{ "%02d" | format(item|int) }}
|
command: machinectl start {{ contname }}{{ "%02d" | format(item|int) }}
|
||||||
|
@ -48,7 +60,7 @@
|
||||||
command:
|
command:
|
||||||
cmd: >
|
cmd: >
|
||||||
debootstrap
|
debootstrap
|
||||||
--include=systemd-container,openssh-server,sudo,python3
|
--include=systemd-container,openssh-server,sudo,python3,auto-apt-proxy
|
||||||
--components=main,contrib,non-free stable
|
--components=main,contrib,non-free stable
|
||||||
{{ contname }}00 http://deb.debian.org/debian
|
{{ contname }}00 http://deb.debian.org/debian
|
||||||
args:
|
args:
|
||||||
|
@ -63,6 +75,11 @@
|
||||||
dest: /var/lib/machines/{{ contname }}00/etc/apt/sources.list
|
dest: /var/lib/machines/{{ contname }}00/etc/apt/sources.list
|
||||||
remote_src: yes
|
remote_src: yes
|
||||||
|
|
||||||
|
- name: configure locale
|
||||||
|
lineinfile:
|
||||||
|
path: /var/lib/machines/{{ contname }}00/etc/profile
|
||||||
|
line: 'export LANG=C'
|
||||||
|
|
||||||
- name: upgrade container
|
- name: upgrade container
|
||||||
command:
|
command:
|
||||||
cmd: >
|
cmd: >
|
||||||
|
@ -93,7 +110,7 @@
|
||||||
path: /var/lib/machines/{{ contname }}00/etc/ssh/sshd_config
|
path: /var/lib/machines/{{ contname }}00/etc/ssh/sshd_config
|
||||||
insertafter: '#PermitEmptyPasswords no'
|
insertafter: '#PermitEmptyPasswords no'
|
||||||
line: 'PermitEmptyPasswords yes'
|
line: 'PermitEmptyPasswords yes'
|
||||||
# when: user_account.changed | default(false)
|
when: user_account.changed | default(false)
|
||||||
|
|
||||||
- name: prepare directories
|
- name: prepare directories
|
||||||
file:
|
file:
|
||||||
|
|
Loading…
Add table
Reference in a new issue