
Builds ephemeral ISO and target host images. Also replaces isogen (iso-builder) with a single ansible-driven build tool for both types of airship images used: ephemeral ISO as well as target QCOW2 images deployed to base nodes. Change-Id: I6d0368de771869e4e645a03d8a20f470b34602ab
28 lines
926 B
YAML
28 lines
926 B
YAML
- name: "QCOW | Creating Partitions"
|
|
parted:
|
|
device: "{{ lookup('file', '/tmp/nbd') }}"
|
|
number: "{{ item.0 + 1 }}"
|
|
state: present
|
|
label: gpt
|
|
flags: "{{ item.1.flags | default(omit) }}"
|
|
part_start: "{{ item.1.part_start }}"
|
|
part_end: "{{ item.1.part_end }}"
|
|
name: "{{ item.1.mount | hash('md5') }}"
|
|
align: minimal
|
|
|
|
# For some reason, udev does not honor the partition label for by-partlabel symlinks, so we rename them here
|
|
- name: "QCOW | check for symlink"
|
|
stat:
|
|
path: /dev/disk/by-partlabel/primary
|
|
register: symlink
|
|
|
|
- name: "QCOW | udev symlink rename"
|
|
command: mv /dev/disk/by-partlabel/primary /dev/disk/by-partlabel/{{ item.1.mount | hash('md5') }}
|
|
when: symlink.stat.exists
|
|
|
|
- name: "QCOW | Creating Filesystems"
|
|
filesystem:
|
|
fstype: "{{ item.1.filesystem.type }}"
|
|
dev: "/dev/disk/by-partlabel/{{ item.1.mount | hash('md5') }}"
|
|
when: item.1.mount != 'none'
|