Skip to content

Instantly share code, notes, and snippets.

View robinsg's full-sized avatar

Glenn Robinson robinsg

  • 01:39 (UTC +01:00)
View GitHub Profile
@robinsg
robinsg / gist:1250d91b4333a9f9e78f0181cbecf45e
Last active November 26, 2020 16:47
SVFC - Create the FC mappings and start the FC consistency group
- name: Add flashcopy mapping to consistency group
ibm_svc_volume_snapshot:
clustername: "{{ clustername }}"
username: "{{ username }}"
password: "{{ password }}"
name: "map_{{ (item['stdout'] | from_json)[0].name }}"
state: present
volume: "{{ (item['stdout'] | from_json)[0].name }}"
snapshot: "snap_{{ (item['stdout'] | from_json)[0].name }}"
consistgrp: "CG_{{ host | upper }}"
@robinsg
robinsg / gist:3d67e3dc80234f905fcdb1aeaee4ad6b
Last active November 25, 2020 18:03
SVFC - Create the FC CG and FC mappings
- name: Create a flashcopy consistency group
ibm_svc_fcconsistgrp:
clustername: "{{ clustername }}"
username: "{{ username }}"
password: "{{ password }}"
name: "CG_{{ host | upper }}"
state: present
- name: Create snapshot target volumes
ibm_svc_vdisk:
@robinsg
robinsg / gist:7781d5347d5d61390fd2b1ac4cc9499f
Created November 25, 2020 17:40
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:
@robinsg
robinsg / gist:10dcba2ef0d4720e74f382003a9674b6
Last active November 26, 2020 17:23
svfc.yml - Header information
---
- name: Create a flashcopy consistency group and mappings for all volumes mapped to a host
collections:
- ibm.spectrum_virtualize
gather_facts: no
connection: local
hosts: localhost
vars:
- clustername: ip_address_or_host_name
- username: user_name_on_storage
---
- name: Create a flashcopy consistency group and mappings for all volumes mapped to a host
collections:
- ibm.spectrum_virtualize
gather_facts: no
connection: local
hosts: localhost
vars:
- clustername: ip_address_or_host_name
- username: user_name_on_storage
---
# install_ptfs_via_imgclg
- name: Get status of PTF
hosts: all
vars:
ptfid: 'SI72134'
lpp: '5733SC1'
src_dir: '/mnt/c/Users/robin/Downloads/IBM/IBMi'
dest_ifs_dir: '/tmp'
bin_file: 'S3355V01.BIN'
- - -
all:
hosts:
vars:
children:
ibmi:
hosts:
mgtsvr01:
ansible_host: <IP_ADDRESS_OF_YOUR_LPAR>
ansible_ssh_user: <YOUR_USER_ID>
---
name: Ensure device is varied on
hosts: all
gather_facts: no
collections:
- ibm.power_ibmi
tasks:
- name: Vary on device
ibmi_device_vary:
device_list:
[ibmi]
NAME_OF_YOUR_LPAR ansible_host=IP_ADDRESS_OF_YOUR_LPAR ansible_ssh_user=qsecofr
[ibmi:vars]
ansible_python_interpreter="/QOpensys/pkgs/bin/python3"
ansible_ssh_common_args='-o StrictHostKeyChecking=no'
ansible_ssh_private_key_file="~/.ssh/ansible_IBMi_id_rsa"
[defaults]
inventory = inventory.yml
interpreter_python = /usr/bin/python3
[ssh_connection]
pipelining = True