Anons79 Mini Shell

Directory : /lib/python2.7/site-packages/ansible/modules/remote_management/lxca/
Upload File :
Current File : //lib/python2.7/site-packages/ansible/modules/remote_management/lxca/lxca_nodes.pyo

�
�Udac@`s�ddlmZmZmZeZidd6dd6dgd6ZdZd	Zd
Z	ddl
Z
ddlmZdd
l
mZmZmZyddlmZWnek
r�nXdZdZdZd�Zd�Zd�Zd�Zd�Zd�Zied6ed6ed6ed6ed6Zededdddddddg�d edd�d!edd��Z d"�Z!d#�Z"e#d$kr�e"�ndS(%i(tabsolute_importtdivisiontprint_functions1.1tmetadata_versiont	communitytsupported_bytpreviewtstatuss�
---
version_added: "2.8"
author:
  - Naval Patel (@navalkp)
  - Prashant Bhosale (@prabhosa)
module: lxca_nodes
short_description: Custom module for lxca nodes inventory utility
description:
  - This module returns/displays a inventory details of nodes

options:
  uuid:
    description:
      uuid of device, this is string with length greater than 16.

  command_options:
    description:
      options to filter nodes information
    default: nodes
    choices:
        - nodes
        - nodes_by_uuid
        - nodes_by_chassis_uuid
        - nodes_status_managed
        - nodes_status_unmanaged

  chassis:
    description:
      uuid of chassis, this is string with length greater than 16.

extends_documentation_fragment:
    - lxca_common
sZ
# get all nodes info
- name: get nodes data from LXCA
  lxca_nodes:
    login_user: USERID
    login_password: Password
    auth_url: "https://10.243.15.168"
    command_options: nodes

# get specific nodes info by uuid
- name: get nodes data from LXCA
  lxca_nodes:
    login_user: USERID
    login_password: Password
    auth_url: "https://10.243.15.168"
    uuid: "3C737AA5E31640CE949B10C129A8B01F"
    command_options: nodes_by_uuid

# get specific nodes info by chassis uuid
- name: get nodes data from LXCA
  lxca_nodes:
    login_user: USERID
    login_password: Password
    auth_url: "https://10.243.15.168"
    chassis: "3C737AA5E31640CE949B10C129A8B01F"
    command_options: nodes_by_chassis_uuid

# get managed nodes
- name: get nodes data from LXCA
  lxca_nodes:
    login_user: USERID
    login_password: Password
    auth_url: "https://10.243.15.168"
    command_options: nodes_status_managed

# get unmanaged nodes
- name: get nodes data from LXCA
  lxca_nodes:
    login_user: USERID
    login_password: Password
    auth_url: "https://10.243.15.168"
    command_options: nodes_status_unmanaged

s�
result:
    description: nodes detail from lxca
    returned: always
    type: dict
    sample:
      nodeList:
        - machineType: '6241'
          model: 'AC1'
          type: 'Rack-TowerServer'
          uuid: '118D2C88C8FD11E4947B6EAE8B4BDCDF'
          # bunch of properties
        - machineType: '8871'
          model: 'AC1'
          type: 'Rack-TowerServer'
          uuid: '223D2C88C8FD11E4947B6EAE8B4BDCDF'
          # bunch of properties
        # Multiple nodes details
N(t
AnsibleModule(tLXCA_COMMON_ARGSt
has_pylxcatconnection_object(tnodess5UUID of device is required for nodes_by_uuid command.s>UUID of chassis is required for nodes_by_chassis_uuid command.sSuccess %s resultcC`s
t|�S(N(R(tmoduletlxca_con((sU/usr/lib/python2.7/site-packages/ansible/modules/remote_management/lxca/lxca_nodes.pyt_nodes�scC`s4|jds |jdt�nt||jd�S(Ntuuidtmsg(tparamst	fail_jsont
UUID_REQUIREDR(R
R((sU/usr/lib/python2.7/site-packages/ansible/modules/remote_management/lxca/lxca_nodes.pyt_nodes_by_uuid�s
cC`s7|jds |jdt�nt|d|jd�S(NtchassisR(RRtCHASSIS_UUID_REQUIREDR(R
R((sU/usr/lib/python2.7/site-packages/ansible/modules/remote_management/lxca/lxca_nodes.pyt_nodes_by_chassis_uuid�s
cC`st|dd�S(NRtmanaged(R(R
R((sU/usr/lib/python2.7/site-packages/ansible/modules/remote_management/lxca/lxca_nodes.pyt_nodes_status_managed�scC`st|dd�S(NRt	unmanaged(R(R
R((sU/usr/lib/python2.7/site-packages/ansible/modules/remote_management/lxca/lxca_nodes.pyt_nodes_status_unmanaged�scC`s2tt�}|jt�td|dt�}|S(sY
    this function merge argument spec and create ansible module object
    :return:
    t
argument_spectsupports_check_mode(tdictR	tupdatetINPUT_ARG_SPECRtFalse(t	args_specR
((sU/usr/lib/python2.7/site-packages/ansible/modules/remote_management/lxca/lxca_nodes.pytsetup_module_object�s
Rt
nodes_by_uuidtnodes_by_chassis_uuidtnodes_status_managedtnodes_status_unmanagedtcommand_optionstdefaulttchoicesRRcC`s�yZt|��H}t|jd||�}|jdtdt|jdd|�WdQXWnAtk
r�}dj|j�}|j	d|dt
j��nXdS(sP
    This function invoke commands
    :param module: Ansible module object
    R)tchangedRtresultNs; t	exception(Rt	FUNC_DICTRt	exit_jsonR"tSUCCESS_MSGt	ExceptiontjointargsRt	tracebackt
format_exc(R
RR-R.t	error_msg((sU/usr/lib/python2.7/site-packages/ansible/modules/remote_management/lxca/lxca_nodes.pytexecute_module�scC`s!t�}t|�t|�dS(N(R$R
R8(R
((sU/usr/lib/python2.7/site-packages/ansible/modules/remote_management/lxca/lxca_nodes.pytmain�s	
t__main__($t
__future__RRRttypet
__metaclass__tANSIBLE_METADATAt
DOCUMENTATIONtEXAMPLEStRETURNR5tansible.module_utils.basicRt2ansible.module_utils.remote_management.lxca.commonR	R
RtpylxcaRtImportErrorRRR1RRRRRR$R/RtNoneR!R8R9t__name__(((sU/usr/lib/python2.7/site-packages/ansible/modules/remote_management/lxca/lxca_nodes.pyt<module>sP
%-
						
!		

Anons79 File Manager Version 1.0, Coded By Anons79
Email: [email protected]