-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Playbook will fail when lv size is equal to vg size Signed-off-by: Changhui Zhong <[email protected]>
- Loading branch information
1 parent
4b486d5
commit 9b132aa
Showing
1 changed file
with
48 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
--- | ||
- hosts: all | ||
become: true | ||
vars: | ||
storage_safe_mode: false | ||
mount_location: '/opt/test1' | ||
volume_group_size: '10g' | ||
lv_size: '10g' | ||
unused_disk_subfact: '{{ ansible_devices[unused_disks[0]] }}' | ||
disk_size: '{{ unused_disk_subfact.sectors|int * | ||
unused_disk_subfact.sectorsize|int }}' | ||
|
||
tasks: | ||
- include_role: | ||
name: linux-system-roles.storage | ||
|
||
- include_tasks: get_unused_disk.yml | ||
vars: | ||
min_size: "{{ volume_group_size }}" | ||
max_return: 1 | ||
|
||
- name: Create one lv which size is equal to vg size | ||
include_role: | ||
name: linux-system-roles.storage | ||
vars: | ||
storage_pools: | ||
- name: foo | ||
disks: "{{ unused_disks }}" | ||
volumes: | ||
- name: test1 | ||
size: "{{ lv_size }}" | ||
mount_point: "{{ mount_location }}" | ||
|
||
- include_tasks: verify-role-results.yml | ||
|
||
- name: Clean up | ||
include_role: | ||
name: linux-system-roles.storage | ||
vars: | ||
storage_pools: | ||
- name: foo | ||
disks: "{{ unused_disks }}" | ||
state: "absent" | ||
volumes: | ||
- name: test1 | ||
mount_point: "{{ mount_location }}" | ||
|
||
- include_tasks: verify-role-results.yml |