nilsmeyer / ansible-debootstrap

An ansible role for bootstrapping new Debian based systems, including setting up partitions, file systems, encryption (luks), RAID and LVM
GNU Lesser General Public License v3.0
35 stars 19 forks source link

Creating the swap area in a logical volume (LVM) #26

Open Gounick opened 4 years ago

Gounick commented 4 years ago

Hi, I really love your role Ansible! It is particularly suitable for my setup where the Debian installer can not do it.

Could you add swap support under LVM (mkswap and append to fstab) please ?

Here are my dictionaries:

release: buster
layout:
  - device: '/dev/sda'
    partitions:
      - num: 1
        size: 1M
        type: ef02
        label: BIOS
      - num: 2
        size: 100M
        type: ef00
        fs: vfat
        mount: /boot/efi
        mountdump: 0
        mountpass: 1
        mountopts: noatime,nofail,x-systemd.device-timeout=1,umask=0077
        label: EFI
      - num: 3
        size: 250M
        type: 8300
        fs: xfs
        mount: /boot
        mountdump: 0
        mountpass: 2
        mountopts: noatime,nodev,nosuid
        label: BOOT

lvm:
  - lv: swap
    vg: vg-srv
    pvs: /dev/sdb
    size: 1G
    opts: ~
    label: swap
    fs: swap
    mount: none
    mountdump: 0
    mountpass: 0
    mountopts: sw
  - lv: os
    vg: vg-srv
    pvs: /dev/sdb
    size: 15G
    opts: ~
    label: os
    fs: xfs
    mount: /
    mountdump: 0
    mountpass: 1
    mountopts: noatime,nodev

Thank you in advance

nilsmeyer commented 4 years ago

Thank you for your feature request, I think this should be fairly simple to implement, I hope I can get around to it soon.