Last active
February 21, 2017 13:11
-
-
Save alxschwarz/86c7fe6743acdab229df484a62df5fef to your computer and use it in GitHub Desktop.
ansible: getting disks on instance
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
- hosts: localhost | |
gather_facts: no | |
tasks: | |
- name: Get list of disks on instance | |
shell: "/bin/lsblk -l |grep disk|awk '{print $1}'" | |
register: disks | |
- debug: var=item | |
with_items: "{{ disks.stdout.split('\n') }}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Sample output: