%PDF- %PDF-
Mini Shell

Mini Shell

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

�
���^c@@sdZddlmZmZmZdZd�Zdddd�Zddddd	d
�Zd�Z	dddd	dd�Z
dddd
�Zddddd�Zdddd�Z
d�Zd�Zdd�Zdd�Zd�Zdd�Zdd�Zdd�ZdS(u�
Microsoft IIS site management

This module provides the ability to add/remove websites and application pools
from Microsoft IIS.

.. versionadded:: 2016.3.0

i(tabsolute_importtunicode_literalstprint_functionuwin_iiscC@sdtkrtStS(u<
    Load only on minions that have the win_iis module.
    uwin_iis.create_site(t__salt__t__virtualname__tFalse(((s7/usr/lib/python2.7/site-packages/salt/states/win_iis.pyt__virtual__suu*iPcC@s%dj|||jdd��}|S(u[
    Combine the host header, IP address, and TCP port into bindingInformation format.
    u{0}:{1}:{2}u u(tformattreplace(t
hostheadert	ipaddresstporttret((s7/usr/lib/python2.7/site-packages/salt/states/win_iis.pyt_get_binding_infos!uhttpc	C@s�i|d6id6dd6dd6}td�}||kr[dj|�|d<t|d<n�tdr�d	j|�|d<idd
6|d6|d<nQdj|�|d<idd
6|d6|d<td
|||||||�|d<|S(u�
    Ensure the website has been deployed.

    .. note:

        This function only validates against the site name, and will return True even
        if the site already exists with a different configuration. It will not modify
        the configuration of an existing site.

    :param str name: The IIS site name.
    :param str sourcepath: The physical path of the IIS site.
    :param str apppool: The name of the IIS application pool.
    :param str hostheader: The host header of the binding.
    :param str ipaddress: The IP address of the binding.
    :param str port: The TCP port of the binding.
    :param str protocol: The application protocol of the binding.

    .. note:

        If an application pool is specified, and that application pool does not already exist,
        it will be created.

    Example of usage with only the required arguments. This will default to using the default application pool
    assigned by IIS:

    .. code-block:: yaml

        site0-deployed:
            win_iis.deployed:
                - name: site0
                - sourcepath: C:\inetpub\site0

    Example of usage specifying all available arguments:

    .. code-block:: yaml

        site0-deployed:
            win_iis.deployed:
                - name: site0
                - sourcepath: C:\inetpub\site0
                - apppool: site0
                - hostheader: site0.local
                - ipaddress: '*'
                - port: 443
                - protocol: https
    unameuchangesuresultuucommentuwin_iis.list_sitesuSite already present: {0}utestuSite will be created: {0}uoldunewuCreated site: {0}uwin_iis.create_siteN(tNoneRRtTruet__opts__(	tnamet
sourcepathtapppoolR	R
RtprotocolRt
current_sites((s7/usr/lib/python2.7/site-packages/salt/states/win_iis.pytdeployed&s&/






	
cC@s�i|d6id6dd6dd6}td�}||kr[dj|�|d<t|d<nwtdr�d	j|�|d<i|d
6dd6|d<n?dj|�|d<i|d
6dd6|d<td
|�|d<|S(u�
    Delete a website from IIS.

    :param str name: The IIS site name.

    Usage:

    .. code-block:: yaml

        defaultwebsite-remove:
            win_iis.remove_site:
                - name: Default Web Site
    unameuchangesuresultuucommentuwin_iis.list_sitesu"Site has already been removed: {0}utestuSite will be removed: {0}uoldunewuRemoved site: {0}uwin_iis.remove_siteN(RRRRR(RRR((s7/usr/lib/python2.7/site-packages/salt/states/win_iis.pytremove_sitems"






c
C@s�i|d6id6t�d6d
d6}t|||�}td|�}	||	krsdj|�|d<t|d<n�tdr�dj|�|d<id
d	6|d
6|d<nNdj|�|d<id
d	6|d
6|d<td||||||�|d<|S(u�
    Create an IIS binding.

    .. note:

        This function only validates against the binding ipaddress:port:hostheader combination,
        and will return True even if the binding already exists with a different configuration.
        It will not modify the configuration of an existing binding.

    :param str site: The IIS site name.
    :param str hostheader: The host header of the binding.
    :param str ipaddress: The IP address of the binding.
    :param str port: The TCP port of the binding.
    :param str protocol: The application protocol of the binding.
    :param str sslflags: The flags representing certificate type and storage of the binding.

    Example of usage with only the required arguments:

    .. code-block:: yaml

        site0-https-binding:
            win_iis.create_binding:
                - site: site0

    Example of usage specifying all available arguments:

    .. code-block:: yaml

        site0-https-binding:
            win_iis.create_binding:
                - site: site0
                - hostheader: site0.local
                - ipaddress: '*'
                - port: 443
                - protocol: https
                - sslflags: 0
    unameuchangesucommenturesultuwin_iis.list_bindingsuBinding already present: {0}utestuBinding will be created: {0}uoldunewuCreated binding: {0}uwin_iis.create_bindingN(tstrRR
RRRR(
RtsiteR	R
RRtsslflagsRtbinding_infotcurrent_bindings((s7/usr/lib/python2.7/site-packages/salt/states/win_iis.pytcreate_binding�s&&






cC@s�i|d6id6t�d6d
d6}t|||�}td|�}||krsdj|�|d<t|d<n�tdr�dj|�|d<i|d	6d
d
6|d<nHdj|�|d<i|d	6d
d
6|d<td||||�|d<|S(u�
    Remove an IIS binding.

    :param str site: The IIS site name.
    :param str hostheader: The host header of the binding.
    :param str ipaddress: The IP address of the binding.
    :param str port: The TCP port of the binding.

    Example of usage with only the required arguments:

    .. code-block:: yaml

        site0-https-binding-remove:
            win_iis.remove_binding:
                - site: site0

    Example of usage specifying all available arguments:

    .. code-block:: yaml

        site0-https-binding-remove:
            win_iis.remove_binding:
                - site: site0
                - hostheader: site0.local
                - ipaddress: '*'
                - port: 443
    unameuchangesucommenturesultuwin_iis.list_bindingsu%Binding has already been removed: {0}utestuBinding will be removed: {0}uoldunewuRemoved binding: {0}uwin_iis.remove_bindingN(RRR
RRRR(RRR	R
RRRR((s7/usr/lib/python2.7/site-packages/salt/states/win_iis.pytremove_binding�s&







i�c
C@s8i|d6id6t�d6dd6}t|||�}td|�}||kr�||d}	||	kr�dj|�|d<t|d<|Sdj|	�|d<t|d<n�td	r�d
j|�|d<idd6|d6|d<nNd
j|�|d<idd6|d6|d<td||||||�|d<|S(u�
    Assign a certificate to an IIS binding.

    .. note:

        The web binding that the certificate is being assigned to must already exist.

    :param str name: The thumbprint of the certificate.
    :param str site: The IIS site name.
    :param str hostheader: The host header of the binding.
    :param str ipaddress: The IP address of the binding.
    :param str port: The TCP port of the binding.
    :param str sslflags: Flags representing certificate type and certificate storage of the binding.

    Example of usage with only the required arguments:

    .. code-block:: yaml

        site0-cert-binding:
            win_iis.create_cert_binding:
                - name: 9988776655443322111000AAABBBCCCDDDEEEFFF
                - site: site0

    Example of usage specifying all available arguments:

    .. code-block:: yaml

        site0-cert-binding:
            win_iis.create_cert_binding:
                - name: 9988776655443322111000AAABBBCCCDDDEEEFFF
                - site: site0
                - hostheader: site0.local
                - ipaddress: 192.168.1.199
                - port: 443
                - sslflags: 1

    .. versionadded:: 2016.11.0
    unameuchangesucommenturesultuwin_iis.list_cert_bindingsucertificatehashu(Certificate binding already present: {0}uDCertificate binding already present with a different thumbprint: {0}utestu(Certificate binding will be created: {0}uoldunewu Created certificate binding: {0}uwin_iis.create_cert_bindingN(RRR
RRRRR(
RRR	R
RRRRtcurrent_cert_bindingstcurrent_name((s7/usr/lib/python2.7/site-packages/salt/states/win_iis.pytcreate_cert_bindings2'








c	C@si|d6id6t�d6dd6}t|||�}td|�}||krsdj|�|d<t|d<n�tdr�dj|�|d<i|d	6dd
6|d<nh||d}||krdj|�|d<i|d	6dd
6|d<td
|||||�|d<n|S(uU
    Remove a certificate from an IIS binding.

    .. note:

        This function only removes the certificate from the web binding. It does
        not remove the web binding itself.

    :param str name: The thumbprint of the certificate.
    :param str site: The IIS site name.
    :param str hostheader: The host header of the binding.
    :param str ipaddress: The IP address of the binding.
    :param str port: The TCP port of the binding.

    Example of usage with only the required arguments:

    .. code-block:: yaml

        site0-cert-binding-remove:
            win_iis.remove_cert_binding:
                - name: 9988776655443322111000AAABBBCCCDDDEEEFFF
                - site: site0

    Example of usage specifying all available arguments:

    .. code-block:: yaml

        site0-cert-binding-remove:
            win_iis.remove_cert_binding:
                - name: 9988776655443322111000AAABBBCCCDDDEEEFFF
                - site: site0
                - hostheader: site0.local
                - ipaddress: 192.168.1.199
                - port: 443

    .. versionadded:: 2016.11.0
    unameuchangesucommenturesultuwin_iis.list_cert_bindingsu1Certificate binding has already been removed: {0}utestu(Certificate binding will be removed: {0}uoldunewucertificatehashu Removed certificate binding: {0}uwin_iis.remove_cert_bindingN(RRR
RRRR(	RRR	R
RRRRR ((s7/usr/lib/python2.7/site-packages/salt/states/win_iis.pytremove_cert_bindingJs*&






cC@s�i|d6id6dd6dd6}td�}||kr[dj|�|d<t|d<nwtdr�d	j|�|d<idd
6|d6|d<n?dj|�|d<idd
6|d6|d<td
|�|d<|S(u�
    Create an IIS application pool.

    .. note:

        This function only validates against the application pool name, and will return
        True even if the application pool already exists with a different configuration.
        It will not modify the configuration of an existing application pool.

    :param str name: The name of the IIS application pool.

    Usage:

    .. code-block:: yaml

        site0-apppool:
            win_iis.create_apppool:
                - name: site0
    unameuchangesuresultuucommentuwin_iis.list_apppoolsu%Application pool already present: {0}utestu%Application pool will be created: {0}uoldunewuCreated application pool: {0}uwin_iis.create_apppoolN(RRRRR(RRtcurrent_apppools((s7/usr/lib/python2.7/site-packages/salt/states/win_iis.pytcreate_apppool�s"






cC@s�i|d6id6dd6dd6}td�}||kr[dj|�|d<t|d<nwtdr�d	j|�|d<i|d
6dd6|d<n?dj|�|d<i|d
6dd6|d<td
|�|d<|S(u�
    Remove an IIS application pool.

    :param str name: The name of the IIS application pool.

    Usage:

    .. code-block:: yaml

        defaultapppool-remove:
            win_iis.remove_apppool:
                - name: DefaultAppPool
    unameuchangesuresultuucommentuwin_iis.list_apppoolsu.Application pool has already been removed: {0}utestu%Application pool will be removed: {0}uoldunewuRemoved application pool: {0}uwin_iis.remove_apppoolN(RRRRR(RRR#((s7/usr/lib/python2.7/site-packages/salt/states/win_iis.pytremove_apppool�s"






c	C@swidd6dd6dd6dd6d	d
6}i|d6id6t�d
6dd6}|sld|d
<t|d<|Siid6id6}tdd|d|d|j��}x�|D]�}|dkr�|||j�kr�|||||<nt||�t||�kr�i||d6||d6|d|<q�q�W|dsVd|d
<t|d<|Stdrxd|d
<||d<|Stdd|d|d|�tdd|d|d|j��}xi|D]a}t||�t||�kr�i||d6||d6|d|<|dj|d�q�q�W|drQd|d
<||d<t|d<n"d|d
<|d|d<t|d<|S(u�
    Set the value of the setting for an IIS container.

    :param str name: The name of the IIS container.
    :param str container: The type of IIS container. The container types are:
        AppPools, Sites, SslBindings
    :param str settings: A dictionary of the setting names and their values.
        Example of usage for the ``AppPools`` container:

    .. code-block:: yaml

        site0-apppool-setting:
            win_iis.container_setting:
                - name: site0
                - container: AppPools
                - settings:
                    managedPipelineMode: Integrated
                    processModel.maxProcesses: 1
                    processModel.userName: TestUser
                    processModel.password: TestPassword
                    processModel.identityType: SpecificUser

    Example of usage for the ``Sites`` container:

    .. code-block:: yaml

        site0-site-setting:
            win_iis.container_setting:
                - name: site0
                - container: Sites
                - settings:
                    logFile.logFormat: W3C
                    logFile.period: Daily
                    limits.maxUrlSegments: 32
    uLocalSystemiuLocalServiceiuNetworkServiceiuSpecificUseriuApplicationPoolIdentityiunameuchangesucommenturesultuNo settings to change provided.ufailuresuwin_iis.get_container_settingRt	containertsettingsuprocessModel.identityTypeuoldunewu-Settings already contain the provided values.utestuSettings will be changed.uwin_iis.set_container_settinguSome settings failed to change.u,Set settings to contain the provided values.N(RRRRtkeysRtpopR(	RR&R'tidentityType_map2stringRtret_settingstcurrent_settingstsettingtnew_settings((s7/usr/lib/python2.7/site-packages/salt/states/win_iis.pytcontainer_setting�s\%)






" 






 





cC@s�i|d6id6t�d6d
d6}td|�}||kradj|�|d<t|d<n�tdr�dj|�|d<id
d	6|d
6|d<nHdj|�|d<id
d	6|d
6|d<td||||�|d<|S(u�
    Create an IIS application.

    .. note:

        This function only validates against the application name, and will return True
        even if the application already exists with a different configuration. It will not
        modify the configuration of an existing application.

    :param str name: The IIS application.
    :param str site: The IIS site name.
    :param str sourcepath: The physical path.
    :param str apppool: The name of the IIS application pool.

    Example of usage with only the required arguments:

    .. code-block:: yaml

        site0-v1-app:
            win_iis.create_app:
                - name: v1
                - site: site0
                - sourcepath: C:\inetpub\site0\v1

    Example of usage specifying all available arguments:

    .. code-block:: yaml

        site0-v1-app:
            win_iis.create_app:
                - name: v1
                - site: site0
                - sourcepath: C:\inetpub\site0\v1
                - apppool: site0
    unameuchangesucommenturesultuwin_iis.list_appsu Application already present: {0}utestu Application will be created: {0}uoldunewuCreated application: {0}uwin_iis.create_appN(RRRRRR(RRRRRtcurrent_apps((s7/usr/lib/python2.7/site-packages/salt/states/win_iis.pyt
create_app<s$$







cC@s�i|d6id6t�d6d
d6}td|�}||kradj|�|d<t|d<nztdr�dj|�|d<i|d	6d
d
6|d<nBdj|�|d<i|d	6d
d
6|d<td||�|d<|S(u
    Remove an IIS application.

    :param str name: The application name.
    :param str site: The IIS site name.

    Usage:

    .. code-block:: yaml

        site0-v1-app-remove:
            win_iis.remove_app:
                - name: v1
                - site: site0
    unameuchangesucommenturesultuwin_iis.list_appsu)Application has already been removed: {0}utestu Application will be removed: {0}uoldunewuRemoved application: {0}uwin_iis.remove_appN(RRRRRR(RRRR0((s7/usr/lib/python2.7/site-packages/salt/states/win_iis.pyt
remove_appws"






u/cC@s�i|d6id6t�d6d
d6}td||�}||krddj|�|d<t|d<n�tdr�dj|�|d<id
d	6|d
6|d<nHdj|�|d<id
d	6|d
6|d<td||||�|d<|S(u�
    Create an IIS virtual directory.

    .. note:

        This function only validates against the virtual directory name, and will return
        True even if the virtual directory already exists with a different configuration.
        It will not modify the configuration of an existing virtual directory.

    :param str name: The virtual directory name.
    :param str site: The IIS site name.
    :param str sourcepath: The physical path.
    :param str app: The IIS application.

    Example of usage with only the required arguments:

    .. code-block:: yaml

        site0-foo-vdir:
            win_iis.create_vdir:
                - name: foo
                - site: site0
                - sourcepath: C:\inetpub\vdirs\foo

    Example of usage specifying all available arguments:

    .. code-block:: yaml

        site0-foo-vdir:
            win_iis.create_vdir:
                - name: foo
                - site: site0
                - sourcepath: C:\inetpub\vdirs\foo
                - app: v1
    unameuchangesucommenturesultuwin_iis.list_vdirsu&Virtual directory already present: {0}utestu&Virtual directory will be created: {0}uoldunewuCreated virtual directory: {0}uwin_iis.create_vdirN(RRRRRR(RRRtappRt
current_vdirs((s7/usr/lib/python2.7/site-packages/salt/states/win_iis.pytcreate_vdir�s$$







cC@s�i|d6id6t�d6d
d6}td||�}||krddj|�|d<t|d<n}tdr�dj|�|d<i|d	6d
d
6|d<nEdj|�|d<i|d	6d
d
6|d<td|||�|d<|S(uc
    Remove an IIS virtual directory.

    :param str name: The virtual directory name.
    :param str site: The IIS site name.
    :param str app: The IIS application.

    Example of usage with only the required arguments:

    .. code-block:: yaml

        site0-foo-vdir-remove:
            win_iis.remove_vdir:
                - name: foo
                - site: site0

    Example of usage specifying all available arguments:

    .. code-block:: yaml

        site0-foo-vdir-remove:
            win_iis.remove_vdir:
                - name: foo
                - site: site0
                - app: v1
    unameuchangesucommenturesultuwin_iis.list_vdirsu/Virtual directory has already been removed: {0}utestu&Virtual directory will be removed: {0}uoldunewuRemoved virtual directory: {0}uwin_iis.remove_vdirN(RRRRRR(RRR3RR4((s7/usr/lib/python2.7/site-packages/salt/states/win_iis.pytremove_vdir�s"






cC@si|d6id6t�d6dd6}|sCd|d<t|d<|Siid6id6}tdd|d	|d
|j��}xU|D]M}t||�t||�kr�i||d6||d6|d|<q�q�W|ds�d
|d<t|d<|Stdrd|d<||d<|Stdd|d	|d
|�tdd|d	|d
|j��}xi|D]a}t||�t||�krai||d6||d6|d|<|dj|d�qaqaW|dr�d|d<||d<t|d<n"d|d<|d|d<t|d<|S(u�
    .. versionadded:: 2017.7.0

    Set the value of the setting for an IIS web application.

    .. note::
        This function only configures existing app. Params are case sensitive.

    :param str name: The IIS application.
    :param str site: The IIS site name.
    :param str settings: A dictionary of the setting names and their values.

    Available settings:

    - ``physicalPath`` - The physical path of the webapp
    - ``applicationPool`` - The application pool for the webapp
    - ``userName`` "connectAs" user
    - ``password`` "connectAs" password for user

    :rtype: bool

    Example of usage:

    .. code-block:: yaml

        site0-webapp-setting:
            win_iis.set_app:
                - name: app0
                - site: Default Web Site
                - settings:
                    userName: domain\user
                    password: pass
                    physicalPath: c:\inetpub\wwwroot
                    applicationPool: appPool0
    unameuchangesucommenturesultuNo settings to change provided.ufailuresuwin_iis.get_webapp_settingsRRR'uoldunewu-Settings already contain the provided values.utestuSettings will be changed.uwin_iis.set_webapp_settingsuSome settings failed to change.u,Set settings to contain the provided values.N(RRRRR(RR)R(RRR'RR+R,R-R.((s7/usr/lib/python2.7/site-packages/salt/states/win_iis.pytset_appsT&






 





%
 





N(t__doc__t
__future__RRRRRR
RRRRR!R"R$R%RR/R1R2R5R6R7(((s7/usr/lib/python2.7/site-packages/salt/states/win_iis.pyt<module>
s$			G	%>4FA	+	&`;	&<2

Zerion Mini Shell 1.0