salt.cloud.clouds.oneandone
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
:
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
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.
my-oneandone-profile: deploy: False
Create an SSH key
sudo salt-cloud -f create_ssh_key my-oneandone-config name='SaltTest' description='SaltTestDescription'
Create a block storage
sudo salt-cloud -f create_block_storage my-oneandone-config name='SaltTest2' description='SaltTestDescription' size=50 datacenter_id='5091F6D8CBFEF9C26ACE957C652D5D49'
-
Return a list of the server appliances that are on the provider
salt.cloud.clouds.oneandone.avail_images(conn=None, call=None)
-
List available locations/datacenters for 1&1
salt.cloud.clouds.oneandone.avail_locations(conn=None, call=None)
-
Return a dict of all available VM sizes on the cloud provider with relevant data.
salt.cloud.clouds.oneandone.avail_sizes(call=None)
-
Create a single VM from a data dict
salt.cloud.clouds.oneandone.create(vm_)
-
Create a block storage
salt.cloud.clouds.oneandone.create_block_storage(kwargs=None, call=None)
-
Create an ssh key
salt.cloud.clouds.oneandone.create_ssh_key(kwargs=None, call=None)
-
destroy a server by name
- Parameters
-
name -- name given to the server
call -- call value in this case is 'action'
- Returns
-
array of booleans , true if successfully stopped and true if successfully removed
CLI Example:
salt-cloud -d vm_name
salt.cloud.clouds.oneandone.destroy(name, call=None)
-
Return the first configured instance.
salt.cloud.clouds.oneandone.get_configured_provider()
-
Return a conn object for the passed VM data
salt.cloud.clouds.oneandone.get_conn()
-
Warn if dependencies are not met.
salt.cloud.clouds.oneandone.get_dependencies()
-
Return the image object to use
salt.cloud.clouds.oneandone.get_image(vm_)
-
Check SSH private key file and return absolute path if exists.
salt.cloud.clouds.oneandone.get_key_filename(vm_)
-
Return a node for the named VM
salt.cloud.clouds.oneandone.get_node(conn, name)
-
Return the VM's size object
salt.cloud.clouds.oneandone.get_size(vm_)
-
Return the wait_for_timeout for resource provisioning.
salt.cloud.clouds.oneandone.get_wait_timeout(vm_)
-
Return a list of VMs that are on the provider
salt.cloud.clouds.oneandone.list_nodes(conn=None, call=None)
-
Return a list of the VMs that are on the provider, with all fields
salt.cloud.clouds.oneandone.list_nodes_full(conn=None, call=None)
-
Return a list of the VMs that are on the provider, with select fields
salt.cloud.clouds.oneandone.list_nodes_select(conn=None, call=None)
-
Load the public key file if exists.
salt.cloud.clouds.oneandone.load_public_key(vm_)
-
reboot a server by name :param name: name given to the machine :param call: call value in this case is 'action' :return: true if successful
CLI Example:
salt-cloud -a reboot vm_name
salt.cloud.clouds.oneandone.reboot(name, call=None)
-
Return the script deployment object
salt.cloud.clouds.oneandone.script(vm_)
-
Show the details from the provider concerning an instance
salt.cloud.clouds.oneandone.show_instance(name, call=None)
-
start a server by name :param name: name given to the machine :param call: call value in this case is 'action' :return: true if successful
CLI Example:
salt-cloud -a start vm_name
salt.cloud.clouds.oneandone.start(name, call=None)
-
stop a server by name :param name: name given to the machine :param call: call value in this case is 'action' :return: true if successful
CLI Example:
salt-cloud -a stop vm_name
salt.cloud.clouds.oneandone.stop(name, call=None)
© 2021 SaltStack.
Licensed under the Apache License, Version 2.0.
https://docs.saltproject.io/en/latest/ref/clouds/all/salt.cloud.clouds.oneandone.html