33 lines
1.0 KiB
YAML
33 lines
1.0 KiB
YAML
- name: erase partition table
|
|
become: yes
|
|
command: dd if=/dev/zero of={{ ironic_root_device }} bs=512 count=36
|
|
when: "{{ not ironic.partition_info.preserve_ephemeral|default('no')|bool }}"
|
|
|
|
- name: run parted
|
|
become: yes
|
|
parted:
|
|
device: "{{ ironic_root_device }}"
|
|
label: msdos
|
|
new_label: yes
|
|
dryrun: "{{ ironic.partition_info.preserve_ephemeral|default('no')|bool }}"
|
|
partitions: "{{ ironic.partition_info.partitions }}"
|
|
register: parts
|
|
|
|
- name: reset image target to root partition
|
|
set_fact:
|
|
ironic_image_target: "{{ parts.created.root }}"
|
|
|
|
- name: make swap
|
|
become: yes
|
|
command: mkswap -L swap1 {{ parts.created.swap }}
|
|
when: "{{ parts.created.swap is defined }}"
|
|
|
|
- name: format ephemeral partition
|
|
become: yes
|
|
filesystem:
|
|
dev: "{{ parts.created.ephemeral }}"
|
|
fstype: "{{ ironic.partition_info.ephemeral_format }}"
|
|
force: yes
|
|
opts: "-L ephemeral0"
|
|
when: "{{ parts.created.ephemeral is defined and not ironic.partition_info.preserve_ephemeral|default('no')|bool }}"
|