�
�Udac @ s� d Z d d l Z d d d d d d g Z i Z d � Z d
� Z d � Z d � Z d
� Z d � Z d � Z
d � Z d d � Z d d d � Z d � Z d � Z d d � Z d d � Z d � Z d S( s� Univention Corporate Server (UCS) access module.
Provides the following functions for working with an UCS server.
- ldap_search(filter, base=None, attr=None)
Search the LDAP via Univention's LDAP wrapper (ULDAP)
- config_registry()
Return the UCR registry object
- base_dn()
Return the configured Base DN according to the UCR
- uldap()
Return a handle to the ULDAP LDAP wrapper
- umc_module_for_add(module, container_dn, superordinate=None)
Return a UMC module for creating a new object of the given type
- umc_module_for_edit(module, object_dn, superordinate=None)
Return a UMC module for editing an existing object of the given type
Any other module is not part of the "official" API and may change at any time.
i����Nt ldap_searcht config_registryt base_dnt uldapt umc_module_for_addt umc_module_for_editc C s d d l } | S( Ni����( t ldap( t orig_ldap( ( sG /usr/lib/python2.7/site-packages/ansible/module_utils/univention_umc.pyt ldap_moduleK s c C s) | t k r t | S| � t | <t | S( N( t _singletons( t namet constructor( ( sG /usr/lib/python2.7/site-packages/ansible/module_utils/univention_umc.pyt
_singletonP s
c C s d � } t d | � S( Nc S s) d d l } | j j � } | j � | S( Ni����( t univention.config_registryR t ConfigRegistryt load( t
univentiont ucr( ( sG /usr/lib/python2.7/site-packages/ansible/module_utils/univention_umc.pyt constructY s
R ( R ( R ( ( sG /usr/lib/python2.7/site-packages/ansible/module_utils/univention_umc.pyR W s c C s t � d S( Ns ldap/base( R ( ( ( sG /usr/lib/python2.7/site-packages/ansible/module_utils/univention_umc.pyR b s c C s d � } t d | � S( s+ Return a configured univention uldap objectc S s� y% t d d � } d j t � � } Wn- t k
rT t d d � } t � d } n X| j � } t j d d | � } d d l } | j j
j d t � d
d t � d | d
| d d � S( Ns /etc/ldap.secrett rs cn=admin,{0}s /etc/machine.secrets ldap/hostdns
t i����t hosts ldap/mastert baset binddnt bindpwt start_tlsi ( t opent formatR t IOErrorR t readlinet ret subt univention.admin.uldapt adminR t access( t secret_filet bind_dnt pwd_linet pwdR ( ( sG /usr/lib/python2.7/site-packages/ansible/module_utils/univention_umc.pyR i s
R ( R ( R ( ( sG /usr/lib/python2.7/site-packages/ansible/module_utils/univention_umc.pyR f s c C s d � } t d | � S( Nc S s d d l } | j j j � S( Ni����( t univention.admin.configR! t config( R ( ( sG /usr/lib/python2.7/site-packages/ansible/module_utils/univention_umc.pyR � s R( ( R ( R ( ( sG /usr/lib/python2.7/site-packages/ansible/module_utils/univention_umc.pyR( s c C s d � } t d | � S( Nc S s d d l } | j j j � t S( Ni����( t univention.admin.modulesR! t modulest updatet True( R ( ( sG /usr/lib/python2.7/site-packages/ansible/module_utils/univention_umc.pyR � s t modules_initialized( R ( R ( ( sG /usr/lib/python2.7/site-packages/ansible/module_utils/univention_umc.pyt init_modules� s c C s d � } t d | � S( Nc S s"