summaryrefslogtreecommitdiff
path: root/roles/installer/debian/preseed/templates/partman_config.j2
blob: ca6feb417c9ed22e92d215307a7d742dc293257e (plain) (blame)
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
{# https://unix.stackexchange.com/questions/510445/install-grub-bootloader-dynamically-to-multiple-disks #}
d-i partman/early_command string /partman_early-command.sh

d-i partman/confirm boolean true
d-i partman/confirm_nooverwrite boolean true
d-i partman-md/device_remove_md boolean true
d-i partman-md/confirm boolean true
d-i partman-md/confirm_nooverwrite boolean true
d-i partman-lvm/device_remove_lvm boolean true
d-i partman-lvm/confirm boolean true
d-i partman-lvm/confirm_nooverwrite boolean true

d-i partman-auto/purge_lvm_from_device boolean true
d-i partman-auto-lvm/new_vg_name string {{ hostvars[install_hostname].host_name }}
d-i partman-auto-lvm/guided_size string max
d-i partman-auto-lvm/no_boot boolean true

{% if (hostvars[install_hostname].install_cooked.efi | default(false)) %}
d-i partman-efi/non_efi_system boolean true
d-i partman/choose_label string gpt
d-i partman/default_label string gpt
d-i partman-partitioning/choose_label string gpt
d-i partman-partitioning/default_label string gpt
d-i partman-basicfilesystems/choose_label string gpt
d-i partman-basicfilesystems/default_label string gpt
{% else %}
d-i partman/choose_label string msdos
d-i partman/default_label string msdos
d-i partman-partitioning/choose_label string msdos
d-i partman-partitioning/default_label string msdos
d-i partman-basicfilesystems/choose_label string msdos
d-i partman-basicfilesystems/default_label string msdos
{% endif %}


{% if hostvars[install_hostname].install_cooked.disks.primary == "software-raid" %}
d-i partman-auto/method string raid
{% else %}
d-i partman-auto/method string lvm
{% endif %}

d-i partman-auto/expert_recipe string                                                     \
      ansible ::                                                                          \
{% if (hostvars[install_hostname].install_cooked.efi | default(false)) %}
              128 128 128 fat16                                                           \
                      $primary{ } $bootable{ }                                            \
                      method{ efi } format{ }                                             \
              .                                                                           \
{% endif %}
{% if hostvars[install_hostname].install_cooked.disks.primary == "software-raid" %}
              256 256 256 raid                                                            \
                      $lvmignore{ } $primary{ } $bootable{ }                              \
                      method{ raid }                                                      \
              .                                                                           \
{%   if 'root_lvm_size' in hostvars[install_hostname].install_cooked.disks and hostvars[install_hostname].install_cooked.disks.root_lvm_size != 'all' %}
{%     set root_lvm_size = ((hostvars[install_hostname].install_cooked.disks.root_lvm_size | human_to_bytes) / (1024*1024)) | int %}
              {{ root_lvm_size }} {{ root_lvm_size }} {{ root_lvm_size }} raid            \
                      $lvmignore{ } $primary{ }                                           \
                      method{ raid }                                                      \
              .                                                                           \
              8 108 -1 ext4                                                               \
                      $lvmignore{ } $primary{ }                                           \
                      method{ unused }                                                    \
              .                                                                           \
{%   else %}
              5120 5120 5120 raid                                                         \
                      $lvmignore{ } $primary{ }                                           \
                      method{ raid }                                                      \
              .                                                                           \
{%   endif %}
{% else %}
{%   if 'root_lvm_size' in hostvars[install_hostname].install_cooked.disks and hostvars[install_hostname].install_cooked.disks.root_lvm_size != 'all' %}
{%     set root_lvm_size = ((hostvars[install_hostname].install_cooked.disks.root_lvm_size | human_to_bytes) / (1024*1024)) | int %}
              {{ root_lvm_size }} {{ root_lvm_size }} {{ root_lvm_size }} lvm             \
                      $defaultignore{ } $primary{ }                                       \
                      method{ lvm } vg_name{ {{ hostvars[install_hostname].host_name }} } \
              .                                                                           \
              8 108 -1 ext4                                                               \
                      $defaultignore{ } $primary{ }                                       \
                      method{ unused }                                                    \
              .                                                                           \
{%   else %}
              5120 5120 5120 lvm                                                          \
                      $defaultignore{ } $primary{ }                                       \
                      method{ lvm } vg_name{ {{ hostvars[install_hostname].host_name }} } \
              .                                                                           \
{%   endif %}
{% endif %}
              2560 2560 2560 ext4                                                         \
                      $defaultignore{ } $lvmok{ }                                         \
                      in_vg{ {{ hostvars[install_hostname].host_name }} }                 \
                      method{ format } format{ }                                          \
                      use_filesystem{ } filesystem{ ext4 }                                \
                      mountpoint{ / }                                                     \
              .                                                                           \
              1280 1280 1280 ext4                                                         \
                      $defaultignore{ } $lvmok{ }                                         \
                      in_vg{ {{ hostvars[install_hostname].host_name }} }                 \
                      method{ format } format{ }                                          \
                      use_filesystem{ } filesystem{ ext4 }                                \
                      mountpoint{ /var }                                                  \
              .                                                                           \
              768 768 768 ext4                                                            \
                      $defaultignore{ } $lvmok{ }                                         \
                      in_vg{ {{ hostvars[install_hostname].host_name }} }                 \
                      method{ format } format{ }                                          \
                      use_filesystem{ } filesystem{ ext4 }                                \
                      mountpoint{ /var/log }                                              \
                      options/nodev{ nodev }                                              \
                      options/noatime{ noatime }                                          \
                      options/noexec{ noexec }                                            \
              .                                                                           \
              8 108 -1 ext4                                                               \
                      $defaultignore{ } $lvmok{ }                                         \
                      in_vg{ {{ hostvars[install_hostname].host_name }} }                 \
                      lv_name{ dummy }                                                    \
                      method{ unused }                                                    \
              .



d-i partman-basicfilesystems/no_swap true
d-i partman-partitioning/confirm_write_new_label boolean true
d-i partman/choose_partition select finish


## boot devices are configured by partman/early_command
d-i grub-installer/only_debian boolean true
d-i grub-installer/with_other_os boolean true