Ansible playbook that implements https://github.com/zfsonlinux/zfs/wiki/Ubuntu-18.04-Root-on-ZFS
- Edit
ansible/vars.ymlwith your desired settings. - Run
packer build -on-error=ask ubuntu-zfs-{{ mbr || efi }}.jsonto test the playbook in a Virtualbox machine. - The last provisioner is simply a shell provisioner that runs
false, so you can examine the resulting system once the playbook has completed. - Playbook hasn't yet been tested on real hardware, will report back with more commits
- it should go without saying, but trying to run this on real hardware will result in data loss
zfsprep_zap_disks: true- forcibly nuke any partitions on existing diskszfsprep_legacy_device_nodes- set totrueto use/dev/sdXdevice names instead ofby-idzfsprep_root_pool- root pool namezfsprep_data_pool- data pool name (separate from root pool)zfsprep_efi: true- Use EFI layout, install grub-efi instead of grub-pc. Set tofalseto install grub-pc insteadzfsprep_luks- LUKS supportzfsprep_luks_flags- flags to pass to luksFormatzfsprep_luks_passphrase- passphrase for luksFormat/luksOpenzfsprep_hostname- short and FQDN hostnames to configure in the target OSzfsprep_root_disks- target disks for root poolzfsprep_data_disks- target disks for data poolzfsprep_root_pool_type- pool type for root poolzfsprep_data_pool_type- pool type for data poolzfsprep_extra_locales- list of extra locales to install alongsideen_US.UTF-8zfsprep_lang-LANGto set in/etc/default/localezfsprep_timezone- timezone to set in resulting OS (defaults toUTC)
a few more in ansible/roles/01-system-prep/defaults/main.yml