-
Notifications
You must be signed in to change notification settings - Fork 3
/
playbook.yml
57 lines (44 loc) · 1.29 KB
/
playbook.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
---
- name: Install a new debian system
hosts: external
vars:
zfs_system_root_name: "{{ ansible_distribution | lower }}-{{ ansible_distribution_release }}"
handlers:
- name: Restart sshd
systemd:
name: sshd
state: restarted
tasks:
- name: Ensure the debian version is defined
assert:
that:
- ansible_distribution_release is defined
- ansible_distribution_release != "n/a"
- name: Setup the live environment
ansible.builtin.import_tasks: tasks/setup_live_environment.yml
- name: Install the system
ansible.builtin.import_tasks: tasks/install_system.yml
- name: Install a new debian system
hosts: external
vars:
ansible_port: 8922
zfs_system_root_name: "{{ ansible_distribution | lower }}-{{ ansible_distribution_release }}"
tasks:
- name: Setup the system
ansible.builtin.import_tasks: tasks/setup_system.yml
- name: Cleanup post installation
hosts: external
tasks:
- name: Unmount filesystems
command: umount /mnt/{{ item }}
loop:
- boot/efi
- dev
- proc
- run
- tmp
- sys/firmware/efi/efivars
- sys
# FIXME: Running it with become fails?
- name: Export zfs filesystems
command: sudo zpool export -a