NIM VIOS Upgrade Overview
Overview
NIM VIOS Upgrade refers to the process of upgrading Virtual I/O
nim_viosupgrade
Supported Actions
The module supports different actions such as bosinst
altdisk
get_status
Requirements
The module requires AIX version 7.2
TL3
3.6
Module Updates
The nim_viosupgrade
Main Functions
There are several main functions in this module. Some of them are param_one_of
refresh_nim_node
viosupgrade_query
viosupgrade
param_one_of
viosupgrade
param_one_of
param_one_of
The param_one_of
required
exclusive
The param_one_of
def param_one_of(one_of_list, required=True, exclusive=True):
"""
Check that parameter of one_of_list is defined in module.params dictionary.
arguments:
one_of_list (list) list of parameter to check
required (bool) at least one parameter has to be defined.
exclusive (bool) only one parameter can be defined.
note:
Ansible might have this embedded in some version: require_if 4th parameter.
Exits with fail_json in case of error
"""
count = 0
for param in one_of_list:
if module.params[param] is not None and module.params[param]:
count += 1
break
action = module.params['action']
if count == 0 and required:
results['msg'] = f'Missing parameter: action is {action} but one of the following is missing: '
refresh_nim_node
refresh_nim_node
The refresh_nim_node
nim_node
The refresh_nim_node
nim_node
def refresh_nim_node(module, type):
"""
Get nim client information of provided type and update nim_node dictionary.
arguments:
module (dict): The Ansible module
type (str): type of the nim object to get information
note:
Exits with fail_json in case of error
return:
none
"""
if module.params['nim_node']:
results['nim_node'] = module.params['nim_node']
nim_info = get_nim_type_info(module, type)
if type not in results['nim_node']:
results['nim_node'].update({type: nim_info})
viosupgrade_query
viosupgrade_query
The viosupgrade_query
The viosupgrade_query
def viosupgrade_query(module, params_flags):
"""
Query to get the status of the upgrade .
arguments:
module (dict): The Ansible module
params_flags (dict): Supported parameter flags.
module.param used:
target_file (optional) filename with targets info
targets (required if not target_file)
viosupgrade_params (required)
note:
Set the upgrade status in results['status'][vios] or results['status']['all'].
return:
ret (int) the number of error
"""
ret = 0
# viosupgrade -q { [-n hostname | -f filename] }
cmd = ['/usr/sbin/viosupgrade', '-q']
viosupgrade
The viosupgrade
The viosupgrade
def viosupgrade(module, params_flags):
"""
Upgrade each VIOS.
arguments:
module (dict): The Ansible module
params_flags (dict): Supported parameter flags.
module.param used:
action (required)
target_file (optional) filename with targets info
targets (required if not target_file)
viosupgrade_params (required)
note:
Set the upgrade status in results['status'][vios] or results['status']['all'].
return:
ret (int) the number of error
"""
ret = 0
cmd = ['/usr/sbin/viosupgrade']
This is an auto-generated document by Swimm 🌊 and has not yet been verified by a human