nim – Performs NIM operations - server setup, install packages, update SP or TL.

Synopsis

Performs operations on Network Installation Management (NIM) objects.

It allows to configure the NIM master server, manage NIM objects, perform various operations on NIM clients such as software or Base Operating System (BOS) installation, SP or TL updates using existing NIM resources, reboot, etc.

Requirements

The below requirements are needed on the host that executes this module.

  • AIX >= 7.1 TL3

  • Python >= 2.7

  • User with root authority to run the nim command.

  • Privileged user with authorization: aix.system.install,aix.system.nim.config.server,aix.system.nim.stat

Parameters

action (True, str, None)

Specifies the action to perform.

update to update NIM standalone clients with a specified lpp_source.

master_setup to setup a NIM master.

register_client to register new nim client to nim master

check to retrieve the Cstate and oslevel of each NIM client; results in nim_node.

compare to compare installation inventories of the NIM clients.

script to apply a script to customize NIM clients.

allocate to allocate a resource to specified NIM clients.

deallocate to deallocate a resource for specified NIM clients.

bos_inst to install BOS image to a given list of NIM clients.

define_script to define a script NIM resource.

remove to remove a specified NIM resource.

reset to reset the Cstate of a NIM client.

reboot to reboot the given NIM clients if they are running.

maintenance to perform a maintenance operation that commits filesets on NIM standalone clients.

show to perform a query on a NIM object.

targets (optional, list, None)

Specifies the NIM clients to perform the action on.

foo* specifies all the NIM clients with name starting by ‘foo’.

foo[2:4] specifies the NIM clients among foo2, foo3 and foo4.

* or ALL specifies all the NIM clients.

vios or standalone specifies all the NIM clients of this type.

new_targets (optional, list, None)

Specifies the new targets to be registered as nim client.

Specifies <machine full name>-<login id>-<password> as a list in same format.

Required when action is register_client

lpp_source (optional, str, None)

Indicates the name of the lpp_source NIM resource to apply to the targets.

latest_tl, latest_sp, next_tl and next_sp can be specified; based on the NIM server resources, nim will determine the actual oslevel necessary to update the targets; the update operation will be synchronous independently from asynchronous value.

device (optional, str, None)

The device or directory where to find the lpp source to install.

script (optional, str, None)

NIM script resource.

resource (optional, str, None)

NIM resource.

location (optional, str, None)

Specifies the full path name of the script resource file.

group (optional, str, None)

NIM group resource.

asynchronous (optional, bool, False)

If set to no, NIM client will be completely installed before starting the installation of another NIM client.

force (optional, bool, False)

Forces action.

boot_client (optional, bool, True)

If set to no, the NIM server will not attempt to reboot the client when the action is bos_inst.

object_type (optional, str, all)

Specifies which NIM object type to query for action show. Ignored for any other action.

If not set for show, then all NIM objects in the target machine will be queried.

alt_disk_update_name (optional, str, None)

Specifies name of the alternate disk where installation takes place

Notes

Examples

- name: Install using group resource
  nim:
    action: bos_inst
    targets: nimclient01
    group: basic_res_grp

- name: Check the Cstate of all NIM clients
  nim:
    action: check

- name: Define a script resource on NIM master
  nim:
    action: define_script
    resource: myscript
    location: /tmp/myscript.sh

- name: Execute a script on all NIM clients synchronously
  nim:
    action: script
    script: myscript
    asynchronous: no
    targets: all

- name: Query all standalone objects defined in a NIM master
  nim:
    action: show
    object_type: standalone

Return Values

msg (always, str, )

Status information.

targets (if the operation requires a target list, list, [‘nimclient01’, ‘nimclient02’, ‘…’])

List of NIM client actually targeted for the operation.

status (if the operation requires a target list, dict, { nimclient01: ‘SUCCESS’, nimclient02: ‘FAILURE’ })

Status of the operation for each target. It can be empty, SUCCESS or FAILURE.

<target> (when target is actually a NIM client, str, SUCCESS)

Status of the execution on the <target>.

cmd (If the command was run., str, )

Command executed.

rc (If the command was run., int, )

The return code.

stdout (always, str, )

The standard output.

stderr (always, str, )

The standard error.

meta (always, dict, )

Detailed information on the module execution.

messages (always, list, see below)

Details on errors/warnings not related to a specific target.

<target> (when target is actually a NIM client, dict, )

Detailed information on the execution on the target.

messages (always, list, )

Details on errors/warnings

cmd (If the command was run., str, )

Last command.

rc (If the command was run., str, )

The return code of the last command.

stdout (If the command was run., str, )

Standard output of the last command.

stderr (If the command was run., str, )

Standard error of the last command.

query (only for show action, dict, see below)

Queried information of all NIM objects of the specified type.

<nim_object> (if NIM object of this type exists, dict, )

Information for each individual NIM object fetched.

nim_node (always, dict, {‘nim_node’: {‘lpp_source’: {‘723lpp_res’: ‘/export/nim/lpp_source/723lpp_res’}, ‘master’: {‘Cstate’: ‘ready for a NIM operation’, ‘type’: ‘master’}, ‘standalone’: {‘nimclient01’: {‘Cstate’: ‘ready for a NIM operation’, ‘Cstate_result’: ‘success’, ‘Mstate’: ‘currently running’, ‘cable_type1’: ‘N/A’, ‘class’: ‘machines’, ‘comments’: ‘object defined using nimquery -d’, ‘connect’: ‘nimsh’, ‘cpuid’: ‘00F600004C00’, ‘if1’: ‘master_net nimclient01.aus.stglabs.ibm.com AED8E7E90202 ent0’, ‘installed_image’: ‘ansible_img’, ‘mgmt_profile1’: ‘p8-hmc 2 nimclient-cec nimclient-vios1’, ‘netboot_kernel’: ‘64’, ‘platform’: ‘chrp’, ‘prev_state’: ‘customization is being performed’}}, ‘vios’: {‘vios1’: {‘Cstate’: ‘ready for a NIM operation’, ‘Cstate_result’: ‘success’, ‘Mstate’: ‘currently running’, ‘cable_type1’: ‘N/A’, ‘class’: ‘management’, ‘connect’: ‘nimsh’, ‘cpuid’: ‘00F600004C00’, ‘if1’: ‘master_net vios1.aus.stglabs.ibm.com 0’, ‘ip’: ‘vios1.aus.stglabs.ibm.com’, ‘mgmt_profile1’: ‘p8-hmc 1 vios-cec’, ‘netboot_kernel’: ‘64’, ‘platform’: ‘chrp’, ‘prev_state’: ‘alt_disk_install operation is being performed’}}}})

NIM node info.

lpp_source (always, dict, )

List of lpp sources.

master (always, dict, )

NIM master.

standalone (always, dict, )

List of standalone NIM resources.

vios (always, dict, )

List of VIOS NIM resources.

Status

  • This module is not guaranteed to have a backwards compatible interface. [preview]

  • This module is maintained by community.

Authors

  • AIX Development Team (@pbfinley1911)