New in version 1.3.
creates / deletes a Linode Public Cloud instance and optionally waits for it to be ‘running’.
parameter | required | default | choices | comments |
---|---|---|---|---|
api_key | no | Linode API key |
||
datacenter | no | datacenter to create an instance in (Linode Datacenter) |
||
distribution | no | distribution to use for the instance (Linode Distribution) |
||
linode_id | no |
Unique ID of a linode server aliases: lid
|
||
name | no |
Name to give the instance (alphanumeric, dashes, underscore)
To keep sanity on the Linode Web Console, name is prepended with LinodeID_
|
||
password | no | root password to apply to a new server (auto generated if missing) |
||
payment_term | no | 1 |
| payment term to use for the instance (payment term in months) |
plan | no | plan to use for the instance (Linode plan) |
||
ssh_pub_key | no | SSH public key applied to root user |
||
state | no | present |
| Indicate desired state of the resource |
swap | no | 512 | swap size in MB |
|
wait | no | no |
| wait for the instance to be in state 'running' before returning |
wait_timeout | no | 300 | how long before wait gives up, in seconds |
# Create a server - local_action: module: linode api_key: 'longStringFromLinodeApi' name: linode-test1 plan: 1 datacenter: 2 distribution: 99 password: 'superSecureRootPassword' ssh_pub_key: 'ssh-rsa qwerty' swap: 768 wait: yes wait_timeout: 600 state: present # Ensure a running server (create if missing) - local_action: module: linode api_key: 'longStringFromLinodeApi' name: linode-test1 linode_id: 12345678 plan: 1 datacenter: 2 distribution: 99 password: 'superSecureRootPassword' ssh_pub_key: 'ssh-rsa qwerty' swap: 768 wait: yes wait_timeout: 600 state: present # Delete a server - local_action: module: linode api_key: 'longStringFromLinodeApi' name: linode-test1 linode_id: 12345678 state: absent # Stop a server - local_action: module: linode api_key: 'longStringFromLinodeApi' name: linode-test1 linode_id: 12345678 state: stopped # Reboot a server - local_action: module: linode api_key: 'longStringFromLinodeApi' name: linode-test1 linode_id: 12345678 state: restarted
Note
LINODE_API_KEY env variable can be used instead
For more information on what this means please read Core Modules
For help in developing on modules, should you be so inclined, please read Community Information & Contributing, developing_test_pr and Developing Modules.
© 2012–2016 Michael DeHaan
© 2016 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/linode_module.html