Kaynağa Gözat

improvements

master
ebeveyn
işleme
a86c2cdfb6
11 değiştirilmiş dosya ile 110 ekleme ve 44 silme
  1. +2
    -1
      tasks/base_profile.yml
  2. +4
    -0
      tasks/main.yml
  3. +15
    -0
      tasks/profile.yml
  4. +7
    -0
      tasks/volumes.yml
  5. +13
    -0
      templates/logical_volume_filesystems.json.j2
  6. +13
    -0
      templates/logical_volumes.json.j2
  7. +2
    -0
      vars/base_profiles/bios-gpt.yml
  8. +2
    -0
      vars/base_profiles/bios-mbr.yml
  9. +2
    -0
      vars/base_profiles/efi.yml
  10. +9
    -43
      vars/main.yml
  11. +41
    -0
      vars/profile.yml

+ 2
- 1
tasks/base_profile.yml Dosyayı Görüntüle

@@ -7,7 +7,8 @@

- name: set base profile vars
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
set_fact:


+ 4
- 0
tasks/main.yml Dosyayı Görüntüle

@@ -8,8 +8,12 @@

- import_tasks: crypt_profile.yml

- import_tasks: profile.yml

- import_tasks: efi_filesystem.yml

- import_tasks: volumes.yml

- import_tasks: filesystems.yml

- import_tasks: swap_devices.yml


+ 15
- 0
tasks/profile.yml Dosyayı Görüntüle

@@ -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) }}"

+ 7
- 0
tasks/volumes.yml Dosyayı Görüntüle

@@ -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

+ 13
- 0
templates/logical_volume_filesystems.json.j2 Dosyayı Görüntüle

@@ -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 %}
]

+ 13
- 0
templates/logical_volumes.json.j2 Dosyayı Görüntüle

@@ -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 %}
]

+ 2
- 0
vars/base_profiles/bios-gpt.yml Dosyayı Görüntüle

@@ -27,3 +27,5 @@ partitions:

debian_boot_packages:
- grub-pc

grub_bootloader_target: i386-pc

+ 2
- 0
vars/base_profiles/bios-mbr.yml Dosyayı Görüntüle

@@ -16,3 +16,5 @@ partitions:

debian_boot_packages:
- grub-pc

grub_bootloader_target: i386-pc

+ 2
- 0
vars/base_profiles/efi.yml Dosyayı Görüntüle

@@ -31,3 +31,5 @@ partitions:
debian_boot_packages:
- efibootmgr
- grub-efi-amd64

grub_bootloader_target: x86_64-efi

+ 9
- 43
vars/main.yml Dosyayı Görüntüle

@@ -1,53 +1,19 @@
_host_vars_filename: partitioning
_host_vars_default: {}
_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 }}"

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_filesystems:
- device: /dev/disk/by-partlabel/{{_efi_partlabel}}
mount_point: /boot/efi
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

+ 41
- 0
vars/profile.yml Dosyayı Görüntüle

@@ -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

Yükleniyor…
İptal
Kaydet