The Linode cloud module is used to control access to the Linode VPS system.
Use of this module only requires the apikey
parameter. However, the default root password for new instances
also needs to be set. The password needs to be 8 characters and contain lowercase, uppercase, and numbers.
Set up the cloud configuration at /etc/salt/cloud.providers
or /etc/salt/cloud.providers.d/linode.conf
:
my-linode-provider:
apikey: f4ZsmwtB1c7f85Jdu43RgXVDFlNjuJaeIYV8QMftTqKScEB2vSosFSr...
password: F00barbaz
driver: linode
ssh_key_file: /tmp/salt-cloud_pubkey
ssh_pubkey: ssh-rsa AAAAB3NzaC1yc2EA...
linode-profile:
provider: my-linode-provider
size: Linode 1024
image: CentOS 7
location: London, England, UK
private_ip: true
To clone, add a profile with a clonefrom
key, and a script_args: -C
. clonefrom
should be the name of
the VM (linode) that is the source for the clone. script_args: -C
passes a -C to the
bootstrap script, which only configures the minion and doesn't try to install a new copy of salt-minion. This way the
minion gets new keys and the keys get pre-seeded on the master, and the /etc/salt/minion file has the right
'id:' declaration.
Cloning requires a post 2015-02-01 salt-bootstrap.
salt.cloud.clouds.linode.
avail_images
()¶Return available Linode images.
salt.cloud.clouds.linode.
avail_locations
()¶Return available Linode datacenter locations.
salt.cloud.clouds.linode.
avail_sizes
()¶Return available Linode sizes.
salt.cloud.clouds.linode.
boot
(linode_id, config_id)¶Boot a Linode.
salt.cloud.clouds.linode.
clone
(linode_id, datacenter_id, plan_id)¶Clone a Linode.
salt.cloud.clouds.linode.
create
(vm_)¶Create a single Linode VM.
salt.cloud.clouds.linode.
create_config
(vm_, linode_id, root_disk_id, swap_disk_id, kernel_id=None)¶Creates a Linode Configuration Profile.
salt.cloud.clouds.linode.
create_disk_from_distro
(vm_, linode_id, swap_size=None)¶Creates the disk for the Linode from the distribution.
salt.cloud.clouds.linode.
create_private_ip
(vm_, linode_id)¶Creates a private IP for the specified Linode.
salt.cloud.clouds.linode.
create_swap_disk
(vm_, linode_id, swap_size=None)¶Creates the disk for the specified Linode.
salt.cloud.clouds.linode.
destroy
(name, call=None)¶Destroys a Linode by name.
CLI Example:
salt-cloud -d vm_name
salt.cloud.clouds.linode.
get_configured_provider
()¶Return the first configured instance.
salt.cloud.clouds.linode.
get_datacenter_id
(location)¶Returns the Linode Datacenter ID.
salt.cloud.clouds.linode.
get_disk_size
(vm_, swap)¶Returns the size of of the root disk in MB.
salt.cloud.clouds.linode.
get_distribution_id
(vm_)¶Returns the distribution ID for a VM
salt.cloud.clouds.linode.
get_ips
(linode_id=None)¶Returns public and private IP addresses.
salt.cloud.clouds.linode.
get_linode
(linode_id)¶Returns data for a single named Linode.
salt.cloud.clouds.linode.
get_linode_id_from_name
(name)¶Returns the Linode ID for a VM from the provided name.
salt.cloud.clouds.linode.
get_password
(vm_)¶Return the password to use for a VM.
salt.cloud.clouds.linode.
get_plan_id
(label)¶Returns the Linode Plan ID.
salt.cloud.clouds.linode.
get_private_ip
(vm_)¶Return True if a private ip address is requested
salt.cloud.clouds.linode.
get_pub_key
(vm_)¶Return the SSH pubkey.
salt.cloud.clouds.linode.
get_swap_size
(vm_)¶Returns the amoutn of swap space to be used in MB.
salt.cloud.clouds.linode.
list_nodes
(call=None)¶Returns a list of linodes, keeping only a brief listing.
CLI Example:
salt-cloud -Q
salt-cloud --query
Note
The image
label only displays information about the VM's distribution vendor,
such as "Debian" or "RHEL" and does not display the actual image name. This is
due to a limitation of the Linode API.
salt.cloud.clouds.linode.
list_nodes_full
()¶List linodes, with all available information.
CLI Example:
salt-cloud -F
salt-cloud --full-query
Note
The image
label only displays information about the VM's distribution vendor,
such as "Debian" or "RHEL" and does not display the actual image name. This is
due to a limitation of the Linode API.
salt.cloud.clouds.linode.
reboot
(name=None, linode_id=None, call=None)¶Reboot a linode. Either a name or a linode_id must be provided.
New in version 2015.8.0.
CLI Example:
salt-cloud -a reboot vm_name
salt-cloud -a reboot linode_id
salt.cloud.clouds.linode.
show_instance
(name=None, linode_id=None, call=None)¶Displays details about a particular Linode VM. Either a name or a linode_id must be provided.
New in version 2015.8.0.
CLI Example:
salt-cloud -a show_instance vm_name
salt-cloud -a show_instance linode_id
Note
The image
label only displays information about the VM's distribution vendor,
such as "Debian" or "RHEL" and does not display the actual image name. This is
due to a limitation of the Linode API.
salt.cloud.clouds.linode.
show_pricing
(kwargs=None, call=None)¶Show pricing for a particular profile. This is only an estimate, based on unofficial pricing sources.
New in version 2015.8.0.
CLI Example:
salt-cloud -f show_pricing my-linode-config profile=my-linode-profile
salt.cloud.clouds.linode.
start
(name=None, linode_id=None, call=None)¶Start a VM in Linode. Either a name or a linode_id must be provided.
CLI Example:
salt-cloud -a stop vm_name
salt-cloud -a stop linode_id
salt.cloud.clouds.linode.
stop
(name=None, linode_id=None, call=None)¶Stop a VM in Linode. Either a name or a linode_id must be provided.
CLI Example:
salt-cloud -a stop vm_name
salt-cloud -a stop linode_id
salt.cloud.clouds.linode.
update_linode
(linode_id, update_args=None)¶Updates a Linode's properties.