Skip to content

Instantly share code, notes, and snippets.

@robinsg
Created November 25, 2020 17:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save robinsg/7781d5347d5d61390fd2b1ac4cc9499f to your computer and use it in GitHub Desktop.
Save robinsg/7781d5347d5d61390fd2b1ac4cc9499f to your computer and use it in GitHub Desktop.
Spectrum Virtualize Flashcopy - Checks and info retrieval
tasks:
- name: Fail if a host is not defined and the ansible-playbook command
fails:
mag:
- 'No host specified. On the ansible-playbook command use "--extra-vars host=hostname"'
when: host is not defined
- block:
- name: Get a list of volume mappings for the host
ibm_svcinfo_command:
command: "svcinfo lshostvdiskmap {{ host }}"
clustername: "{{ clustername }}"
username: "{{ username }}"
password: "{{ password }}"
register: mappings
- name: Get volume information for each volume mapped to the host
ibm_svcinfo_command:
command: "svcinfo lsvdisk {{ item.vdisk_name }} "
clustername: "{{ clustername }}"
username: "{{ username }}"
password: "{{ password }}"
register: volumes
loop: "{{ mappings.stdout }}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment