Skip to content

Commit 536f180

Browse files
Merge pull request #149 from ansible-hmc-org/dev-collection
v1.12.0 content
2 parents ba642e9 + 7f8490c commit 536f180

19 files changed

+1074
-101
lines changed

.github/workflows/doc-publish.yaml

Lines changed: 24 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -21,28 +21,27 @@ jobs:
2121

2222
name: generate documenation source files
2323
steps:
24-
- name: checkout repository
25-
uses: actions/checkout@v4
26-
- name: setup python
27-
uses: actions/setup-python@v5.0.0
28-
with:
29-
python-version: ${{ matrix.python-version }}
30-
- name: install document generation requirements
31-
run: |
32-
python -m pip install --upgrade pip
33-
python -m pip install ansible
34-
python -m pip install ansible-doc-extractor
35-
python -m pip install sphinx
36-
python -m pip install sphinx_rtd_theme
37-
python -m pip install --upgrade myst-parser
38-
- name: run document generator script
39-
run: |
40-
bash devops/bin/gen_doc.sh
41-
- uses: actions/upload-artifact@v3
42-
with:
43-
name: hmc-doc-artifact
44-
path: ./docs/build
45-
24+
- name: checkout repository
25+
uses: actions/checkout@v4
26+
- name: setup python
27+
uses: actions/setup-python@v5.0.0
28+
with:
29+
python-version: ${{ matrix.python-version }}
30+
- name: install document generation requirements
31+
run: |
32+
python -m pip install --upgrade pip
33+
python -m pip install ansible
34+
python -m pip install ansible-doc-extractor
35+
python -m pip install sphinx
36+
python -m pip install sphinx_rtd_theme
37+
python -m pip install --upgrade myst-parser
38+
- name: run document generator script
39+
run: |
40+
bash devops/bin/gen_doc.sh
41+
- uses: actions/upload-artifact@v4
42+
with:
43+
name: hmc-doc-artifact
44+
path: ./docs/build
4645
deploy-doc:
4746
runs-on: ubuntu-22.04
4847
needs: gen-doc
@@ -54,7 +53,7 @@ jobs:
5453
pages: write
5554

5655
steps:
57-
- uses: actions/download-artifact@v3
56+
- uses: actions/download-artifact@v4
5857
with:
5958
name: hmc-doc-artifact
6059
path: .
@@ -63,10 +62,10 @@ jobs:
6362
# User need to set this secret on github actions
6463
token: ${{ secrets.TOKEN_PAM }}
6564
enablement: true
66-
- uses: actions/upload-pages-artifact@v1
65+
- uses: actions/upload-pages-artifact@v3
6766
with:
6867
path: .
6968
- id: deployment
70-
uses: actions/deploy-pages@v3
69+
uses: actions/deploy-pages@v4
7170
with:
7271
token: ${{ secrets.TOKEN_PAM }}

.github/workflows/unit-tests.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
runs-on: ubuntu-22.04
1818
strategy:
1919
matrix:
20-
python-version: ['3.7']
20+
python-version: ['3.7', '3.10', '3.11']
2121

2222
name: running unit tests with python ${{ matrix.python-version }}
2323
steps:

CHANGELOG.rst

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,3 +285,22 @@ Notes
285285

