�
�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
m Z d d l m
Z
m Z d
� Z e d k r� e � n d S( i ( t absolute_importt divisiont print_functions 1.1t metadata_versiont previewt statust certifiedt supported_bys4
---
module: ucs_mac_pool
short_description: Configures MAC address pools on Cisco UCS Manager
description:
- Configures MAC address pools and MAC address blocks on Cisco UCS Manager.
- Examples can be used with the UCS Platform Emulator U(https://communities.cisco.com/ucspe).
extends_documentation_fragment: ucs
options:
state:
description:
- If C(present), will verify MAC pool is present and will create if needed.
- If C(absent), will verify MAC pool is absent and will delete if needed.
choices: [present, absent]
default: present
name:
description:
- The name of the MAC pool.
- This name can be between 1 and 32 alphanumeric characters.
- "You cannot use spaces or any special characters other than - (hyphen), \"_\" (underscore), : (colon), and . (period)."
- You cannot change this name after the MAC pool is created.
required: yes
description:
description:
- A description of the MAC pool.
- Enter up to 256 characters.
- "You can use any characters or spaces except the following:"
- "` (accent mark), \ (backslash), ^ (carat), \" (double quote), = (equal sign), > (greater than), < (less than), or ' (single quote)."
aliases: [ descr, descrption ]
order:
description:
- The Assignment Order field.
- "This can be one of the following:"
- "default - Cisco UCS Manager selects a random identity from the pool."
- "sequential - Cisco UCS Manager selects the lowest available identity from the pool."
choices: [default, sequential]
default: default
first_addr:
description:
- The first MAC address in the block of addresses.
- This is the From field in the UCS Manager MAC Blocks menu.
last_addr:
description:
- The last MAC address in the block of addresses.
- This is the To field in the UCS Manager Add MAC Blocks menu.
org_dn:
description:
- The distinguished name (dn) of the organization where the resource is assigned.
default: org-root
requirements:
- ucsmsdk
author:
- David Soper (@dsoper2)
- CiscoUcs (@CiscoUcs)
version_added: '2.5'
s�
- name: Configure MAC address pool
ucs_mac_pool:
hostname: 172.16.143.150
username: admin
password: password
name: mac-A
first_addr: 00:25:B5:00:66:00
last_addr: 00:25:B5:00:67:F3
order: sequential
- name: Remove MAC address pool
ucs_mac_pool:
hostname: 172.16.143.150
username: admin
password: password
name: mac-A
state: absent
s
#
( t
AnsibleModule( t UCSModulet ucs_argument_specc C` s� t } | j d t d d d d � d t d d d t � d t d d d d d
d d g � d
t d d d d d d d g � d t d d � d t d d � d t d d d d d g d d � � t | d t �} t | � } t } d d l m } d d l m
} t } yt } t } | j d d | j d } | j j
| � }
|
rQt } n | j d d k r�| r| j s�| j j |
� | j j � n t } qnt| rUt d | j d
� } | j d | d <|
j | � rU| j d rI| j d rI| d | j d j � d | j d j � } | j j
| � }
|
rOt } qOqRt } qUn | s| j s
| d | j d d | j d d | j d d | j d
� }
| j d r�| j d r�| d |
d | j d d | j d � }
n | j j |
t � | j j � n t } n Wn0 t k
rF} t } d t | � | j d! <n X| | j d"