# Passwordless access isn't configured yet; use `ssh` connection sharing.
# `sudo` isn't configured yet too; use `su` and ask for root password.
-exec ansible-playbook debian/init-system.yml "$@" --become-method=su -Kv
+ansible-playbook debian/init-system.yml "$@" --become-method=su -K &&
+exec ./run-role debian/remove-systemd "$@"
--- /dev/null
+- name: "Configure apt: pin down SystemD packages"
+ become: true
+ copy:
+ src: etc
+ dest: /
+ owner: root
+ group: root
+ mode: '0640'
+
+- name: Install SysV init
+ become: true
+ apt:
+ autoclean: yes
+ autoremove: yes
+ install_recommends: no
+ name: ['sysvinit-core', 'sysvinit-utils']
+ purge: yes
+ state: latest
+ update_cache: yes
+
+- name: Configure SysV init
+ become: true
+ copy:
+ src: /usr/share/sysvinit/inittab
+ remote_src: true
+ dest: /etc/inittab
+ owner: root
+ group: root
+ mode: '0644'
+
+- name: Purge SystemD
+ become: true
+ import_tasks: remove-systemd.yml
+ ignore_errors: true
+
+- name: Reboot if SystemD is still active
+ become: true
+ reboot:
+ when: purged.rc != 0
+
+- name: Purge SystemD after reboot
+ import_tasks: remove-systemd.yml
+ when: purged.rc != 0