File manager - Edit - /opt/saltstack/salt/lib/python3.10/site-packages/salt/states/__pycache__/azurearm_network.cpython-310.pyc
Back
o ;jqb � @ s� d Z ddlZddlmZ ddlZdZe�e�Z dd� Z dd� Ze d-d d ��Zed.dd��Z e d-d d��Zed.dd��Ze d-dd��Zed.dd��Ze d/dd��Zed.dd��Ze d/dd��Zed.dd��Ze d0dd��Zed.dd ��Ze d1d!d"��Zed.d#d$��Ze d2d%d&��Zed.d'd(��Ze d3d)d*��Zed.d+d,��ZdS )4a� Azure (ARM) Network State Module .. versionadded:: 2019.2.0 .. warning:: This cloud provider will be removed from Salt in version 3007 in favor of the `saltext.azurerm Salt Extension <https://github.com/salt-extensions/saltext-azurerm>`_ :maintainer: <devops@eitr.tech> :maturity: new :depends: * `azure <https://pypi.python.org/pypi/azure>`_ >= 2.0.0 * `azure-common <https://pypi.python.org/pypi/azure-common>`_ >= 1.1.8 * `azure-mgmt <https://pypi.python.org/pypi/azure-mgmt>`_ >= 1.0.0 * `azure-mgmt-compute <https://pypi.python.org/pypi/azure-mgmt-compute>`_ >= 1.0.0 * `azure-mgmt-network <https://pypi.python.org/pypi/azure-mgmt-network>`_ >= 1.7.1 * `azure-mgmt-resource <https://pypi.python.org/pypi/azure-mgmt-resource>`_ >= 1.1.0 * `azure-mgmt-storage <https://pypi.python.org/pypi/azure-mgmt-storage>`_ >= 1.0.0 * `azure-mgmt-web <https://pypi.python.org/pypi/azure-mgmt-web>`_ >= 0.32.0 * `azure-storage <https://pypi.python.org/pypi/azure-storage>`_ >= 0.34.3 * `msrestazure <https://pypi.python.org/pypi/msrestazure>`_ >= 0.4.21 :platform: linux :configuration: This module requires Azure Resource Manager credentials to be passed as a dictionary of keyword arguments to the ``connection_auth`` parameter in order to work properly. Since the authentication parameters are sensitive, it's recommended to pass them to the states via pillar. Required provider parameters: if using username and password: * ``subscription_id`` * ``username`` * ``password`` if using a service principal: * ``subscription_id`` * ``tenant`` * ``client_id`` * ``secret`` Optional provider parameters: **cloud_environment**: Used to point the cloud driver to different API endpoints, such as Azure GovCloud. Possible values: * ``AZURE_PUBLIC_CLOUD`` (default) * ``AZURE_CHINA_CLOUD`` * ``AZURE_US_GOV_CLOUD`` * ``AZURE_GERMAN_CLOUD`` Example Pillar for Azure Resource Manager authentication: .. code-block:: yaml azurearm: user_pass_auth: subscription_id: 3287abc8-f98a-c678-3bde-326766fd3617 username: fletch password: 123pass mysubscription: subscription_id: 3287abc8-f98a-c678-3bde-326766fd3617 tenant: ABCDEFAB-1234-ABCD-1234-ABCDEFABCDEF client_id: ABCDEFAB-1234-ABCD-1234-ABCDEFABCDEF secret: XXXXXXXXXXXXXXXXXXXXXXXX cloud_environment: AZURE_PUBLIC_CLOUD Example states using Azure Resource Manager authentication: .. code-block:: jinja {% set profile = salt['pillar.get']('azurearm:mysubscription') %} Ensure virtual network exists: azurearm_network.virtual_network_present: - name: my_vnet - resource_group: my_rg - address_prefixes: - '10.0.0.0/8' - '192.168.0.0/16' - dns_servers: - '8.8.8.8' - tags: how_awesome: very contact_name: Elmer Fudd Gantry - connection_auth: {{ profile }} Ensure virtual network is absent: azurearm_network.virtual_network_absent: - name: other_vnet - resource_group: my_rg - connection_auth: {{ profile }} � N��wrapsZazurearm_networkc C s dt v rtS dS )zU Only make this state available if the azurearm_network module is available. z.azurearm_network.check_ip_address_availability)Fz+azurearm_network module could not be loaded)�__salt__�__virtualname__� r r �P/opt/saltstack/salt/lib/python3.10/site-packages/salt/states/azurearm_network.py�__virtual__i s r c s t � �� fdd��}|S )z> Decorator wrapper to warn about azurearm deprecation c s6 t jjjddtd� � | i t jjjdi |����}|S )NZChlorinez�The 'azurearm' functionality in Salt has been deprecated and its functionality will be removed in version 3007 in favor of the saltext.azurerm Salt Extension. (https://github.com/salt-extensions/saltext-azurerm))�categoryr )�salt�utilsZversionsZ warn_until� FutureWarning�argsZclean_kwargs)r �kwargs�ret��functionr r �wrappedw s �z%_deprecation_message.<locals>.wrappedr )r r r r r �_deprecation_messager s r c K s� | ddi d�}t |t�sd|d<