add support for raid-config

This commit is contained in:
Alexander Gabriel 2022-11-28 23:04:03 +01:00
parent f7a6479c51
commit 6328e907ae
2 changed files with 42 additions and 4 deletions

View File

@ -16,6 +16,34 @@ Variables:
* debianunattended_proxystring: http://hostname:port * debianunattended_proxystring: http://hostname:port
* debianunattended_mirror: ftp.de.debian.org * debianunattended_mirror: ftp.de.debian.org
* debianunattended_ntpserver: ntp.domain.tld * debianunattended_ntpserver: ntp.domain.tld
* debianunattended_partmanauto_method: regular
* debianunattended_partman-auto_method: raid
* debianunattended_partman_disk1: vda
* debianunattended_partman_disk2: vdb
* debianunattended_partman-auto_disk: /dev/{{ debianunattended_partman_disk1 }} /dev/{{ debianunattended_partman_disk2 }}
* debianunattended_partman-auto_expert_recipe | default('')
* debianunattended_partman-auto-raid_recipe | default('')
```
RAID1-Example on 2 disks:
debianunattended_partman_auto_method: raid
debianunattended_raid_disk1: vda
debianunattended_raid_disk2: vdb
debianunattended_partman_auto_disk: /dev/{{ debianunattended_raid_disk1 }} /dev/{{ debianunattended_raid_disk2 }}
debianunattended_partman_auto_expert_recipe: |
d-i partman-auto/expert_recipe string \
multiraid :: \
8192 8192 8192 raid $primary{ } $bootable{ } method{ raid } . \
8192 8192 -1 raid method{ raid } . \
8192 8192 8192 raid method{ raid } .
debianunattended_partman_auto_raid_recipe: |
d-i partman-auto-raid/recipe string \
1 2 0 ext3 /boot /dev/{{ debianunattended_raid_disk1 }}1#/dev/{{ debianunattended_raid_disk2 }}1 . \
1 2 0 ext3 / /dev/{{ debianunattended_raid_disk1 }}5#/dev/{{ debianunattended_raid_disk2 }}5 . \
1 2 0 swap - /dev/{{ debianunattended_raid_disk1 }}6#/dev/{{ debianunattended_raid_disk2 }}6 .
```
#backup-ip-address for environment without dhcp #backup-ip-address for environment without dhcp
* debianunattended_staticip_ipaddress: 192.168.1.42 * debianunattended_staticip_ipaddress: 192.168.1.42
* debianunattended_staticip_netmask: 255.255.255.0 * debianunattended_staticip_netmask: 255.255.255.0
@ -23,4 +51,6 @@ Variables:
* debianunattended_staticip_nameservers: 192.168.1.1 * debianunattended_staticip_nameservers: 192.168.1.1
* debianunattended_mirror: ftp.de.debian.org * debianunattended_mirror: ftp.de.debian.org
Many Thanks to https://www.librebyte.net/en/systems-deployment/unattended-debian-installation/ Many Thanks to
* https://www.librebyte.net/en/systems-deployment/unattended-debian-installation
* https://www.bishnet.net/tim/blog/2015/01/29/understanding-partman-autoexpert_recipe

View File

@ -171,7 +171,7 @@ d-i clock-setup/ntp-server string {{ debianunattended_ntpserver }}
# - regular: use the usual partition types for your architecture # - regular: use the usual partition types for your architecture
# - lvm: use LVM to partition the disk # - lvm: use LVM to partition the disk
# - crypto: use LVM within an encrypted partition # - crypto: use LVM within an encrypted partition
d-i partman-auto/method string regular d-i partman-auto/method string {{ debianunattended_partman_auto_method | default('regular') }}
# You can define the amount of space that will be used for the LVM volume # You can define the amount of space that will be used for the LVM volume
# group. It can either be a size with its unit (eg. 20 GB), a percentage of # group. It can either be a size with its unit (eg. 20 GB), a percentage of
@ -192,8 +192,9 @@ d-i partman-lvm/confirm_nooverwrite boolean true
# - atomic: all files in one partition # - atomic: all files in one partition
# - home: separate /home partition # - home: separate /home partition
# - multi: separate /home, /var, and /tmp partitions # - multi: separate /home, /var, and /tmp partitions
{% if debianunattended_partman_auto_expert_recipe is not defined %}
d-i partman-auto/choose_recipe select atomic d-i partman-auto/choose_recipe select atomic
{% endif %}
# Or provide a recipe of your own... # Or provide a recipe of your own...
# If you have a way to get a recipe file into the d-i environment, you can # If you have a way to get a recipe file into the d-i environment, you can
# just point at it. # just point at it.
@ -261,8 +262,12 @@ d-i partman/confirm_nooverwrite boolean true
# Specify the disks to be partitioned. They will all get the same layout, # Specify the disks to be partitioned. They will all get the same layout,
# so this will only work if the disks are the same size.preseed # so this will only work if the disks are the same size.preseed
#d-i partman-auto/disk string /dev/sda /dev/sdb #d-i partman-auto/disk string /dev/sda /dev/sdb
{% if debianunattended_partman_auto_disk is defined %}
d-i partman-auto/disk string {{ debianunattended_partman_auto_disk }}
{% endif %}
# Next you need to specify the physical partitions that will be used. # Next you need to specify the physical partitions that will be used.
{{ debianunattended_partman_auto_expert_recipe | default('') }}
#d-i partman-auto/expert_recipe string \ #d-i partman-auto/expert_recipe string \
# multiraid :: \ # multiraid :: \
# 1000 5000 4000 raid \ # 1000 5000 4000 raid \
@ -283,6 +288,7 @@ d-i partman/confirm_nooverwrite boolean true
# <raidtype> <devcount> <sparecount> <fstype> <mountpoint> \ # <raidtype> <devcount> <sparecount> <fstype> <mountpoint> \
# <devices> <sparedevices> # <devices> <sparedevices>
{{ debianunattended_partman_auto_raid_recipe | default('') }}
#d-i partman-auto-raid/recipe string \ #d-i partman-auto-raid/recipe string \
# 1 2 0 ext3 / \ # 1 2 0 ext3 / \
# /dev/sda1#/dev/sdb1 \ # /dev/sda1#/dev/sdb1 \
@ -304,6 +310,8 @@ d-i partman-partitioning/confirm_write_new_label boolean true
d-i partman/choose_partition select finish d-i partman/choose_partition select finish
d-i partman/confirm boolean true d-i partman/confirm boolean true
d-i partman/confirm_nooverwrite boolean true d-i partman/confirm_nooverwrite boolean true
d-i partman/confirm_nochanges boolean true
d-i partman-md/confirm_nooverwrite boolean true
## Controlling how partitions are mounted ## Controlling how partitions are mounted
# The default is to mount by UUID, but you can also choose "traditional" to # The default is to mount by UUID, but you can also choose "traditional" to
@ -400,7 +408,7 @@ d-i grub-installer/with_other_os boolean true
# not be determined safely in general, so this needs to be specified: # not be determined safely in general, so this needs to be specified:
#d-i grub-installer/bootdev string /dev/sda #d-i grub-installer/bootdev string /dev/sda
# To install to the primary device (assuming it is not a USB stick): # To install to the primary device (assuming it is not a USB stick):
d-i grub-installer/bootdev string default d-i grub-installer/bootdev string {{ debianunattended_partman_auto_disk | default('default') }}
# Alternatively, if you want to install to a location other than the UEFI # Alternatively, if you want to install to a location other than the UEFI
# parition/boot record, uncomment and edit these lines: # parition/boot record, uncomment and edit these lines: