�
�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 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 communityt supported_bys�
---
module: mso_user
short_description: Manage users
description:
- Manage users on Cisco ACI Multi-Site.
author:
- Dag Wieers (@dagwieers)
version_added: '2.8'
options:
user:
description:
- The name of the user.
type: str
required: yes
aliases: [ name ]
user_password:
description:
- The password of the user.
type: str
first_name:
description:
- The first name of the user.
- This parameter is required when creating new users.
type: str
last_name:
description:
- The last name of the user.
- This parameter is required when creating new users.
type: str
email:
description:
- The email address of the user.
- This parameter is required when creating new users.
type: str
phone:
description:
- The phone number of the user.
- This parameter is required when creating new users.
type: str
account_status:
description:
- The status of the user account.
type: str
choices: [ active ]
domain:
description:
- The domain this user belongs to.
- When creating new users, this defaults to C(Local).
type: str
roles:
description:
- The roles for this user.
type: list
state:
description:
- Use C(present) or C(absent) for adding or removing.
- Use C(query) for listing an object or multiple objects.
type: str
choices: [ absent, present, query ]
default: present
notes:
- A default installation of ACI Multi-Site ships with admin password 'we1come!' which requires a password change on first login.
See the examples of how to change the 'admin' password using Ansible.
extends_documentation_fragment: mso
s
- name: Update initial admin password
mso_user:
host: mso_host
username: admin
password: we1come!
user_name: admin
user_password: SomeSecretPassword
state: present
delegate_to: localhost
- name: Add a new user
mso_user:
host: mso_host
username: admin
password: SomeSecretPassword
user_name: dag
description: Test user
first_name: Dag
last_name: Wieers
email: [email protected]
phone: +32 478 436 299
state: present
delegate_to: localhost
- name: Remove a user
mso_user:
host: mso_host
username: admin
password: SomeSecretPassword
user_name: dag
state: absent
delegate_to: localhost
- name: Query a user
mso_user:
host: mso_host
username: admin
password: SomeSecretPassword
user_name: dag
state: query
delegate_to: localhost
register: query_result
- name: Query all users
mso_user:
host: mso_host
username: admin
password: SomeSecretPassword
state: query
delegate_to: localhost
register: query_result
s # ( t
AnsibleModule( t MSOModulet mso_argument_spect issubsetc C` s� t � } | j d t d d d d g � d t d d d t � d t d d � d t d d � d
t d d � d t d d � d t d d d
d g � d t d d � d t d d � d t d d d d d
d d d g � �
t d | d t d d d d g g d d d g g g � } | j d } | j d } | j d } | j d } | j d
} | j d } | j d } | j d } t | � }
|
j | j d � } |
j | j d � } d }
d } | r|
j
| d | �|
_ |
j r|
j d }
d j d |
� } qn |
j
| � |
_ | d k r(n�| d k r||
j |
_ |
j r�| j r^i |
_ qy|
j | d d �|
_ q�n`| d k r�|
j |
_ t d |
d | d | d! | d"