Last active
September 16, 2016 16:30
-
-
Save clcollins/feaf8fae273dff1085f68c72a5df8cdc to your computer and use it in GitHub Desktop.
Snippet of Ansible Playbook for auto-expanding a volume group based on disks on the server
This file contains hidden or 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
--- | |
## Snippet of Ansible Playbook for auto-expanding a volume group based on disks on the server | |
### Format Partitions ### | |
- name: Format | find disks | |
command: find /dev -regex "/dev/sd[b-z]" -exec echo "{}," \; | |
register: extra_pvs | |
- name: Format | expand vg if extra_pvs exist | |
# defaultpv comes last, because extra_pvs are formatted to have a comma on the end | |
lvg: vg='{{ volumegroup }}' pvs='{{ extra_pvs.stdout }}{{ defaultpv }}' | |
when: extra_pvs.stdout != '' | |
- name: Format | expand vg if extra_pvs do not exist | |
lvg: vg='{{ volumegroup }}' pvs='{{ defaultpv }}' | |
when: extra_pvs.stdout == '' |
This file contains hidden or 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
--- | |
## Snippet of Ansible Playbook for auto-expanding a volume group based on disks on the server | |
volumegroup: 'ubuntuos' | |
defaultpv: '/dev/sda5' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment