golden hour
/opt/saltstack/salt/lib/python3.10/site-packages/salt/cloud/clouds/__pycache__
⬆️ Go Up
Upload
File/Folder
Size
Actions
__init__.cpython-310.pyc
171 B
Del
OK
aliyun.cpython-310.pyc
19.81 KB
Del
OK
azurearm.cpython-310.pyc
39.67 KB
Del
OK
clc.cpython-310.pyc
8.91 KB
Del
OK
cloudstack.cpython-310.pyc
10.87 KB
Del
OK
digitalocean.cpython-310.pyc
27.39 KB
Del
OK
dimensiondata.cpython-310.pyc
12.62 KB
Del
OK
ec2.cpython-310.pyc
92.28 KB
Del
OK
gce.cpython-310.pyc
48.78 KB
Del
OK
gogrid.cpython-310.pyc
11.07 KB
Del
OK
hetzner.cpython-310.pyc
11.82 KB
Del
OK
joyent.cpython-310.pyc
22.78 KB
Del
OK
libvirt.cpython-310.pyc
16.69 KB
Del
OK
linode.cpython-310.pyc
59.17 KB
Del
OK
lxc.cpython-310.pyc
10.9 KB
Del
OK
msazure.cpython-310.pyc
71.44 KB
Del
OK
oneandone.cpython-310.pyc
18.39 KB
Del
OK
opennebula.cpython-310.pyc
90.2 KB
Del
OK
openstack.cpython-310.pyc
23.53 KB
Del
OK
packet.cpython-310.pyc
12.06 KB
Del
OK
parallels.cpython-310.pyc
11.89 KB
Del
OK
profitbricks.cpython-310.pyc
25.34 KB
Del
OK
proxmox.cpython-310.pyc
27.25 KB
Del
OK
pyrax.cpython-310.pyc
2.59 KB
Del
OK
qingcloud.cpython-310.pyc
16.64 KB
Del
OK
saltify.cpython-310.pyc
11.91 KB
Del
OK
scaleway.cpython-310.pyc
9.36 KB
Del
OK
softlayer.cpython-310.pyc
13.26 KB
Del
OK
softlayer_hw.cpython-310.pyc
13.5 KB
Del
OK
tencentcloud.cpython-310.pyc
20.55 KB
Del
OK
vagrant.cpython-310.pyc
8.32 KB
Del
OK
virtualbox.cpython-310.pyc
9.57 KB
Del
OK
vmware.cpython-310.pyc
94.14 KB
Del
OK
vultrpy.cpython-310.pyc
12.8 KB
Del
OK
xen.cpython-310.pyc
25.66 KB
Del
OK
Edit: azurearm.cpython-310.pyc
o �xeZ � @ s� d Z ddlZddlZddlZddlZddlZddlZddlZddlm Z ddl mZ ddlm Z ddlZddlmZ ddlZddlZddlZddlZddlZddlZddlZddlmZmZmZmZ dZz(ddlm m! m"Z# ddl$m m% m"Z& ddl'm(Z( dd l)m*Z* d ZW n e+y� Y nw dZ,e�-e.�Z/dd � Z0dd� Z1dd� Z2e2dPdd��Z3e2dQdd��Z4dd� Z5e2dd� �Z6e2dd� �Z7e2dPdd��Z8e2dQdd��Z9e2dQd d!��Z:e2dQd"d#��Z;e2dQd$d%��Z<e2dQd&d'��Z=e2dQd(d)��Z>e2dQd*d+��Z?e2dPd,d-��Z@d.d/� ZAd0d1� ZBe2dPd2d3��ZCdQd4d5�ZDe2d6d7� �ZEe2dPd8d9��ZFe2dQd:d;��ZGd<d=� ZHdQd>d?�ZIe2dPd@dA��ZJe2dPdBdC��ZKe2dPdDdE��ZLe2dPdFdG��ZMe2dPdHdI��ZNe2 dPdJdK��ZOe2dQdLdM��ZPe2dQdNdO��ZQdS )RaG Azure ARM Cloud Module ====================== .. versionadded:: 2016.11.0 .. versionchanged:: 2019.2.0 The Azure ARM cloud module is used to control access to Microsoft Azure Resource Manager .. 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> :depends: * `azure <https://pypi.python.org/pypi/azure>`_ >= 2.0.0rc6 * `azure-common <https://pypi.python.org/pypi/azure-common>`_ >= 1.1.4 * `azure-mgmt <https://pypi.python.org/pypi/azure-mgmt>`_ >= 0.30.0rc6 * `azure-mgmt-compute <https://pypi.python.org/pypi/azure-mgmt-compute>`_ >= 0.33.0 * `azure-mgmt-network <https://pypi.python.org/pypi/azure-mgmt-network>`_ >= 0.30.0rc6 * `azure-mgmt-resource <https://pypi.python.org/pypi/azure-mgmt-resource>`_ >= 0.30.0 * `azure-mgmt-storage <https://pypi.python.org/pypi/azure-mgmt-storage>`_ >= 0.30.0rc6 * `azure-mgmt-web <https://pypi.python.org/pypi/azure-mgmt-web>`_ >= 0.30.0rc6 * `azure-storage <https://pypi.python.org/pypi/azure-storage>`_ >= 0.32.0 * `msrestazure <https://pypi.python.org/pypi/msrestazure>`_ >= 0.4.21 :configuration: Required provider parameters: if using username and password: * ``subscription_id`` * ``username`` * ``password`` if using a service principal: * ``subscription_id`` * ``tenant`` * ``client_id`` * ``secret`` if using Managed Service Identity authentication: * ``subscription_id`` 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`` * HTTP base URL for a custom endpoint, such as Azure Stack. The ``/metadata/endpoints`` path will be added to the URL. **userdata** and **userdata_file**: Azure Resource Manager uses a separate VirtualMachineExtension object to pass userdata scripts to the virtual machine. Arbitrary shell commands can be passed via the ``userdata`` parameter, or via a file local to the Salt Cloud system using the ``userdata_file`` parameter. Note that the local file is not treated as a script by the extension, so "one-liners" probably work best. If greater functionality is desired, a web-hosted script file can be specified via ``userdata_file: https://raw.githubusercontent.com/account/repo/master/azure-script.py``, which will be executed on the system after VM creation. For Windows systems, script files ending in ``.ps1`` will be executed with ``powershell.exe``. The ``userdata`` parameter takes precedence over the ``userdata_file`` parameter when creating the custom script extension. **win_installer**: This parameter, which holds the local path to the Salt Minion installer package, is used to determine if the virtual machine type will be "Windows". Only set this parameter on profiles which install Windows operating systems. Example ``/etc/salt/cloud.providers`` or ``/etc/salt/cloud.providers.d/azure.conf`` configuration: .. code-block:: yaml my-azure-config with username and password: driver: azurearm subscription_id: 3287abc8-f98a-c678-3bde-326766fd3617 username: larry password: 123pass Or my-azure-config with service principal: driver: azurearm 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_US_GOV_CLOUD The Service Principal can be created with the new Azure CLI (https://github.com/Azure/azure-cli) with: az ad sp create-for-rbac -n "http://<yourappname>" --role <role> --scopes <scope> For example, this creates a service principal with 'owner' role for the whole subscription: az ad sp create-for-rbac -n "http://mysaltapp" --role owner --scopes /subscriptions/3287abc8-f98a-c678-3bde-326766fd3617 *Note: review the details of Service Principals. Owner role is more than you normally need, and you can restrict scope to a resource group or individual resources. � N��wraps)� cpu_count)� ThreadPool)�SaltCloudConfigError�SaltCloudExecutionFailure�SaltCloudExecutionTimeout�SaltCloudSystemExitF)�BlockBlobService)� CloudErrorT�azurearmc C s t � du rdS t� du rdS tS )z) Check for Azure configurations. F)Fz�The following dependencies are required to use the AzureARM driver: Microsoft Azure SDK for Python >= 2.0rc6, Microsoft Azure Storage SDK for Python >= 0.32, MS REST Azure (msrestazure) >= 0.4)�get_configured_provider�get_dependencies�__virtualname__� r r �N/opt/saltstack/salt/lib/python3.10/site-packages/salt/cloud/clouds/azurearm.py�__virtual__� s r c C s"