You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

166 lines
5.8KB

  1. _host_vars_filename: partitioning
  2. _host_vars:
  3. hard_disks: "{{ hard_disks }}"
  4. mdraid_devices: "{{ _mdraid_devices[partitioning_profile] }}"
  5. dmcrypt_devices: "{{ _dmcrypt_devices[partitioning_profile] }}"
  6. volume_groups: "{{ _volume_groups[partitioning_profile] }}"
  7. logical_volumes: "{{ _logical_volumes[partitioning_profile] }}"
  8. filesystems: "{{ _filesystems[partitioning_profile] }}"
  9. _label_type:
  10. efi-mdraid-lvm: gpt
  11. efi-dmcrypt-lvm: gpt
  12. bios-mbr-dmcrypt-lvm: msdos
  13. bios-gpt-mdraid-lvm: gpt
  14. _dmcrypt_device_name: "{{inventory_hostname_short}}-crypt0"
  15. _volume_group_name: "{{inventory_hostname_short}}-vg0"
  16. _select_partlabel: "{{inventory_hostname_short}}-select"
  17. _efi_partlabel: "{{inventory_hostname_short}}-efi"
  18. _mdraid_devices:
  19. bios-mbr-dmcrypt-lvm: []
  20. efi-dmcrypt-lvm: []
  21. bios-gpt-mdraid-lvm:
  22. - device: /dev/md/vg0
  23. devices: "{{ hard_disks | json_query(\"[].partitions[?mdraid=='vg0'][].name\") | map('regex_replace','(.*)','/dev/disk/by-partlabel/\\1') | list }}"
  24. - device: /dev/md/boot
  25. devices: "{{ hard_disks | json_query(\"[].partitions[?mdraid=='boot'][].name\") | map('regex_replace','(.*)','/dev/disk/by-partlabel/\\1') | list }}"
  26. - device: /dev/md/rescue
  27. devices: "{{ hard_disks | json_query(\"[].partitions[?mdraid=='rescue'][].name\") | map('regex_replace','(.*)','/dev/disk/by-partlabel/\\1') | list }}"
  28. efi-mdraid-lvm:
  29. - device: /dev/md/vg0
  30. devices: "{{ hard_disks | json_query(\"[].partitions[?mdraid=='vg0'][].name\") | map('regex_replace','(.*)','/dev/disk/by-partlabel/\\1') | list }}"
  31. - device: /dev/md/boot
  32. devices: "{{ hard_disks | json_query(\"[].partitions[?mdraid=='boot'][].name\") | map('regex_replace','(.*)','/dev/disk/by-partlabel/\\1') | list }}"
  33. - device: /dev/md/rescue
  34. devices: "{{ hard_disks | json_query(\"[].partitions[?mdraid=='rescue'][].name\") | map('regex_replace','(.*)','/dev/disk/by-partlabel/\\1') | list }}"
  35. _dmcrypt_devices:
  36. efi-mdraid-lvm: []
  37. bios-gpt-mdraid-lvm: []
  38. #- device: "{{ _crypt_device[partitioning_profile] }}"
  39. # name: "{{inventory_hostname}}-crypt0"
  40. # cipher: aes-xts-plain64
  41. # hash: sha512
  42. # key_size: 512
  43. #_crypt_device:
  44. #bios-dmcrypt-lvm: "{{ hard_disk_device }}-part4"
  45. #efi-dmcrypt-lvm: /dev/disk/by-partlabel/{{inventory_hostname}}-crypt
  46. _volume_groups:
  47. bios-mbr-dmcrypt-lvm:
  48. - name: "{{_volume_group_name}}"
  49. devices:
  50. - /dev/mapper/{{_dmcrypt_device_name}}
  51. efi-dmcrypt-lvm:
  52. - name: "{{_volume_group_name}}"
  53. devices:
  54. - /dev/mapper/{{_dmcrypt_device_name}}
  55. bios-gpt-mdraid-lvm:
  56. - name: "{{_volume_group_name}}"
  57. devices:
  58. - /dev/md/vg0
  59. efi-mdraid-lvm:
  60. - name: "{{_volume_group_name}}"
  61. devices:
  62. - /dev/md/vg0
  63. _logical_volumes_default:
  64. - name: root
  65. size: 32G
  66. volume_group: "{{_volume_group_name}}"
  67. - name: swap
  68. size: 2G
  69. volume_group: "{{_volume_group_name}}"
  70. #- name: home
  71. # size: 100%FREE
  72. # volume_group: vg
  73. _logical_volumes:
  74. bios-mbr-dmcrypt-lvm: "{{_logical_volumes_default}}"
  75. efi-dmcrypt-lvm: "{{_logical_volumes_default}}"
  76. bios-gpt-mdraid-lvm: "{{_logical_volumes_default}}"
  77. efi-mdraid-lvm: "{{_logical_volumes_default}}"
  78. _fs_uuid_root: "{{ lookup('pipe','uuid -v5 '+filesystem_uuid_namespace+' root') }}"
  79. _fs_uuid_boot: "{{ lookup('pipe','uuid -v5 '+filesystem_uuid_namespace+' boot') }}"
  80. _fs_uuid_rescue: "{{ lookup('pipe','uuid -v5 '+filesystem_uuid_namespace+' rescue') }}"
  81. _fs_uuid_select: "{{ lookup('pipe','uuid -v5 '+filesystem_uuid_namespace+' select') }}"
  82. _filesystems:
  83. #bios-mbr-dmcrypt-lvm:
  84. # - device: /dev/vg/root
  85. # mount_point: /
  86. # fstype: btrfs
  87. # uuid: "{{ _fs_uuid_root }}"
  88. # - device: "{{ hard_disk_device }}-part2"
  89. # mount_point: /boot
  90. # fstype: btrfs
  91. # uuid: "{{ _fs_uuid_boot }}"
  92. # - device: "{{ hard_disk_device }}-part3"
  93. # mount_point: /boot/rescue
  94. # fstype: btrfs
  95. # uuid: "{{ _fs_uuid_rescue }}"
  96. # - device: "{{ hard_disk_device }}-part1"
  97. # mount_point: /boot/select
  98. # fstype: btrfs
  99. # uuid: "{{ _fs_uuid_select }}"
  100. efi-dmcrypt-lvm:
  101. - device: /dev/{{_volume_group_name}}/root
  102. mount_point: /
  103. fstype: btrfs
  104. uuid: "{{ _fs_uuid_root }}"
  105. - device: /dev/disk/by-partlabel/{{inventory_hostname}}-boot
  106. mount_point: /boot
  107. fstype: btrfs
  108. uuid: "{{ _fs_uuid_boot }}"
  109. - device: /dev/disk/by-partlabel/{{inventory_hostname}}-rescue
  110. mount_point: /boot/rescue
  111. fstype: btrfs
  112. uuid: "{{ _fs_uuid_rescue }}"
  113. - device: /dev/disk/by-partlabel/{{inventory_hostname}}-select
  114. mount_point: /boot/select
  115. fstype: btrfs
  116. uuid: "{{ _fs_uuid_select }}"
  117. - device: /dev/disk/by-partlabel/{{_efi_partlabel}}
  118. mount_point: /boot/efi
  119. fstype: vfat
  120. bios-gpt-mdraid-lvm:
  121. - device: /dev/{{_volume_group_name}}/root
  122. mount_point: /
  123. fstype: btrfs
  124. uuid: "{{ _fs_uuid_root }}"
  125. - device: /dev/md/boot
  126. mount_point: /boot
  127. fstype: btrfs
  128. uuid: "{{ _fs_uuid_boot }}"
  129. - device: /dev/md/rescue
  130. mount_point: /boot/rescue
  131. fstype: btrfs
  132. uuid: "{{ _fs_uuid_rescue }}"
  133. - device: /dev/disk/by-partlabel/{{_select_partlabel}}
  134. mount_point: /boot/select
  135. fstype: btrfs
  136. uuid: "{{ _fs_uuid_select }}"
  137. efi-mdraid-lvm:
  138. - device: /dev/{{_volume_group_name}}/root
  139. mount_point: /
  140. fstype: btrfs
  141. uuid: "{{ _fs_uuid_root }}"
  142. - device: /dev/md/boot
  143. mount_point: /boot
  144. fstype: btrfs
  145. uuid: "{{ _fs_uuid_boot }}"
  146. - device: /dev/md/rescue
  147. mount_point: /boot/rescue
  148. fstype: btrfs
  149. uuid: "{{ _fs_uuid_rescue }}"
  150. - device: /dev/disk/by-partlabel/{{_select_partlabel}}
  151. mount_point: /boot/select
  152. fstype: btrfs
  153. uuid: "{{ _fs_uuid_select }}"
  154. - device: /dev/disk/by-partlabel/{{_efi_partlabel}}
  155. mount_point: /boot/efi
  156. fstype: vfat