diff options
-rw-r--r-- | ansible.vmdb | 29 | ||||
-rw-r--r-- | lvm2.vmdb | 29 |
2 files changed, 33 insertions, 25 deletions
diff --git a/ansible.vmdb b/ansible.vmdb index 4e96e7f..1378024 100644 --- a/ansible.vmdb +++ b/ansible.vmdb @@ -12,33 +12,38 @@ steps: device: "{{ output }}" start: 0% end: 100% - part-tag: root-part + tag: / + - kpartx: "{{ output }}" + - mkfs: ext4 - partition: root-part + partition: / + + - mount: / - - mount: root-part - fs-tag: root-fs - - - unpack-rootfs: root-fs + - unpack-rootfs: / - debootstrap: stretch mirror: http://deb.debian.org/debian - target: root-fs + target: / unless: rootfs_unpacked - apt: install packages: - linux-image-amd64 - - python - fs-tag: root-fs + fs-tag: / unless: rootfs_unpacked - - cache-rootfs: root-fs + - apt: install + packages: + - python + fs-tag: / + + - cache-rootfs: / unless: rootfs_unpacked - - ansible: root-fs + - ansible: / playbook: ansible.yml - grub: bios - tag: root-fs + tag: / @@ -2,46 +2,42 @@ # system that boots on a PC with BIOS. Uses LVM2. steps: - - mkimg: "{{ image }}" + - mkimg: "{{ output }}" size: 4G - mklabel: msdos - device: "{{ image }}" + device: "{{ output }}" - mkpart: primary - device: "{{ image }}" + device: "{{ output }}" start: 1M end: 100M tag: /boot - mkpart: primary - device: "{{ image }}" + device: "{{ output }}" start: 100M end: 2G - tag: /rootpv + tag: rootpv - - cryptsetup: /rootpv - tag: rootpv_crypt - key-cmd: echo lvm2.lukskey + - kpartx: "{{ output }}" - vgcreate: rootvg physical: - - rootpv_crypt + - rootpv - lvcreate: rootvg name: rootfs size: 1G - mkfs: ext2 - partition: boot + partition: /boot - mkfs: ext4 partition: rootfs - mount: /boot - - mount: /boot - - mount: rootfs - unpack-rootfs: rootfs @@ -60,12 +56,19 @@ steps: - cache-rootfs: rootfs unless: rootfs_unpacked + # - apt: install + # packages: + # - lvm2 + # tag: rootfs + - chroot: rootfs shell: | sed -i '/^root:[^:]*:/s//root::/' /etc/passwd echo pc-vmdb2 > /etc/hostname +# vgdisplay +# lvdisplay - grub: bios tag: rootfs - image-dev: "{{ image }}" + image-dev: "{{ output }}" console: serial |