ansible create efi partitions
---
- hosts: all
user: root
become: yes
become_method: sudo
tasks:
state: present
root@localhost ~]# ansible-playbook lvm.yml
PLAY [all] *********************************************************************
TASK [Gathering Facts] *********************************************************
ok: [192.168.0.102]
ok: [192.168.0.100]
TASK [Create a new primary partition] ******************************************
changed: [192.168.0.102]
changed: [192.168.0.100]
TASK [Create a new primary partition for LVM] **********************************
changed: [192.168.0.102]
changed: [192.168.0.100]
TASK [Create EFI partitions] ***************************************************
ok: [192.168.0.102]
ok: [192.168.0.100]
TASK [Create EFI partitions] ***************************************************
changed: [192.168.0.100]
changed: [192.168.0.102]
PLAY RECAP *********************************************************************
192.168.0.100 : ok=5 changed=3 unreachable=0 failed=0
192.168.0.102 : ok=5 changed=3 unreachable=0 failed=0
[root@localhost ~]# fdisk /dev/sdc
WARNING: fdisk GPT support is currently new, and therefore in an experimental phase. Use at your own discretion.
Welcome to fdisk (util-linux 2.23.2).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.
Command (m for help): p
Disk /dev/sdc: 10.7 GB, 10737418240 bytes, 20971520 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: gpt
Disk identifier: 4BE34126-097B-4602-ABF7-39D1B8F9D952
# Start End Size Type Name
1 2048 1048575 511M Microsoft basic primary
2 1048576 1048576 512B Microsoft basic primary
Command (m for help): q
- hosts: all
user: root
become: yes
become_method: sudo
tasks:
state: present
- name: Create EFI partitions
parted:
label: gpt
state: present
device: /dev/sdc
part_start: 0%
part_end: 512MiB
number: 1
- name: Create EFI partitions
parted:
label: gpt
state: present
device: /dev/sdc
part_start: 512MiB
part_end: 1024MiB
number: 5
root@localhost ~]# ansible-playbook lvm.yml
PLAY [all] *********************************************************************
TASK [Gathering Facts] *********************************************************
ok: [192.168.0.102]
ok: [192.168.0.100]
TASK [Create a new primary partition] ******************************************
changed: [192.168.0.102]
changed: [192.168.0.100]
TASK [Create a new primary partition for LVM] **********************************
changed: [192.168.0.102]
changed: [192.168.0.100]
TASK [Create EFI partitions] ***************************************************
ok: [192.168.0.102]
ok: [192.168.0.100]
TASK [Create EFI partitions] ***************************************************
changed: [192.168.0.100]
changed: [192.168.0.102]
PLAY RECAP *********************************************************************
192.168.0.100 : ok=5 changed=3 unreachable=0 failed=0
192.168.0.102 : ok=5 changed=3 unreachable=0 failed=0
[root@localhost ~]# fdisk /dev/sdc
WARNING: fdisk GPT support is currently new, and therefore in an experimental phase. Use at your own discretion.
Welcome to fdisk (util-linux 2.23.2).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.
Command (m for help): p
Disk /dev/sdc: 10.7 GB, 10737418240 bytes, 20971520 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: gpt
Disk identifier: 4BE34126-097B-4602-ABF7-39D1B8F9D952
# Start End Size Type Name
1 2048 1048575 511M Microsoft basic primary
2 1048576 1048576 512B Microsoft basic primary
Command (m for help): q
Comments
Post a Comment