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

145 行
3.2KB

  1. [
  2. {#
  3. {% if not hard_disks is defined %}
  4. {% for device in ansible_devices.keys() %}
  5. {% set name = device %}
  6. {% set device = '/dev/' + device %}
  7. {% endif %}
  8. #}
  9. {% for hd in hard_disks %}
  10. {% set first_device = (hard_disks | first) == hd %}
  11. {% set name = hd.name %}
  12. {% set device = hd.device %}
  13. {
  14. "device": "{{device}}",
  15. "name": "{{name}}",
  16. "label_type": "{{ _label_type[partitioning_profile] }}",
  17. "partitions":
  18. [
  19. {% set partition_name_prefix = inventory_hostname_short + '-' + name %}
  20. {% if partitioning_profile == "bios-mbr-dmcrypt-lvm" %}
  21. {
  22. "part_type": "primary",
  23. "fs_type": "btrfs",
  24. "start": "768MiB",
  25. "end": "1GiB"
  26. }
  27. {
  28. "part_type": "primary",
  29. "fs_type": "btrfs",
  30. "start": "1GiB",
  31. "end": "2GiB"
  32. }
  33. {
  34. "part_type": "primary",
  35. "fs_type": "btrfs",
  36. "start": "2GiB",
  37. "end": "6GiB"
  38. }
  39. {
  40. "part_type": "primary",
  41. "start": "6GiB",
  42. "end": "{{ partitioning_profile_last_partition_end }}"
  43. }
  44. {% endif %}
  45. {% if partitioning_profile == "efi-dmcrypt-lvm" %}
  46. {
  47. "part_type": "ESP",
  48. "start": "256MiB",
  49. "end": "768MiB"
  50. },
  51. {
  52. "name": "select",
  53. "start": "768MiB",
  54. "end": "1GiB"
  55. },
  56. {
  57. "name": "{{partition_name_prefix}}-boot",
  58. "typecode": "8300",
  59. "start": "1GiB",
  60. "end": "2GiB"
  61. },
  62. {
  63. "name": "{{partition_name_prefix}}-rescue",
  64. "typecode": "8300",
  65. "start": "2GiB",
  66. "end": "6GiB"
  67. },
  68. {
  69. "name": "{{partition_name_prefix}}-crypt",
  70. "typecode": "8300",
  71. "start": "6GiB",
  72. "end": "{{ partitioning_profile_last_partition_end }}"
  73. }
  74. {% endif %}
  75. {% if partitioning_profile == "bios-gpt-mdraid-lvm" %}
  76. {
  77. "name": "bios_boot",
  78. "start": "2MiB",
  79. "end": "4MiB",
  80. "flags": ["bios_grub"]
  81. },
  82. {% if first_device %}
  83. {
  84. "name": "{{_select_partlabel}}",
  85. "start": "768MiB",
  86. "end": "1GiB"
  87. },
  88. {% endif %}
  89. {
  90. "name": "{{partition_name_prefix}}-boot-md",
  91. "start": "1GiB",
  92. "end": "2GiB",
  93. "mdraid": "boot"
  94. },
  95. {
  96. "name": "{{partition_name_prefix}}-rescue-md",
  97. "start": "2GiB",
  98. "end": "6GiB",
  99. "mdraid": "rescue"
  100. },
  101. {
  102. "name": "{{partition_name_prefix}}-vg0-md",
  103. "start": "6GiB",
  104. "end": "{{ partitioning_profile_last_partition_end }}",
  105. "mdraid": "vg0"
  106. }
  107. {% endif %}
  108. {% if partitioning_profile == "efi-mdraid-lvm" %}
  109. {% if first_device %}
  110. {
  111. "name": "{{_efi_partlabel}}",
  112. "start": "256MiB",
  113. "end": "768MiB",
  114. "flags": ["boot"]
  115. },
  116. {
  117. "name": "{{_select_partlabel}}",
  118. "start": "768MiB",
  119. "end": "1GiB"
  120. },
  121. {% endif %}
  122. {
  123. "name": "{{partition_name_prefix}}-boot-md",
  124. "start": "1GiB",
  125. "end": "2GiB",
  126. "mdraid": "boot"
  127. },
  128. {
  129. "name": "{{partition_name_prefix}}-rescue-md",
  130. "start": "2GiB",
  131. "end": "6GiB",
  132. "mdraid": "rescue"
  133. },
  134. {
  135. "name": "{{partition_name_prefix}}-vg0-md",
  136. "start": "6GiB",
  137. "end": "{{ partitioning_profile_last_partition_end }}",
  138. "mdraid": "vg0"
  139. }
  140. {% endif %}
  141. ]
  142. },
  143. {% endfor %}
  144. ]