File manager - Edit - /opt/saltstack/salt/lib/python3.10/site-packages/salt/cloud/clouds/__pycache__/oneandone.cpython-310.pyc
Back
o ;j4_ � @ s� d Z ddlZddlZddlZddlZddlmZ ddlZddl Zddl ZddlmZm Z mZmZmZ zddlmZmZmZmZmZ dZW n eyO dZY nw e�e�ZdZdd � Zd d� Zdd � Zdd� Z dd� Z!dd� Z"dd� Z#dFdd�Z$dFdd�Z%dd� Z&dd� Z'dFdd�Z(dFd d!�Z)dGd"d#�Z*d$d%� Z+dFd&d'�Z,dFd(d)�Z-dFd*d+�Z.dGd,d-�Z/d.d/� Z0d0d1� Z1d2d3� Z2dGd4d5�Z3dGd6d7�Z4dGd8d9�Z5dGd:d;�Z6d<d=� Z7d>d?� Z8d@dA� Z9dBdC� Z:dDdE� Z;dS )Ha� 1&1 Cloud Server Module ======================= The 1&1 SaltStack cloud module allows a 1&1 server to be automatically deployed and bootstrapped with Salt. It also has functions to create block storages and ssh keys. :depends: 1and1 >= 1.2.0 The module requires the 1&1 api_token to be provided. The server should also be assigned a public LAN, a private LAN, or both along with SSH key pairs. Set up the cloud configuration at ``/etc/salt/cloud.providers`` or ``/etc/salt/cloud.providers.d/oneandone.conf``: .. code-block:: yaml my-oneandone-config: driver: oneandone # The 1&1 api token api_token: <your-token> # SSH private key filename ssh_private_key: /path/to/private_key # SSH public key filename ssh_public_key: /path/to/public_key .. code-block:: yaml my-oneandone-profile: provider: my-oneandone-config # Either provide fixed_instance_size_id or vcore, cores_per_processor, ram, and hdds. # Size of the ID desired for the server fixed_instance_size: S # Total amount of processors vcore: 2 # Number of cores per processor cores_per_processor: 2 # RAM memory size in GB ram: 4 # Hard disks hdds: - is_main: true size: 20 - is_main: false size: 20 # ID of the appliance image that will be installed on server appliance_id: <ID> # ID of the datacenter where the server will be created datacenter_id: <ID> # Description of the server description: My server description # Password of the server. Password must contain more than 8 characters # using uppercase letters, numbers and other special symbols. password: P4$$w0rD # Power on server after creation - default True power_on: true # Firewall policy ID. If it is not provided, the server will assign # the best firewall policy, creating a new one if necessary. # If the parameter is sent with a 0 value, the server will be created with all ports blocked. firewall_policy_id: <ID> # IP address ID ip_id: <ID> # Load balancer ID load_balancer_id: <ID> # Monitoring policy ID monitoring_policy_id: <ID> Set ``deploy`` to False if Salt should not be installed on the node. .. code-block:: yaml my-oneandone-profile: deploy: False Create an SSH key .. code-block:: bash sudo salt-cloud -f create_ssh_key my-oneandone-config name='SaltTest' description='SaltTestDescription' Create a block storage .. code-block:: bash sudo salt-cloud -f create_block_storage my-oneandone-config name='SaltTest2' description='SaltTestDescription' size=50 datacenter_id='5091F6D8CBFEF9C26ACE957C652D5D49' � N)�SaltCloudConfigError�SaltCloudExecutionFailure�SaltCloudExecutionTimeout�SaltCloudNotFound�SaltCloudSystemExit)�BlockStorage�Hdd�OneAndOneService�Server�SshKeyTF� oneandonec C s t � du rdS t� du rdS tS )z' Check for 1&1 configurations. F)�get_configured_provider�get_dependencies�__virtualname__� r r �O/opt/saltstack/salt/lib/python3.10/site-packages/salt/cloud/clouds/oneandone.py�__virtual__ s r c C s"