.. _nim_module:


nim -- Server setup, install packages, update SP or TL.
=======================================================

.. contents::
   :local:
   :depth: 1


Synopsis
--------

Server setup, install packages, update SP or TL.



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

- AIX >= 7.1 TL3
- Python >= 2.7



Parameters
----------

  force (optional, bool, False)
    Forces action.


  description (optional, str, None)
    Describes the NIM operation (informational only).


  script (optional, str, None)
    NIM script resource.


  lpp_source (optional, str, None)
    Indicates the lpp_source 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.


  group (optional, str, None)
    NIM group resource.


  action (True, str, None)
    Specifies the action to perform.

    ``update`` to update NIM clients with a specified ``lpp_source``.

    ``master_setup`` to setup a NIM master.

    ``check`` to retrieve the ``Cstate`` of each NIM client.

    ``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 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 on NIM clients.


  asynchronous (optional, bool, False)
    If set to ``no``, NIM client will be completely installed before starting the installation of another NIM client.


  location (optional, str, None)
    Specifies the full path name of the script resource file.


  device (optional, str, None)
    The device (or directory) where to find the lpp source to install.


  resource (optional, str, None)
    NIM resource.


  operation (optional, str, None)
    NIM maintenance operation.


  targets (optional, list, None)
    Specifies the NIM clients to perform the action on.

    ``foo*`` designates all the NIM clients with name starting by ``foo``.

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

    ``*`` or ``ALL`` designates all the NIM clients.









Examples
--------

.. code-block:: yaml+jinja

    
    - 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



Return Values
-------------

msg (always, str, )
  Status information.


nim_output (always, str, )
  Output from nim commands.


nim_node (always, dict, {'nim_node': {'master': {'cstate': 'ready for a NIM operation', 'type': 'master'}, 'vios': {}, 'lpp_source': {'723lpp_res': '/export/nim/lpp_source/723lpp_res'}, 'standalone': {'nimclient02': {'cstate': 'ready for a NIM operation', 'ip': 'nimclient02.mydomain.com', 'type': 'standalone'}, 'nimclient01': {'cstate': 'ready for a NIM operation', 'ip': 'nimclient01.mydomain.com', 'type': 'standalone'}}}})
  NIM node info.


  master (always, dict, )
    NIM master.


  vios (always, dict, )
    List of VIOS NIM resources.


  lpp_source (always, dict, )
    List of lpp sources.


  standalone (always, dict, )
    List of standalone 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)

