@@ -7,7 +7,8 @@ | |||||
- name: set base profile vars | - name: set base profile vars | ||||
set_fact: | set_fact: | ||||
debian_boot_packages: "{{ debian_boot_packages | union(_partitioning_base_profile.debian_boot_packages) }}" | |||||
debian_boot_packages: "{{ _partitioning_base_profile.debian_boot_packages }}" | |||||
grub_bootloader_target: "{{ _partitioning_base_profile.grub_bootloader_target }}" | |||||
- name: set hard disks base profile | - name: set hard disks base profile | ||||
set_fact: | set_fact: | ||||
@@ -8,8 +8,12 @@ | |||||
- import_tasks: crypt_profile.yml | - import_tasks: crypt_profile.yml | ||||
- import_tasks: profile.yml | |||||
- import_tasks: efi_filesystem.yml | - import_tasks: efi_filesystem.yml | ||||
- import_tasks: volumes.yml | |||||
- import_tasks: filesystems.yml | - import_tasks: filesystems.yml | ||||
- import_tasks: swap_devices.yml | - import_tasks: swap_devices.yml | ||||
@@ -0,0 +1,15 @@ | |||||
--- | |||||
- name: load profile vars | |||||
include_vars: | |||||
file: profile.yml | |||||
name: _partitioning_profile | |||||
- name: set profile vars | |||||
set_fact: | |||||
volume_groups: "{{ _partitioning_profile.volume_groups }}" | |||||
logical_volumes: "{{ _partitioning_profile.logical_volumes }}" | |||||
filesystems: "{{ _partitioning_profile.filesystems }}" | |||||
swap_devices: "{{ _partitioning_profile.swap_devices }}" | |||||
grub_cmdline_linux: "{{ _partitioning_profile.grub_cmdline_linux }}" | |||||
debian_boot_packages: "{{ debian_boot_packages|union(_partitioning_profile.debian_boot_packages) }}" |
@@ -0,0 +1,7 @@ | |||||
--- | |||||
- name: set additional logical volumes | |||||
set_fact: | |||||
logical_volumes: "{{lookup('template','logical_volumes.json.j2')}}" | |||||
filesystems: "{{lookup('template','logical_volume_filesystems.json.j2')}}" | |||||
when: partitioning_profile_volumes is defined |
@@ -0,0 +1,13 @@ | |||||
[ | |||||
{% for fs in filesystems %} | |||||
{{fs|to_json}}, | |||||
{% endfor %} | |||||
{% for vol in partitioning_profile_volumes %} | |||||
{% set fs = vol.fs %} | |||||
{% set fs = fs | combine({ | |||||
'label': vol.name, | |||||
'device': "/dev/"+primary_volume_group_name+"/"+vol.name | |||||
}) %} | |||||
{{fs|to_json}}, | |||||
{% endfor %} | |||||
] |
@@ -0,0 +1,13 @@ | |||||
[ | |||||
{% for lv in logical_volumes %} | |||||
{{lv|to_json}}, | |||||
{% endfor %} | |||||
{% for vol in partitioning_profile_volumes %} | |||||
{% set lv = vol.lv %} | |||||
{% set lv = lv | combine({ | |||||
'volume_group': primary_volume_group_name | |||||
}) %} | |||||
{% set lv = lv | combine({ 'name': vol.name }) %} | |||||
{{lv|to_json}}, | |||||
{% endfor %} | |||||
] |
@@ -27,3 +27,5 @@ partitions: | |||||
debian_boot_packages: | debian_boot_packages: | ||||
- grub-pc | - grub-pc | ||||
grub_bootloader_target: i386-pc |
@@ -16,3 +16,5 @@ partitions: | |||||
debian_boot_packages: | debian_boot_packages: | ||||
- grub-pc | - grub-pc | ||||
grub_bootloader_target: i386-pc |
@@ -31,3 +31,5 @@ partitions: | |||||
debian_boot_packages: | debian_boot_packages: | ||||
- efibootmgr | - efibootmgr | ||||
- grub-efi-amd64 | - grub-efi-amd64 | ||||
grub_bootloader_target: x86_64-efi |
@@ -1,53 +1,19 @@ | |||||
_host_vars_filename: partitioning | _host_vars_filename: partitioning | ||||
_host_vars_default: {} | _host_vars_default: {} | ||||
_host_vars: | _host_vars: | ||||
hard_disks: "{{ hard_disks }}" | |||||
mdraid_devices: "{{ mdraid_devices }}" | |||||
dmcrypt_devices: "{{ dmcrypt_devices }}" | |||||
volume_groups: "{{ volume_groups }}" | |||||
logical_volumes: "{{ logical_volumes }}" | |||||
filesystems: "{{ filesystems }}" | |||||
swap_devices: "{{ swap_devices }}" | |||||
hard_disks: "{{ hard_disks }}" | |||||
mdraid_devices: "{{ mdraid_devices }}" | |||||
dmcrypt_devices: "{{ dmcrypt_devices }}" | |||||
volume_groups: "{{ volume_groups }}" | |||||
logical_volumes: "{{ logical_volumes }}" | |||||
filesystems: "{{ filesystems }}" | |||||
swap_devices: "{{ swap_devices }}" | |||||
debian_boot_packages: "{{ debian_boot_packages }}" | debian_boot_packages: "{{ debian_boot_packages }}" | ||||
volume_groups: | |||||
- name: "{{primary_volume_group_name}}" | |||||
devices: | |||||
- "{{ system_device }}" | |||||
logical_volumes: | |||||
- name: root | |||||
size: "{{root_partition_default_size}}" | |||||
- name: swap | |||||
size: "{{swap_partition_default_size}}" | |||||
filesystems: | |||||
- device: "{{ boot_device }}" | |||||
mount_point: /boot | |||||
fstype: ext4 | |||||
- device: "{{ rescue_device }}" | |||||
mount_point: /rescue | |||||
fstype: btrfs | |||||
- device: /dev/{{primary_volume_group_name}}/root | |||||
mount_point: / | |||||
fstype: btrfs | |||||
grub_cmdline_linux: "{{ grub_cmdline_linux }}" | |||||
grub_bootloader_target: "{{ grub_bootloader_target }}" | |||||
_efi_partlabel: "{{inventory_hostname_short}}-efi" | _efi_partlabel: "{{inventory_hostname_short}}-efi" | ||||
_efi_filesystems: | _efi_filesystems: | ||||
- device: /dev/disk/by-partlabel/{{_efi_partlabel}} | - device: /dev/disk/by-partlabel/{{_efi_partlabel}} | ||||
mount_point: /boot/efi | mount_point: /boot/efi | ||||
fstype: vfat | fstype: vfat | ||||
swap_devices: | |||||
- device: /dev/{{primary_volume_group_name}}/swap | |||||
debian_boot_packages: | |||||
- linux-image-amd64 | |||||
- busybox-static | |||||
- e2fsprogs | |||||
- btrfs-tools | |||||
- openssh-server | |||||
- python | |||||
- console-setup | |||||
- acpi-support | |||||
- bridge-utils |
@@ -0,0 +1,41 @@ | |||||
volume_groups: | |||||
- name: "{{primary_volume_group_name}}" | |||||
devices: | |||||
- "{{ system_device }}" | |||||
logical_volumes: | |||||
- name: root | |||||
size: "{{root_partition_default_size}}" | |||||
volume_group: "{{primary_volume_group_name}}" | |||||
- name: swap | |||||
size: "{{swap_partition_default_size}}" | |||||
volume_group: "{{primary_volume_group_name}}" | |||||
filesystems: | |||||
- device: "{{ boot_device }}" | |||||
mount_point: /boot | |||||
fstype: ext4 | |||||
- device: "{{ rescue_device }}" | |||||
mount_point: /rescue | |||||
fstype: btrfs | |||||
- device: /dev/{{primary_volume_group_name}}/root | |||||
mount_point: / | |||||
fstype: btrfs | |||||
swap_devices: | |||||
- device: /dev/{{primary_volume_group_name}}/swap | |||||
grub_cmdline_linux: root=/dev/{{primary_volume_group_name}}/root | |||||
debian_boot_packages: | |||||
- linux-image-amd64 | |||||
- busybox-static | |||||
- lvm2 | |||||
- e2fsprogs | |||||
- btrfs-tools | |||||
- openssh-server | |||||
- python | |||||
- console-setup | |||||
- acpi-support | |||||
- bridge-utils |