Author: | John Whitbeck |
---|
New in version 1.7.
Creates or terminates azure instances. When created optionally waits for it to be ‘running’. This module has a dependency on python-azure >= 0.7.1
parameter | required | default | choices | comments |
---|---|---|---|---|
endpoints | no | 22 | a comma-separated list of TCP ports to expose on the virtual machine (e.g., "22,80") | |
hostname | no | hostname to write /etc/hostname. Defaults to <name>.cloudapp.net. | ||
image | yes | system image for creating the virtual machine (e.g., b39f27a8b8c64d52b05eac6a62ebad85__Ubuntu_DAILY_BUILD-precise-12_04_3-LTS-amd64-server-20131205-en-us-30GB) | ||
location | yes | the azure location to use (e.g. 'East US') | ||
management_cert_path | no | path to an azure management certificate associated with the subscription id. Overrides the AZURE_CERT_PATH environement variable. | ||
name | yes | name of the virtual machine and associated cloud service. | ||
password | no | the unix password for the new virtual machine. | ||
role_size | no | Small | azure role size for the new virtual machine (e.g., Small, ExtraLarge, A6) | |
ssh_cert_path | no | path to an X509 certificate containing the public ssh key to install in the virtual machine. See http://www.windowsazure.com/en-us/manage/linux/tutorials/intro-to-linux/ for more details.if this option is specified, password-based ssh authentication will be disabled. | ||
state | no | present | create or terminate instances | |
storage_account | yes | the azure storage account in which to store the data disks. | ||
subscription_id | no | azure subscription id. Overrides the AZURE_SUBSCRIPTION_ID environement variable. | ||
user | no | the unix username for the new virtual machine. | ||
virtual_network_name | no | Name of virtual network. | ||
wait | no | no |
|
wait for the instance to be in state 'running' before returning |
wait_timeout | no | 600 | how long before wait gives up, in seconds | |
wait_timeout_redirects | no | 300 | how long before wait gives up for redirects, in seconds |
Note
Requires azure
# Note: None of these examples set subscription_id or management_cert_path
# It is assumed that their matching environment variables are set.
# Provision virtual machine example
- local_action:
module: azure
name: my-virtual-machine
role_size: Small
image: b39f27a8b8c64d52b05eac6a62ebad85__Ubuntu_DAILY_BUILD-precise-12_04_3-LTS-amd64-server-20131205-en-us-30GB
location: 'East US'
user: ubuntu
ssh_cert_path: /path/to/azure_x509_cert.pem
storage_account: my-storage-account
wait: yes
# Terminate virtual machine example
- local_action:
module: azure
name: my-virtual-machine
state: absent