�
�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 e f d
� � YZ
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: opendj_backendprop
short_description: Will update the backend configuration of OpenDJ via the dsconfig set-backend-prop command.
description:
- This module will update settings for OpenDJ with the command set-backend-prop.
- It will check first via de get-backend-prop if configuration needs to be applied.
version_added: "2.2"
author:
- Werner Dijkerman (@dj-wasabi)
options:
opendj_bindir:
description:
- The path to the bin directory of OpenDJ.
required: false
default: /opt/opendj/bin
hostname:
description:
- The hostname of the OpenDJ server.
required: true
port:
description:
- The Admin port on which the OpenDJ instance is available.
required: true
username:
description:
- The username to connect to.
required: false
default: cn=Directory Manager
password:
description:
- The password for the cn=Directory Manager user.
- Either password or passwordfile is needed.
required: false
passwordfile:
description:
- Location to the password file which holds the password for the cn=Directory Manager user.
- Either password or passwordfile is needed.
required: false
backend:
description:
- The name of the backend on which the property needs to be updated.
required: true
name:
description:
- The configuration setting to update.
required: true
value:
description:
- The value for the configuration item.
required: true
state:
description:
- If configuration needs to be added/updated
required: false
default: "present"
s*
- name: "Add or update OpenDJ backend properties"
action: opendj_backendprop
hostname=localhost
port=4444
username="cn=Directory Manager"
password=password
backend=userRoot
name=index-entry-limit
value=5000
t
( t
AnsibleModulet BackendPropc B` s5 e Z d � Z d � Z d � Z d d d d � Z RS( c C` s
| | _ d S( N( t _module( t selft module( ( sV /usr/lib/python2.7/site-packages/ansible/modules/identity/opendj/opendj_backendprop.pyt __init__] s c
C` s� | d d d | d t | � d | d | d d d g
| } | j j | � \ } } }
| d
k rf | S| j j d d t |
� � d S(
Ns /dsconfigs get-backend-props -hs --ports --bindDNs --backend-names -ns -Xs -si t msgs Error message: ( t strR t run_commandt fail_json( R t
opendj_bindirt hostnamet portt usernamet password_methodt backend_namet
my_commandt rct stdoutt stderr( ( sV /usr/lib/python2.7/site-packages/ansible/modules/identity/opendj/opendj_backendprop.pyt get_property` s c
C` s� | d d d | d t | � d | d | d | d | d d
g | } | j j | � \ }
} } |
d k rq t S| j j d d
| � d S( Ns /dsconfigs set-backend-props -hs --ports --bindDNs --backend-names --sett :s -ns -Xi R s Error message: ( R R R t TrueR (
R R R R R R R t namet valueR R R R ( ( sV /usr/lib/python2.7/site-packages/ansible/modules/identity/opendj/opendj_backendprop.pyt set_propertyp s c C` sZ xS | j d � D]B } | r | j � } | d | k rR | d | k rO t SqR q q Wt S( Ns
i i ( t splitR t False( R t dataR R! t config_linet
split_line( ( sV /usr/lib/python2.7/site-packages/ansible/modules/identity/opendj/opendj_backendprop.pyt
validate_data� s N( t __name__t
__module__R R R"