286286
.. _GitHub v1.11.0:
287287
https://github.com/IBM/ansible-power-hmc/releases/download/v1.11.0/ibm-power_hmc-1.11.0.tar.gz
288+
289+
Version 1.12.0
290+
-------------
291+
Notes
292+
* hmc_update_upgrade: Support for HMC upgrade through ibmwebsite(IBM Fixcentral website) and listing available upgrade images (Issue: #103)
293+
* vios_alt_root_vg: Support for copying the root vg content to alternate disk and clean up existing alternate disk
294+
* powervm_dlpar: Support for idempotency across all actions (Issues: #135 , #111)
295+
* powervm_lpar_instance: Support for configuring advanced VNIC settings in lpar creation (Issue: #147)
296+
* powervm_inventory: Fix for password reveal issue in warning message (Issue: #148)
297+
298+
Availability
299+
* `Galaxy v1.12.0`_
300+
* `GitHub v1.12.0`_
301+
302+
.. _Galaxy v1.12.0:
303+
https://galaxy.ansible.com/download/ibm-power_hmc-1.12.0.tar.gz
304+
305+
.. _GitHub v1.12.0:
306+
https://github.com/IBM/ansible-power-hmc/releases/download/v1.12.0/ibm-power_hmc-1.12.0.tar.gz

docs/source/release_notes.rst

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,3 +285,22 @@ Notes
285285

286286
.. _GitHub v1.11.0:
287287
https://github.com/IBM/ansible-power-hmc/releases/download/v1.11.0/ibm-power_hmc-1.11.0.tar.gz
288+
289+
Version 1.12.0
290+
-------------
291+
Notes
292+
* hmc_update_upgrade: Support for HMC upgrade through ibmwebsite(IBM Fixcentral website) and listing available upgrade images (Issue: #103)
293+
* vios_alt_root_vg: Support for copying the root vg content to alternate disk and clean up existing alternate disk
294+
* powervm_dlpar: Support for idempotency across all actions (Issues: #135 , #111)
295+
* powervm_lpar_instance: Support for configuring advanced VNIC settings in lpar creation (Issue: #147)
296+
* powervm_inventory: Fix for password reveal issue in warning message (Issue: #148)
297+
298+
Availability
299+
* `Galaxy v1.12.0`_
300+
* `GitHub v1.12.0`_
301+
302+
.. _Galaxy v1.12.0:
303+
https://galaxy.ansible.com/download/ibm-power_hmc-1.12.0.tar.gz
304+
305+
.. _GitHub v1.12.0:
306+
https://github.com/IBM/ansible-power-hmc/releases/download/v1.12.0/ibm-power_hmc-1.12.0.tar.gz

galaxy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ namespace: ibm
77
name: power_hmc
88

99
# The version of the collection. Must be compatible with semantic versioning
10-
version: 1.11.0
10+
version: 1.12.0
1111

1212

1313
# The path to the Markdown (.md) readme file. This path is relative to the root of the collection

plugins/inventory/powervm_inventory.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -523,7 +523,7 @@ def get_lpars_by_system(self):
523523
reraise(HmcError, "Error logging off HMC REST Service: %s" % error_msg, traceback)
524524
except Exception as error:
525525
error_msg = parse_error_response(error)
526-
msg = ("Unable to connect to HMC host %s: %s" % (hmc_host, error_msg))
526+
msg = ("Unable to connect to HMC host %s: %s" % (hmc_host['hmc'], error_msg))
527527
display.warning(msg=msg)
528528
logger.debug(msg)
529529
continue

plugins/module_utils/hmc_command_stack.py

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ class HmcCommandStack():
4545
'LSSYSCONN': 'lssysconn',
4646
'LSHMCLDAP': 'lshmcldap',
4747
'CHHMCLDAP': 'chhmcldap',
48+
'LSUPGFILES': 'lsupgfiles',
4849
'LSUPDHMC': 'lsupdhmc',
4950
'MKVTERM': 'mkvterm',
5051
'RMVTERM': 'rmvterm',
@@ -130,14 +131,17 @@ class HmcCommandStack():
130131
'GETUPGFILES': {'-R': {'FTP': ' -r ftp ',
131132
'SFTP': ' -r sftp ',
132133
'NFS': ' -r nfs ',
133-
'DISK': ' -r disk '},
134+
'DISK': ' -r disk ',
135+
'IBMWEBSITE': ' -r ibmwebsite'},
134136
'-H': ' -h ',
135137
'-D': ' -d ',
136138
'-U': ' -u ',
137139
'--PASSWD': ' --passwd ',
138140
'-K': ' -k ',
139141
'-L': ' -l ',
140-
'-O': ' -o '},
142+
'-O': ' -o ',
143+
'--PTF': ' --ptf'},
144+
'LSUPGFILES': {'-R': {'IBMWEBSITE': ' -r ibmwebsite '}},
141145
'LSUPDHMC': {'-T': {'IBMWEBSITE': ' -t ibmwebsite '}},
142146
'UPDHMC': {'-T': {'DISK': ' -t disk ',
143147
'DVD': ' -t dvd ',
@@ -347,7 +351,8 @@ class HmcCommandStack():
347351
'VIOSVRCMD': {'-M': ' -m ',
348352
'-P': ' -p ',
349353
'-C': ' -c ',
350-
'--ID': ' --id '},
354+
'--ID': ' --id ',
355+
'--ADMIN': ' --admin '},
351356
'MKAUTHKEYS': {'-G': ' -g ',
352357
'--IP': ' --ip ',
353358
'-U': ' -u ',
@@ -422,9 +427,9 @@ class HmcCommandStack():
422427
'BINDDN': ' --binddn',
423428
'HMCAUTHNAMEATTRIBUTE': ' --hmcauthnameattribute',
424429
'STARTTLS': {'0': ' --starttls 0',
425-
'1': '--starttls 1'},
426-
'AUTH': {'LDAP': '--auth ldap',
427-
'KERBEROS': '--auth kerberos'},
430+
'1': ' --starttls 1'},
431+
'AUTH': {'LDAP': ' --auth ldap',
432+
'KERBEROS': ' --auth kerberos'},
428433
'TIMELIMIT': ' --timelimit',
429434
'BINDTIMELIMIT': ' --bindtimelimit',
430435
'LOGINATTRIBUTE': ' --loginattribute',
@@ -433,8 +438,8 @@ class HmcCommandStack():
433438
'SEARCHFILTER': ' --searchfilter',
434439
'SCOPE': {'ONE': ' --scope one',
435440
'SUB': ' --scope sub'},
436-
'REFERRALS': {'1': '--referrals 1',
437-
'0': '--referrals 0'},
441+
'REFERRALS': {'1': ' --referrals 1',
442+
'0': ' --referrals 0'},
438443
'HMCGROUPS': ' --hmcgroups',
439444
'AUTHSEARCH': {'BASE': ' --authsearch base',
440445
'NONE': ' --authsearch none'},
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
from __future__ import absolute_import, division, print_function
2+
__metaclass__ = type
3+
4+
15
class HmcConstants():
26
MTMS_pattern = r'^\d{4}-[A-Z\d]{3}\*[A-Z\d]{7}$'
37
USER_AUTHORITY_ERR = "HSCL350B The user does not have the appropriate authority"

plugins/module_utils/hmc_resource.py

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,15 @@ def hmcShutdown(self, numOfMin='now', reboot=False):
145145
if numOfMin != 'now':
146146
time.sleep(int(numOfMin) * 60)
147147

148+
def listUpgradeFiles(self, locationType, configDict=None):
149+
hmcCmd = self.CMD['LSUPGFILES'] + \
150+
self.OPT['LSUPGFILES']['-R'][locationType.upper()]
151+
152+
result = self.hmcconn.execute(hmcCmd)
153+
if 'No results were found.' in result:
154+
return 'No upgrade files available'
155+
return self.cmdClass.parseMultiLineCSV(result)
156+
148157
def getHMCUpgradeFiles(self, serverType, configDict=None):
149158
hmcCmd = self.CMD['GETUPGFILES'] + \
150159
self.OPT['GETUPGFILES']['-R'][serverType.upper()] + \
@@ -572,11 +581,15 @@ def getPartitionRefcode(self, system_name, name):
572581

573582
return res
574583

575-
def runCommandOnVIOS(self, system_name, name, cmd):
584+
def runCommandOnVIOS(self, system_name, name, cmd, flag=None):
576585
viosvrcmd = self.CMD['VIOSVRCMD'] +\
577586
self.OPT['VIOSVRCMD']['-M'] + system_name +\
578-
self.OPT['VIOSVRCMD']['-P'] + name +\
579-
self.OPT['VIOSVRCMD']['-C'] + '"' + cmd + '"'
587+
self.OPT['VIOSVRCMD']['-P'] + name
588+
if flag is True:
589+
viosvrcmd += self.OPT['VIOSVRCMD']['--ADMIN']
590+
viosvrcmd += self.OPT['VIOSVRCMD']['-C'] + '"' + cmd + '"'
591+
if flag is not None:
592+
return self.hmcconn.execute(viosvrcmd)
580593
self.hmcconn.execute(viosvrcmd)
581594

582595
def authenticateHMCs(self, remote_hmc, username=None, passwd=None, test=False):
@@ -643,7 +656,7 @@ def createViosBk(self, configDict=None, enable=False, modify_type=None):
643656
output = ""
644657
for each in optional:
645658
if configDict.get(each) is not None:
646-
opt.append(f"{each}={configDict[each]}")
659+
opt.append("{}={}".format(each, configDict[each]))
647660
output = ','.join(opt)
648661
viosbk_cmd = self.CMD['MKVIOSBK'] + \
649662
self.OPT['MKVIOSBK']['-T'] + configDict['types'] + \

0 commit comments

Comments
 (0)