Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IBM Spectrum Virtualize Ansible V1.8.0 #57

Merged
merged 30 commits into from
Mar 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
6d054a7
Fix drp pool issue
rohitk-github Mar 28, 2021
aaa6a8d
IBM Spectrum Virtualize v1.5.0
Shilpi-J Jun 26, 2021
c2db3fd
IBM Spectrum Virtualize v1.5.0
Shilpi-J Jun 26, 2021
9fd0b2b
IBM Spectrum Virtualize v1.5.0
Shilpi-J Jun 26, 2021
c1545bc
IBM Spectrum Virtualize v1.5.0
Shilpi-J Jun 26, 2021
f21580a
IBM Spectrum Virtualize v1.5.0
Shilpi-J Jun 26, 2021
b01c46d
Merge branch 'master' into develop
Shilpi-J Jun 26, 2021
3abcace
IBM Spectrum Virtualize v1.6.0
Shilpi-J Sep 23, 2021
dcc7b22
IBM Spectrum Virtualize v1.6.0
Shilpi-J Sep 23, 2021
1d3d9ff
IBM Spectrum Virtualize v1.6.0
Shilpi-J Sep 23, 2021
28baee3
IBM Spectrum Virtualize v1.6.0
Shilpi-J Sep 23, 2021
1050acd
IBM Spectrum Virtualize v1.6.0
Shilpi-J Sep 23, 2021
1a36818
IBM Spectrum Virtualize v1.6.0
Shilpi-J Sep 23, 2021
ae753de
IBM Spectrum Virtualize v1.6.0
Shilpi-J Sep 23, 2021
9198d46
IBM Spectrum Virtualize v1.6.0
Shilpi-J Sep 23, 2021
4d7b155
Create main.yml
rohitk-github Sep 23, 2021
e302996
Update main.yml
rohitk-github Sep 24, 2021
9376fd7
Add stable-2.12 to CI (#45)
Andersson007 Oct 11, 2021
e532b7e
Update main.yml
Shilpi-J Dec 14, 2021
f4f59c9
Add host-vdiskmap as gather_subset options (#46)
orbist Dec 15, 2021
1b739cc
Updated README and added ignore-2.9.txt (#47)
Shilpi-J Dec 20, 2021
db65992
IBM Spectrum Virtualize v1.7.0 (#48)
Shilpi-J Dec 21, 2021
94e9333
Merge branch 'master' into develop
Shilpi-J Dec 21, 2021
a4f91d1
Update main.yml
sreshtantbohidar Feb 16, 2022
ca3a95f
Update main.yml
sreshtantbohidar Feb 16, 2022
3839d85
Update main.yml
sreshtantbohidar Feb 16, 2022
bd8c1f1
Including unit tests in GHA workflow (#54)
sreshtantbohidar Feb 18, 2022
81ed461
Prepare the collection for inclusion in Ansible (#52)
Andersson007 Feb 18, 2022
0ccd4e5
IBM Spectrum Virtualize Ansible v1.8.0 New Features (#56)
Shilpi-J Mar 22, 2022
e0e27f8
Merge branch 'master' into develop
Shilpi-J Mar 28, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 60 additions & 6 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,30 +11,84 @@ jobs:
name: Sanity (${{ matrix.ansible }} on spectrum_virtualize
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
ansible:
- stable-2.9
- stable-2.10
- stable-2.11
- stable-2.12

python:
- '2.7'
- '3.8'
exclude:
- ansible: stable-2.12
python: '2.7'
steps:
- name: Check out code
uses: actions/checkout@v2

- name: Set up Python
- name: Set up Python${{ matrix.python }}
uses: actions/setup-python@v2
with:
python-version: 3.8
python-version: ${{ matrix.python }}

- name: Upgrade PIP
run: python${{ matrix.python }} -m pip install --upgrade pip

- name: Install ansible (${{ matrix.ansible }})
run: pip install https://github.com/ansible/ansible/archive/${{ matrix.ansible }}.tar.gz --disable-pip-version-check
run: python${{ matrix.python }} -m pip install https://github.com/ansible/ansible/archive/${{ matrix.ansible }}.tar.gz --disable-pip-version-check

- name: Make directory for ansible-test
run: |
pwd
mkdir -p ansible_collections/ibm/spectrum_virtualize
rsync -av . ansible_collections/ibm/spectrum_virtualize --exclude ansible_collections/ibm/spectrum_virtualize
- name: Run sanity tests spectrum_virtualize
run: ansible-test sanity --docker -v --color
working-directory: ansible_collections/ibm/spectrum_virtualize
run: ansible-test sanity -v --color --python ${{ matrix.python }} --docker --coverage
working-directory: ./ansible_collections/ibm/spectrum_virtualize

units:
name: Units (${{ matrix.ansible }} on spectrum_virtualize
runs-on: ubuntu-latest
strategy:
#fail-fast: false
matrix:
ansible:
- stable-2.9
- stable-2.10
- stable-2.11
- stable-2.12
python:
- '2.7'
- '3.8'
exclude:
- ansible: stable-2.12
python: '2.7'
steps:
- name: Check out code
uses: actions/checkout@v2

- name: Set up Python${{ matrix.python }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python }}

- name: Upgrade PIP
run: python${{ matrix.python }} -m pip install --upgrade pip

- name: Install ansible (${{ matrix.ansible }})
run: python${{ matrix.python }} -m pip install https://github.com/ansible/ansible/archive/${{ matrix.ansible }}.tar.gz --disable-pip-version-check

- name: Make directory for ansible-test
run: |
pwd
mkdir -p ansible_collections/ibm/spectrum_virtualize
rsync -av . ansible_collections/ibm/spectrum_virtualize --exclude ansible_collections/ibm/spectrum_virtualize

- name: Install dependencies
run: python${{ matrix.python }} -m pip install paramiko

- name: Run unit test cases
run: ansible-test units -v --color --python ${{ matrix.python }} --requirements --coverage
working-directory: ./ansible_collections/ibm/spectrum_virtualize
14 changes: 10 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[![Code of conduct](https://img.shields.io/badge/code%20of%20conduct-Ansible-silver.svg)](https://docs.ansible.com/ansible/latest/community/code_of_conduct.html )

This collection provides a series of Ansible modules and plugins for interacting with the IBM Spectrum Virtualize family storage products. These products include the IBM SAN Volume Controller, IBM FlashSystem family members built with IBM Spectrum Virtualize (FlashSystem 5xxx, 7200, 9100, 9200, 9200R, and V9000), IBM Storwize family, and IBM Spectrum Virtualize for Public Cloud. For more information regarding these products, see [IBM Documentation](https://www.ibm.com/docs/en ).
This collection provides a series of Ansible modules and plugins for interacting with the IBM Spectrum Virtualize family storage products. These products include the IBM SAN Volume Controller, IBM FlashSystem family members built with IBM Spectrum Virtualize (FlashSystem 5xxx, 7xxx, 9xxx), IBM Storwize family, and IBM Spectrum Virtualize for Public Cloud. For more information regarding these products, see [IBM Documentation](https://www.ibm.com/docs/en ).

## Requirements

Expand Down Expand Up @@ -69,6 +69,7 @@ Alternatively, you can add a full namepsace and collection name in the `collecti
### Modules

- ibm_svc_auth - Generates an authentication token for a user on IBM Spectrum Virtualize family storage system
- ibm_svc_complete_initial_setup - Completes the initial setup configuration for LMC systems
- ibm_svc_host - Manages hosts on IBM Spectrum Virtualize system
- ibm_svc_hostcluster - Manages host cluster on IBM Spectrum Virtualize system
- ibm_svc_info - Collects information on IBM Spectrum Virtualize system
Expand All @@ -77,11 +78,14 @@ Alternatively, you can add a full namepsace and collection name in the `collecti
- ibm_svc_manage_consistgrp_flashcopy - Manages FlashCopy consistency groups on IBM Spectrum Virtualize system
- ibm_svc_manage_cv - Manages the change volume in remote copy replication on IBM Spectrum Virtualize system
- ibm_svc_manage_flashcopy - Manages FlashCopy mappings on IBM Spectrum Virtualize system
- ibm_svc_manage_ip - Manages IP provisioning on IBM Spectrum Virtualize system
- ibm_svc_manage_mirrored_volume - Manages mirrored volumes on IBM Spectrum Virtualize system
- ibm_svc_manage_migration - Manages volume migration between clusters on IBM Spectrum Virtualize system
- ibm_svc_manage_ownershipgroup - Manages ownership groups on IBM Spectrum Virtualize system
- ibm_svc_manage_portset - Manages IP portset on IBM Spectrum Virtualize system
- ibm_svc_manage_replication - Manages remote copy replication on IBM Spectrum Virtualize system
- ibm_svc_manage_replicationgroup - Manages remote copy consistency groups on IBM Spectrum Virtualize system
- ibm_svc_manage_safeguarded_policy - Manages safeguarded policy configuration on IBM Spectrum Virtualize system
- ibm_svc_manage_sra - Manages the remote support assistance configuration on IBM Spectrum Virtualize system
- ibm_svc_manage_user - Manages user on IBM Spectrum Virtualize system
- ibm_svc_manage_usergroup - Manages user groups on IBM Spectrum Virtualize system
Expand All @@ -96,7 +100,9 @@ Alternatively, you can add a full namepsace and collection name in the `collecti
- ibm_svctask_command - Runs svctask CLI command(s) on IBM Spectrum Virtualize system over SSH session

### Other Feature Information
- SV Ansible Collection v1.7.0 provides `Setup and Configuration Automation` through different modules. This feature helps user to automate Day 0 configuration.
- SV Ansible Collection v1.8.0 provides the new 'ibm_svc_complete_initial_setup' module, to complete the automation of Day 0 configuration on Licensed Machine Code (LMC) systems.
For non-LMC systems, login to the user-interface is required in order to complete the automation of Day 0 configuration.
- SV Ansible Collection v1.7.0 provided `Setup and Configuration Automation` through different modules. This feature helps user to automate Day 0 configuration.
This feature includes three modules:
- ibm_svc_initial_seutp
- ibm_svc_manage_callhome
Expand All @@ -113,10 +119,10 @@ The modules in the IBM Spectrum Virtualize Ansible collection leverage REST APIs
1. Using the REST APIs to list more than 2000 objects may create a loss of service from the API side, as it automatically restarts due to memory constraints.
2. It is not possible to access REST APIs using an IPv6 address on a cluster.
3. The Ansible collection can run on all IBM Spectrum Virtualize storage versions above 8.1.3, except versions 8.3.1.3 and 8.3.1.4.
4. At time of release of the SV Ansible v1.7.0 collection, no module is available to automate license agreements acceptance, including EULA.
4. At time of release of the SV Ansible v1.8.0 collection, no module is available for non LMC systems to automate license agreements acceptance, including EULA.
User will be presented with a GUI setup wizard upon user-interface login, whether the Ansible modules have been used for initial configuration or not.

## Releasing, Versioning and Deprecation
## Releasing, Versioning, and Deprecation

1. IBM Spectrum Virtualize Ansible Collection releases follow a quarterly release cycle.
2. IBM Spectrum Virtualize Ansible Collection releases follow [semantic versioning](https://semver.org/).
Expand Down
18 changes: 18 additions & 0 deletions changelogs/changelog.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,22 @@ releases:
namespace: ''
- description: Allow user to do initial setup configuration on Spectrum Virtualize storage systems
name: ibm_svc_initial_setup
namespace: ''
1.8.0:
release_date: '2022-3-31'
changes:
release_summary: Added new modules for managing portsets, IP configuration and safeguarded policies.
Also added support to complete initial setup configurations for LMC systems.
modules:
- description: Manages IP portset on Spectrum Virtualize system
name: ibm_svc_manage_portset
namespace: ''
- description: Manages IP provisioning on Spectrum Virtualize system
name: ibm_svc_manage_ip
namespace: ''
- description: Manages safeguarded policy configuration on Spectrum Virtualize storage systems
name: ibm_svc_manage_safeguarded_policy
namespace: ''
- description: Completes initial setup configuration for Licensed Machine Code (LMC) systems
name: ibm_svc_complete_initial_setup
namespace: ''
2 changes: 1 addition & 1 deletion galaxy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ namespace: ibm
name: spectrum_virtualize

# The version of the collection. Must be compatible with semantic versioning
version: 1.7.0
version: 1.8.0

# The path to the Markdown (.md) readme file. This path is relative to the root of the collection
readme: README.md
Expand Down
7 changes: 3 additions & 4 deletions plugins/module_utils/ibm_svc_ssh.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
# Copyright (C) 2020 IBM CORPORATION
# Author(s): Shilpi Jain <[email protected]>
#
# GNU General Public License v3.0+
# (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)

""" Support class for IBM SVC generic ansible module """

Expand All @@ -15,7 +14,7 @@


class IBMSVCssh(object):
""" Communicate with SVC via SSH
""" Communicate with SVC through SSH
The module use paramiko to connect SVC
"""

Expand Down Expand Up @@ -53,7 +52,7 @@ def __init__(self, module, clustername, username, password,
self.module.fail_json(msg='paramiko is not installed')
self.client = paramiko.SSHClient()

# connect via SSH
# connect through SSH
self.is_client_connected = self._svc_connect()
if not self.is_client_connected:
self.module.fail_json(msg='Failed to connect')
Expand Down
13 changes: 6 additions & 7 deletions plugins/module_utils/ibm_svc_utils.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
# Copyright (C) 2020 IBM CORPORATION
# Author(s): Peng Wang <[email protected]>
#
# GNU General Public License v3.0+
# (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)

""" Support class for IBM SVC ansible modules """

Expand Down Expand Up @@ -65,7 +64,7 @@ def get_logger(module_name, log_file_name, log_level=logging.INFO):


class IBMSVCRestApi(object):
""" Communicate with SVC via RestApi
""" Communicate with SVC through RestApi
SVC commands usually have the format
$ command -opt1 value1 -opt2 value2 arg1 arg2 arg3
to use the RestApi we transform this into
Expand Down Expand Up @@ -99,7 +98,7 @@ def __init__(self, module, clustername, domain, username, password,
log = get_logger(self.__class__.__name__, log_path)
self.log = log.info

# Make sure we can connect via the RestApi
# Make sure we can connect through the RestApi
if self.token is None:
if not self.username or not self.password:
self.module.fail_json(msg="You must pass in either pre-acquired token"
Expand Down Expand Up @@ -267,7 +266,7 @@ def svc_run_command(self, cmd, cmdopts, cmdargs):
return rest['out']

def svc_obj_info(self, cmd, cmdopts, cmdargs):
""" Obtain information about an SVC object via the ls command
""" Obtain information about an SVC object through the ls command
:param cmd: svc command to run
:type cmd: string
:param cmdopts: svc command options, name parameter and value
Expand Down Expand Up @@ -295,10 +294,10 @@ def svc_obj_info(self, cmd, cmdopts, cmdargs):
return rest['out']

def get_auth_token(self):
""" Obtain information about an SVC object via the ls command
""" Obtain information about an SVC object through the ls command
:returns: authentication token
"""
# Make sure we can connect via the RestApi
# Make sure we can connect through the RestApi
self.token = self._svc_authorize()
self.log("_connect by using token")
if not self.token:
Expand Down
57 changes: 24 additions & 33 deletions plugins/modules/ibm_svc_auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,6 @@
from __future__ import absolute_import, division, print_function
__metaclass__ = type

ANSIBLE_METADATA = {'status': ['preview'],
'supported_by': 'community',
'metadata_version': '1.1'}

DOCUMENTATION = '''
---
module: ibm_svc_auth
Expand Down Expand Up @@ -57,41 +53,36 @@
type: str
author:
- Shilpi Jain(@Shilpi-J)
notes:
- This module supports C(check_mode).
'''

EXAMPLES = '''
- name: Using Spectrum Virtualize collection to create a volume
hosts: localhost
collections:
- ibm.spectrum_virtualize
gather_facts: no
connection: local
tasks:
- name: Obtain an authentication token
register: result
ibm_svc_auth:
clustername: "{{clustername}}"
domain: "{{domain}}"
username: "{{username}}"
password: "{{password}}"
- name: Create a volume
ibm_svc_vdisk:
clustername: "{{clustername}}"
domain: "{{domain}}"
username: "{{username}}"
password: "{{password}}"
token: "{{result.token}}"
name: volume0
state: present
mdiskgrp: Pool0
easytier: 'off'
size: "4294967296"
unit: b

- name: Obtain an authentication token
register: result
ibm.spectrum_virtualize.ibm_svc_auth:
clustername: "{{clustername}}"
domain: "{{domain}}"
username: "{{username}}"
password: "{{password}}"
- name: Create a volume
ibm.spectrum_virtualize.ibm_svc_vdisk:
clustername: "{{clustername}}"
domain: "{{domain}}"
username: "{{username}}"
password: "{{password}}"
token: "{{result.token}}"
name: volume0
state: present
mdiskgrp: Pool0
easytier: 'off'
size: "4294967296"
unit: b
'''

RETURN = '''
token:
description: Authentication token for a user
description: Authentication token for a user.
returned: success
type: str
version_added: 1.5.0
Expand Down
Loading