File manager - Edit - /opt/saltstack/salt/lib/python3.10/site-packages/salt/states/__pycache__/azurearm_compute.cpython-310.pyc
Back
o ;j�. � @ sj d Z ddlZddlmZ ddlZdZe�e�Z dd� Z dd� Ze d d d ��Zeddd��Z dS )aL Azure (ARM) Compute 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 availability set exists: azurearm_compute.availability_set_present: - name: my_avail_set - resource_group: my_rg - virtual_machines: - my_vm1 - my_vm2 - tags: how_awesome: very contact_name: Elmer Fudd Gantry - connection_auth: {{ profile }} Ensure availability set is absent: azurearm_compute.availability_set_absent: - name: other_avail_set - resource_group: my_rg - connection_auth: {{ profile }} � N��wrapsZazurearm_computec C s dt v rtS dS )zU Only make this state available if the azurearm_compute module is available. �2azurearm_compute.availability_set_create_or_update)Fz#azurearm module could not be loaded)�__salt__�__virtualname__� r r �P/opt/saltstack/salt/lib/python3.10/site-packages/salt/states/azurearm_compute.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 s~ | ddi d�} t |t�sd| d<