packer-qemu/packer/assets/ansible/roles/setup/tasks/partition.yml

37 lines
614 B
YAML
Raw Normal View History

---
# partition disk to install gentoo
- name: "Create a new primary partition for LVM"
parted:
2020-02-27 07:33:53 +00:00
device: "{{ devices_path }}"
name: "{{ item.name }}"
2020-02-18 07:09:23 +00:00
label: gpt
2020-02-27 07:33:53 +00:00
number: "{{ ansible_loop.index }}"
flags: [ lvm ]
state: present
2020-02-27 07:33:53 +00:00
part_end: "100%"
loop: "{{ devices_system }}"
loop_control:
extended: yes
- name: "Create vg and add disk to it"
lvg:
vg: vg_system
pvs: "{{ devices_system | map(attribute='dev') | join(',') }}"
- name: "Create list of lvs"
lvol:
vg: "vg_system"
lv: "{{ item.name }}"
size: "{{ item.size }}"
loop: "{{ lvs }}"