選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

223 行
7.2KB

  1. _host_vars_filename: partitioning
  2. _host_vars_default: {}
  3. _host_vars:
  4. hard_disks: "{{ hard_disks }}"
  5. mdraid_devices: "{{ _mdraid_devices[partitioning_profile] }}"
  6. dmcrypt_devices: "{{ _dmcrypt_devices[partitioning_profile] }}"
  7. volume_groups: "{{ _volume_groups[partitioning_profile] }}"
  8. logical_volumes: "{{ _logical_volumes[partitioning_profile] }}"
  9. filesystems: "{{ _filesystems[partitioning_profile] }}"
  10. swap_devices: "{{ _swap_devices[partitioning_profile] }}"
  11. debian_boot_packages: "{{ _debian_boot_packages[partitioning_profile] | union(_debian_boot_packages_all) }}"
  12. _debian_boot_packages_all:
  13. - linux-image-amd64
  14. - busybox-static
  15. - openssh-server
  16. - python
  17. - console-setup
  18. - acpi-support
  19. - bridge-utils
  20. _debian_boot_packages:
  21. efi-dmcrypt-lvm:
  22. - busybox-static
  23. - lvm2
  24. - cryptsetup
  25. - btrfs-tools
  26. - grub-efi-amd64
  27. - efibootmgr
  28. efi-mdraid-lvm:
  29. - busybox-static
  30. - mdadm
  31. - lvm2
  32. - btrfs-tools
  33. - grub-efi-amd64
  34. - efibootmgr
  35. bios-mbr-dmcrypt-lvm:
  36. - busybox-static
  37. - lvm2
  38. - cryptsetup
  39. - btrfs-tools
  40. - grub-pc
  41. bios-gpt-mdraid-lvm:
  42. - busybox-static
  43. - mdadm
  44. - lvm2
  45. - btrfs-tools
  46. - grub-pc
  47. _label_type:
  48. efi-mdraid-lvm: gpt
  49. efi-dmcrypt-lvm: gpt
  50. bios-mbr-dmcrypt-lvm: msdos
  51. bios-gpt-mdraid-lvm: gpt
  52. _dmcrypt_device_name: "{{inventory_hostname_short}}-crypt0"
  53. _volume_group_name: "{{inventory_hostname_short}}-vg0"
  54. _select_partlabel: "{{inventory_hostname_short}}-select"
  55. _efi_partlabel: "{{inventory_hostname_short}}-efi"
  56. _mdraid_devices:
  57. bios-mbr-dmcrypt-lvm: []
  58. efi-dmcrypt-lvm: []
  59. bios-gpt-mdraid-lvm:
  60. - device: /dev/md/vg0
  61. devices: "{{ hard_disks | json_query(\"[].partitions[?mdraid=='vg0'][].name\") | map('regex_replace','(.*)','/dev/disk/by-partlabel/\\1') | list }}"
  62. - device: /dev/md/boot
  63. devices: "{{ hard_disks | json_query(\"[].partitions[?mdraid=='boot'][].name\") | map('regex_replace','(.*)','/dev/disk/by-partlabel/\\1') | list }}"
  64. - device: /dev/md/rescue
  65. devices: "{{ hard_disks | json_query(\"[].partitions[?mdraid=='rescue'][].name\") | map('regex_replace','(.*)','/dev/disk/by-partlabel/\\1') | list }}"
  66. efi-mdraid-lvm:
  67. - device: /dev/md/vg0
  68. devices: "{{ hard_disks | json_query(\"[].partitions[?mdraid=='vg0'][].name\") | map('regex_replace','(.*)','/dev/disk/by-partlabel/\\1') | list }}"
  69. - device: /dev/md/boot
  70. devices: "{{ hard_disks | json_query(\"[].partitions[?mdraid=='boot'][].name\") | map('regex_replace','(.*)','/dev/disk/by-partlabel/\\1') | list }}"
  71. - device: /dev/md/rescue
  72. devices: "{{ hard_disks | json_query(\"[].partitions[?mdraid=='rescue'][].name\") | map('regex_replace','(.*)','/dev/disk/by-partlabel/\\1') | list }}"
  73. _dmcrypt_devices:
  74. efi-mdraid-lvm: []
  75. bios-gpt-mdraid-lvm: []
  76. efi-dmcrypt-lvm:
  77. - device: "{{ _crypt_device[partitioning_profile] }}"
  78. name: "{{inventory_hostname}}-crypt0"
  79. cipher: aes-xts-plain64
  80. hash: sha512
  81. key_size: 512
  82. _crypt_device:
  83. #bios-dmcrypt-lvm: "{{ hard_disk_device }}-part4"
  84. efi-dmcrypt-lvm: /dev/disk/by-partlabel/{{inventory_hostname}}-crypt
  85. bios-gpt-mdraid-lvm: []
  86. _volume_groups:
  87. bios-mbr-dmcrypt-lvm:
  88. - name: "{{_volume_group_name}}"
  89. devices:
  90. - /dev/mapper/{{_dmcrypt_device_name}}
  91. efi-dmcrypt-lvm:
  92. - name: "{{_volume_group_name}}"
  93. devices:
  94. - /dev/mapper/{{_dmcrypt_device_name}}
  95. bios-gpt-mdraid-lvm:
  96. - name: "{{_volume_group_name}}"
  97. devices:
  98. - /dev/md/vg0
  99. efi-mdraid-lvm:
  100. - name: "{{_volume_group_name}}"
  101. devices:
  102. - /dev/md/vg0
  103. _logical_volumes_default:
  104. - name: root
  105. size: 32G
  106. volume_group: "{{_volume_group_name}}"
  107. - name: swap
  108. size: 2G
  109. volume_group: "{{_volume_group_name}}"
  110. #- name: home
  111. # size: 100%FREE
  112. # volume_group: vg
  113. _logical_volumes:
  114. bios-mbr-dmcrypt-lvm: "{{_logical_volumes_default}}"
  115. efi-dmcrypt-lvm: "{{_logical_volumes_default}}"
  116. bios-gpt-mdraid-lvm: "{{_logical_volumes_default}}"
  117. efi-mdraid-lvm: "{{_logical_volumes_default}}"
  118. _fs_uuid_root: "{{ lookup('pipe','uuid -v5 '+filesystem_uuid_namespace+' root') }}"
  119. _fs_uuid_boot: "{{ lookup('pipe','uuid -v5 '+filesystem_uuid_namespace+' boot') }}"
  120. _fs_uuid_rescue: "{{ lookup('pipe','uuid -v5 '+filesystem_uuid_namespace+' rescue') }}"
  121. _fs_uuid_select: "{{ lookup('pipe','uuid -v5 '+filesystem_uuid_namespace+' select') }}"
  122. _fs_uuid_swap: "{{ lookup('pipe','uuid -v5 '+filesystem_uuid_namespace+' swap') }}"
  123. _filesystems:
  124. #bios-mbr-dmcrypt-lvm:
  125. # - device: /dev/vg/root
  126. # mount_point: /
  127. # fstype: btrfs
  128. # uuid: "{{ _fs_uuid_root }}"
  129. # - device: "{{ hard_disk_device }}-part2"
  130. # mount_point: /boot
  131. # fstype: btrfs
  132. # uuid: "{{ _fs_uuid_boot }}"
  133. # - device: "{{ hard_disk_device }}-part3"
  134. # mount_point: /boot/rescue
  135. # fstype: btrfs
  136. # uuid: "{{ _fs_uuid_rescue }}"
  137. # - device: "{{ hard_disk_device }}-part1"
  138. # mount_point: /boot/select
  139. # fstype: btrfs
  140. # uuid: "{{ _fs_uuid_select }}"
  141. efi-dmcrypt-lvm:
  142. - device: /dev/{{_volume_group_name}}/root
  143. mount_point: /
  144. fstype: btrfs
  145. uuid: "{{ _fs_uuid_root }}"
  146. - device: /dev/disk/by-partlabel/{{inventory_hostname}}-boot
  147. mount_point: /boot
  148. fstype: btrfs
  149. uuid: "{{ _fs_uuid_boot }}"
  150. - device: /dev/disk/by-partlabel/{{inventory_hostname}}-rescue
  151. mount_point: /boot/rescue
  152. fstype: btrfs
  153. uuid: "{{ _fs_uuid_rescue }}"
  154. - device: /dev/disk/by-partlabel/{{inventory_hostname}}-select
  155. mount_point: /boot/select
  156. fstype: btrfs
  157. uuid: "{{ _fs_uuid_select }}"
  158. - device: /dev/disk/by-partlabel/{{_efi_partlabel}}
  159. mount_point: /boot/efi
  160. fstype: vfat
  161. bios-gpt-mdraid-lvm:
  162. - device: /dev/{{_volume_group_name}}/root
  163. mount_point: /
  164. fstype: btrfs
  165. uuid: "{{ _fs_uuid_root }}"
  166. - device: /dev/md/boot
  167. mount_point: /boot
  168. fstype: btrfs
  169. uuid: "{{ _fs_uuid_boot }}"
  170. - device: /dev/md/rescue
  171. mount_point: /boot/rescue
  172. fstype: btrfs
  173. uuid: "{{ _fs_uuid_rescue }}"
  174. - device: /dev/disk/by-partlabel/{{_select_partlabel}}
  175. mount_point: /boot/select
  176. fstype: btrfs
  177. uuid: "{{ _fs_uuid_select }}"
  178. efi-mdraid-lvm:
  179. - device: /dev/{{_volume_group_name}}/root
  180. mount_point: /
  181. fstype: btrfs
  182. uuid: "{{ _fs_uuid_root }}"
  183. - device: /dev/md/boot
  184. mount_point: /boot
  185. fstype: btrfs
  186. uuid: "{{ _fs_uuid_boot }}"
  187. - device: /dev/md/rescue
  188. mount_point: /boot/rescue
  189. fstype: btrfs
  190. uuid: "{{ _fs_uuid_rescue }}"
  191. - device: /dev/disk/by-partlabel/{{_select_partlabel}}
  192. mount_point: /boot/select
  193. fstype: btrfs
  194. uuid: "{{ _fs_uuid_select }}"
  195. - device: /dev/disk/by-partlabel/{{_efi_partlabel}}
  196. mount_point: /boot/efi
  197. fstype: vfat
  198. _swap_devices:
  199. bios-mbr-dmcrypt-lvm:
  200. - device: /dev/{{_volume_group_name}}/swap
  201. uuid: "{{ _fs_uuid_swap }}"
  202. efi-dmcrypt-lvm:
  203. - device: /dev/{{_volume_group_name}}/swap
  204. uuid: "{{ _fs_uuid_swap }}"
  205. bios-gpt-mdraid-lvm:
  206. - device: /dev/{{_volume_group_name}}/swap
  207. uuid: "{{ _fs_uuid_swap }}"
  208. efi-mdraid-lvm:
  209. - device: /dev/{{_volume_group_name}}/swap
  210. uuid: "{{ _fs_uuid_swap }}"