�
�Udac @ s� i d d 6d g d 6d d 6Z d Z d Z d Z d d
l Z d d l m Z m Z d d l m Z m Z d d
l
m Z d � Z d � Z
d � Z d � Z d � Z e d k r� e � n d
S( s 1.1t metadata_versiont previewt statust networkt supported_bys�
---
module: nxos_aaa_server_host
extends_documentation_fragment: nxos
version_added: "2.2"
short_description: Manages AAA server host-specific configuration.
description:
- Manages AAA server host-specific configuration.
author: Jason Edelman (@jedelman8)
notes:
- Tested against NXOSv 7.3.(0)D1(1) on VIRL
- Changes to the host key (shared secret) are not idempotent for type 0.
- If C(state=absent) removes the whole host configuration.
options:
server_type:
description:
- The server type is either radius or tacacs.
required: true
choices: ['radius', 'tacacs']
address:
description:
- Address or name of the radius or tacacs host.
required: true
key:
description:
- Shared secret for the specified host or keyword 'default'.
encrypt_type:
description:
- The state of encryption applied to the entered key.
O for clear text, 7 for encrypted. Type-6 encryption is
not supported.
choices: ['0', '7']
host_timeout:
description:
- Timeout period for specified host, in seconds or keyword 'default.
Range is 1-60.
auth_port:
description:
- Alternate UDP port for RADIUS authentication or keyword 'default'.
acct_port:
description:
- Alternate UDP port for RADIUS accounting or keyword 'default'.
tacacs_port:
description:
- Alternate TCP port TACACS Server or keyword 'default'.
state:
description:
- Manage the state of the resource.
default: present
choices: ['present','absent']
s�
# Radius Server Host Basic settings
- name: "Radius Server Host Basic settings"
nxos_aaa_server_host:
state: present
server_type: radius
address: 1.2.3.4
acct_port: 2084
host_timeout: 10
# Radius Server Host Key Configuration
- name: "Radius Server Host Key Configuration"
nxos_aaa_server_host:
state: present
server_type: radius
address: 1.2.3.4
key: hello
encrypt_type: 7
# TACACS Server Host Configuration
- name: "Tacacs Server Host Configuration"
nxos_aaa_server_host:
state: present
server_type: tacacs
tacacs_port: 89
host_timeout: 10
address: 5.6.7.8
s\
proposed:
description: k/v pairs of parameters passed into module
returned: always
type: dict
sample: {"address": "1.2.3.4", "auth_port": "2084",
"host_timeout": "10", "server_type": "radius"}
existing:
description:
- k/v pairs of existing configuration
returned: always
type: dict
sample: {}
end_state:
description: k/v pairs of configuration after module execution
returned: always
type: dict
sample: {"address": "1.2.3.4", "auth_port": "2084",
"host_timeout": "10", "server_type": "radius"}
updates:
description: command sent to the device
returned: always
type: list
sample: ["radius-server host 1.2.3.4 auth-port 2084 timeout 10"]
changed:
description: check to see if a change was made on the device
returned: always
type: bool
sample: true
i����N( t load_configt run_commands( t get_capabilitiest nxos_argument_spec( t
AnsibleModulec C s{ t | � } | j d d � } | d k rE | g } t | | � } n2 | d k rw i | d 6d d 6} t | | � } n | S( Nt network_apit nxapit cliconft commandt textt output( R t getR ( R
t modulet device_infoR
t cmdst body( ( sU /usr/lib/python2.7/site-packages/ansible/modules/network/nxos/nxos_aaa_server_host.pyt execute_show_command� s c C sG g } x: | D]2 } t | t � r2 | j | � q
| j | � q
W| S( N( t
isinstancet listt extendt append( t
command_listst flat_command_listR
( ( sU /usr/lib/python2.7/site-packages/ansible/modules/network/nxos/nxos_aaa_server_host.pyt flatten_list� s
c C s� i } d j | | � } t | | � d } | r�yMd | k r� d } t j | | � } | j d � | d <| d r� | d j d d � | d <d | d
<n | j d � | d <| j d
� | d <| j d � | d <n� d | k rid } t j | | � } | j d � | d <| d r@| d j d d � | d <d | d
<n | j d � | d <| j d
� | d <n | | d <| | d <Wq�t k
r�i SXn i S| S( Ns"