%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python2.7/site-packages/salt/states/
Upload File :
Create Path :
Current File : //lib/python2.7/site-packages/salt/states/libcloud_dns.pyo

�
���^c@@shdZddlmZddlZd�Zd�Zdd�Zd�Z	d�Z
d	�Zd
�ZdS(s1
Manage DNS records and zones using libcloud

    :codeauthor: Anthony Shaw <anthonyshaw@apache.org>

.. versionadded:: 2016.11.0

Create and delete DNS records or zones through Libcloud. Libcloud's DNS system supports over 20 DNS
providers including Amazon, Google, GoDaddy, Softlayer

This module uses ``libcloud``, which can be installed via package, or pip.

:configuration:
    This module uses a configuration profile for one or multiple DNS providers

    .. code-block:: yaml

        libcloud_dns:
          profile1:
            driver: godaddy
            key: 2orgk34kgk34g
          profile2:
            driver: route53
            key: blah
            secret: blah

Example:

.. code-block:: yaml

    my-zone:
      libcloud_dns.zone_present:
        - name: mywebsite.com
        - profile: profile1
    my-website:
      libcloud_dns.record_present:
        - name: www
        - zone: mywebsite.com
        - type: A
        - data: 12.34.32.3
        - profile: profile1
        - require:
          - libcloud_dns: my-zone


:depends: apache-libcloud
i(tabsolute_importNcC@stS(N(tTrue(((s</usr/lib/python2.7/site-packages/salt/states/libcloud_dns.pyt__virtual__9scC@stjjjt�dS(N(tsalttutilstcompattpack_dundert__name__(topts((s</usr/lib/python2.7/site-packages/salt/states/libcloud_dns.pyt__init__=scC@s5|dkri}ni|d6|d6|d6|d6S(Ntresulttcommenttnametchanges(tNone(R
tmessageRR
((s</usr/lib/python2.7/site-packages/salt/states/libcloud_dns.pytstate_resultAs	
cC@s�td|�}|sd}ng|D]}|d|kr&|^q&}t|�dkrjttd|�Std|||�}ttd||�SdS(	s
    Ensures a record is present.

    :param domain: Zone name, i.e. the domain name
    :type  domain: ``str``

    :param type: Zone type (master / slave), defaults to master
    :type  type: ``str``

    :param profile: The profile key
    :type  profile: ``str``
    slibcloud_dns.list_zonestmastertdomainisZone already existsslibcloud_dns.create_zonesCreated new zoneN(t__salt__tlenRR(Rttypetprofiletzonestzt
matching_zoneR
((s</usr/lib/python2.7/site-packages/salt/states/libcloud_dns.pytzone_presentJs
	)cC@s�td|�}g|D]}|d|kr|^q}t|�dkr[ttd|�Std|dd|�}t|d|�SdS(	s�
    Ensures a record is absent.

    :param domain: Zone name, i.e. the domain name
    :type  domain: ``str``

    :param profile: The profile key
    :type  profile: ``str``
    slibcloud_dns.list_zonesRisZone already absentslibcloud_dns.delete_zonetidsDeleted zoneN(RRRR(RRRRRR
((s</usr/lib/python2.7/site-packages/salt/states/libcloud_dns.pytzone_absentbs
)cC@std|�}y1g|D]}|d|kr|^qd}Wntk
rattd|�SXtd|d|�}g|D]<}	|	d|kr�|	d|kr�|	d	|kr�|	^q�}
t|
�dkrtd
||d|||�}ttd||�Sttd|�Sd
S(sy
    Ensures a record is present.

    :param name: Record name without the domain name (e.g. www).
                 Note: If you want to create a record for a base domain
                 name, you should specify empty string ('') for this
                 argument.
    :type  name: ``str``

    :param zone: Zone where the requested record is created, the domain name
    :type  zone: ``str``

    :param type: DNS record type (A, AAAA, ...).
    :type  type: ``str``

    :param data: Data for the record (depends on the record type).
    :type  data: ``str``

    :param profile: The profile key
    :type  profile: ``str``
    slibcloud_dns.list_zonesRisCould not locate zoneslibcloud_dns.list_recordsRRRtdataslibcloud_dns.create_recordsCreated new recordsRecord already existsN(Rt
IndexErrorRtFalseRR(RtzoneRRRRRRtrecordstrecordtmatching_recordsR
((s</usr/lib/python2.7/site-packages/salt/states/libcloud_dns.pytrecord_presentus 1


cC@sItd|�}y1g|D]}|d|kr|^qd}Wntk
rattd|�SXtd|d|�}g|D]<}	|	d|kr�|	d|kr�|	d	|kr�|	^q�}
t|
�dkr5g}x3|
D]+}	|jtd
|d|	d|��q�Wtt|�djt|��|�Sttd|�Sd
S(sx
    Ensures a record is absent.

    :param name: Record name without the domain name (e.g. www).
                 Note: If you want to create a record for a base domain
                 name, you should specify empty string ('') for this
                 argument.
    :type  name: ``str``

    :param zone: Zone where the requested record is created, the domain name
    :type  zone: ``str``

    :param type: DNS record type (A, AAAA, ...).
    :type  type: ``str``

    :param data: Data for the record (depends on the record type).
    :type  data: ``str``

    :param profile: The profile key
    :type  profile: ``str``
    slibcloud_dns.list_zonesRisZone could not be foundslibcloud_dns.list_recordsRRRRslibcloud_dns.delete_recordsRemoved {0} recordssRecords already absentN(	RRRRRtappendtalltformatR(RR RRRRRRR!R"R#R
((s</usr/lib/python2.7/site-packages/salt/states/libcloud_dns.pyt
record_absent�s&1



%(
t__doc__t
__future__Rtsalt.utils.compatRRR	RRRRR$R((((s</usr/lib/python2.7/site-packages/salt/states/libcloud_dns.pyt<module>0s						)

Zerion Mini Shell 1.0