�
�Udac @` s� d d l m Z m Z m Z e Z 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
m Z m Z m Z m Z m Z d d
l m Z d d l m Z d d d g Z d � Z d � Z e d k r� e � n d S( i ( t absolute_importt divisiont print_functions 1.1t metadata_versiont previewt statust communityt supported_bysh
---
module: a10_server
version_added: 1.8
short_description: Manage A10 Networks AX/SoftAX/Thunder/vThunder devices' server object.
description:
- Manage SLB (Server Load Balancer) server objects on A10 Networks devices via aXAPIv2.
author:
- Eric Chou (@ericchou1)
- Mischa Peters (@mischapeters)
notes:
- Requires A10 Networks aXAPI 2.1.
extends_documentation_fragment:
- a10
- url
options:
partition:
version_added: "2.3"
description:
- set active-partition
server_name:
description:
- The SLB (Server Load Balancer) server name.
required: true
aliases: ['server']
server_ip:
description:
- The SLB server IPv4 address.
aliases: ['ip', 'address']
server_status:
description:
- The SLB virtual server status.
default: enabled
aliases: ['status']
choices: ['enabled', 'disabled']
server_ports:
description:
- A list of ports to create for the server. Each list item should be a
dictionary which specifies the C(port:) and C(protocol:), but can also optionally
specify the C(status:). See the examples below for details. This parameter is
required when C(state) is C(present).
aliases: ['port']
state:
description:
- This is to specify the operation to create, update or remove SLB server.
default: present
choices: ['present', 'absent']
validate_certs:
description:
- If C(no), SSL certificates will not be validated. This should only be used
on personally controlled devices using self-signed certificates.
version_added: 2.3
type: bool
default: 'yes'
s!
# Create a new server
- a10_server:
host: a10.mydomain.com
username: myadmin
password: mypassword
partition: mypartition
server: test
server_ip: 1.1.1.100
server_ports:
- port_num: 8080
protocol: tcp
- port_num: 8443
protocol: TCP
sx
content:
description: the full info regarding the slb_server
returned: success
type: str
sample: "mynewserver"
N( t
axapi_callt a10_argument_spect axapi_authenticatet
axapi_failuret axapi_get_port_protocolt axapi_enabled_disabledt AXAPI_PORT_PROTOCOLS( t
AnsibleModule( t url_argument_spect port_numt protocolc C` sL xE| D]=} x@ | D]8 } | t k r | j d d | d j t � f � q q Wd | k r� y t | d � | d <Wq� t k
r� | j d d � q� Xn | j d d � d | k r� t | d � } | s� | j d d d j t � � q| | d <n | j d d d j t � � d
| k r:t | d
� | d
<q d | d
<q Wd S( Nt msgs+ invalid port field (%s), must be one of: %st ,R s9 port_num entries in the port definitions must be integerss/ port definitions must define the port_num fieldR s) invalid port protocol, must be one of: %ss3 port definitions must define the port protocol (%s)R i ( t VALID_PORT_FIELDSt fail_jsont joint intt ExceptionR R R
( t modulet portst itemt keyR ( ( sJ /usr/lib/python2.7/site-packages/ansible/modules/network/a10/a10_server.pyt validate_portsn s&