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: openstack.cpython-310.pyc
o �xeq � @ s� d Z ddlZddlZddlZddlZddlZddlmZ ddlm Z m Z mZmZ ddl mZ zddlZddlZddlZddlZeej�ed�kdfZW n eyV dZY nw e�e�ZdZd d � Zdd� Zd d� Zdd� Zdd� Zdd� Zdd� Z dd� Z!d8dd�Z"d8dd�Z#d9dd�Z$d8d d!�Z%d8d"d#�Z&d8d$d%�Z'd8d&d'�Z(d8d(d)�Z)d8d*d+�Z*d:d,d-�Z+d.d/� Z,d8d0d1�Z-d2d3� Z.d8d4d5�Z/d:d6d7�Z0dS );aO! Openstack Cloud Driver ====================== :depends: `shade>=1.19.0 <https://pypi.python.org/pypi/shade>`_ OpenStack is an open source project that is in use by a number a cloud providers, each of which have their own ways of using it. This OpenStack driver uses a the shade python module which is managed by the OpenStack Infra team. This module is written to handle all the different versions of different OpenStack tools for salt, so most commands are just passed over to the module to handle everything. Provider -------- There are two ways to configure providers for this driver. The first one is to just let shade handle everything, and configure using os-client-config_ and setting up `/etc/openstack/clouds.yml`. .. code-block:: yaml clouds: democloud: region_name: RegionOne auth: username: 'demo' password: secret project_name: 'demo' auth_url: 'http://openstack/identity' And then this can be referenced in the salt provider based on the `democloud` name. .. code-block:: yaml myopenstack: driver: openstack cloud: democloud region_name: RegionOne This allows for just using one configuration for salt-cloud and for any other openstack tools which are all using `/etc/openstack/clouds.yml` The other method allows for specifying everything in the provider config, instead of using the extra configuration file. This will allow for passing salt-cloud configs only through pillars for minions without having to write a clouds.yml file on each minion.abs .. code-block:: yaml myopenstack: driver: openstack region_name: RegionOne auth: username: 'demo' password: secret project_name: 'demo' user_domain_name: default, project_domain_name: default, auth_url: 'http://openstack/identity' Or if you need to use a profile to setup some extra stuff, it can be passed as a `profile` to use any of the vendor_ config options. .. code-block:: yaml myrackspace: driver: openstack profile: rackspace auth: username: rackusername api_key: myapikey region_name: ORD auth_type: rackspace_apikey And this will pull in the profile for rackspace and setup all the correct options for the auth_url and different api versions for services. Profile ------- Most of the options for building servers are just passed on to the create_server_ function from shade. The salt specific ones are: - ssh_key_file: The path to the ssh key that should be used to login to the machine to bootstrap it - ssh_key_file: The name of the keypair in openstack - userdata_template: The renderer to use if the userdata is a file that is templated. Default: False - ssh_interface: The interface to use to login for bootstrapping: public_ips, private_ips, floating_ips, fixed_ips - ignore_cidr: Specify a CIDR range of unreachable private addresses for salt to ignore when connecting .. code-block:: yaml centos: provider: myopenstack image: CentOS 7 size: ds1G ssh_key_name: mykey ssh_key_file: /root/.ssh/id_rsa This is the minimum setup required. If metadata is set to make sure that the host has finished setting up the `wait_for_metadata` can be set. .. code-block:: yaml centos: provider: myopenstack image: CentOS 7 size: ds1G ssh_key_name: mykey ssh_key_file: /root/.ssh/id_rsa meta: build_config: rack_user_only wait_for_metadata: rax_service_level_automation: Complete rackconnect_automation_status: DEPLOYED If your OpenStack instances only have private IP addresses and a CIDR range of private addresses are not reachable from the salt-master, you may set your preference to have Salt ignore it: .. code-block:: yaml my-openstack-config: ignore_cidr: 192.168.0.0/16 Anything else from the create_server_ docs can be passed through here. - **image**: Image dict, name or ID to boot with. image is required unless boot_volume is given. - **flavor**: Flavor dict, name or ID to boot onto. - **auto_ip**: Whether to take actions to find a routable IP for the server. (defaults to True) - **ips**: List of IPs to attach to the server (defaults to None) - **ip_pool**: Name of the network or floating IP pool to get an address from. (defaults to None) - **root_volume**: Name or ID of a volume to boot from (defaults to None - deprecated, use boot_volume) - **boot_volume**: Name or ID of a volume to boot from (defaults to None) - **terminate_volume**: If booting from a volume, whether it should be deleted when the server is destroyed. (defaults to False) - **volumes**: (optional) A list of volumes to attach to the server - **meta**: (optional) A dict of arbitrary key/value metadata to store for this server. Both keys and values must be <=255 characters. - **files**: (optional, deprecated) A dict of files to overwrite on the server upon boot. Keys are file names (i.e. ``/etc/passwd``) and values are the file contents (either as a string or as a file-like object). A maximum of five entries is allowed, and each file must be 10k or less. - **reservation_id**: a UUID for the set of servers being requested. - **min_count**: (optional extension) The minimum number of servers to launch. - **max_count**: (optional extension) The maximum number of servers to launch. - **security_groups**: A list of security group names - **userdata**: user data to pass to be exposed by the metadata server this can be a file type object as well or a string. - **key_name**: (optional extension) name of previously created keypair to inject into the instance. - **availability_zone**: Name of the availability zone for instance placement. - **block_device_mapping**: (optional) A list of dictionaries representing legacy block device mappings for this server. See `documentation <https://docs.openstack.org/nova/latest/user/block-device-mapping.html#block-device-mapping-v1-aka-legacy>`_ for details. - **block_device_mapping_v2**: (optional) A list of dictionaries representing block device mappings for this server. See `v2 documentation <https://docs.openstack.org/nova/latest/user/block-device-mapping.html#block-device-mapping-v2>`_ for details. - **nics**: (optional extension) an ordered list of nics to be added to this server, with information about connected networks, fixed IPs, port etc. - **scheduler_hints**: (optional extension) arbitrary key-value pairs specified by the client to help boot an instance - **config_drive**: (optional extension) value for config drive either boolean, or volume-id - **disk_config**: (optional extension) control how the disk is partitioned when the server is created. possible values are 'AUTO' or 'MANUAL'. - **admin_pass**: (optional extension) add a user supplied admin password. - **timeout**: (optional) Seconds to wait, defaults to 60. See the ``wait`` parameter. - **reuse_ips**: (optional) Whether to attempt to reuse pre-existing floating ips should a floating IP be needed (defaults to True) - **network**: (optional) Network dict or name or ID to attach the server to. Mutually exclusive with the nics parameter. Can also be be a list of network names or IDs or network dicts. - **boot_from_volume**: Whether to boot from volume. 'boot_volume' implies True, but boot_from_volume=True with no boot_volume is valid and will create a volume from the image and use that. - **volume_size**: When booting an image from volume, how big should the created volume be? Defaults to 50. - **nat_destination**: Which network should a created floating IP be attached to, if it's not possible to infer from the cloud's configuration. (Optional, defaults to None) - **group**: ServerGroup dict, name or id to boot the server in. If a group is provided in both scheduler_hints and in the group param, the group param will win. (Optional, defaults to None) .. note:: If there is anything added, that is not in this list, it can be added to an `extras` dictionary for the profile, and that will be to the create_server function. .. _create_server: https://docs.openstack.org/shade/latest/user/usage.html#shade.OpenStackCloud.create_server .. _vendor: https://docs.openstack.org/os-client-config/latest/user/vendor-support.html .. _os-client-config: https://docs.openstack.org/os-client-config/latest/user/configuration.html#config-files � N)�SaltCloudConfigError�SaltCloudExecutionFailure�SaltCloudExecutionTimeout�SaltCloudSystemExit)�Versionz1.19.0z0Please install newer version of shade: >= 1.19.0)Fz#Install pypi module shade >= 1.19.0Z openstackc C s t � du rdS t� du rtS tS )z* Check for OpenStack dependencies F)�get_configured_provider�get_dependencies� HAS_SHADE�__virtualname__� r r �O/opt/saltstack/salt/lib/python3.10/site-packages/salt/cloud/clouds/openstack.py�__virtual__ s r c C s"