summaryrefslogtreecommitdiff
path: root/cloud/azure
diff options
context:
space:
mode:
authorRanjan Kumar <ranjan_kumar@persistent.co.in>2014-07-03 15:36:51 +0530
committerRanjan Kumar <ranjan_kumar@persistent.co.in>2014-07-03 15:36:51 +0530
commit8ef95374e704a777f05690506eb52efb8f006508 (patch)
tree15a4918282b3d6647b143960541f3f3db950188f /cloud/azure
parent935acf9efb6538967c0272db2784267d448188ec (diff)
downloadansible-modules-extras-8ef95374e704a777f05690506eb52efb8f006508.tar.gz
Provision VM using virtual network.
Diffstat (limited to 'cloud/azure')
-rw-r--r--cloud/azure11
1 files changed, 10 insertions, 1 deletions
diff --git a/cloud/azure b/cloud/azure
index 3e193e21..727fafb2 100644
--- a/cloud/azure
+++ b/cloud/azure
@@ -77,6 +77,11 @@ options:
- if this option is specified, password-based ssh authentication will be disabled.
required: false
default: null
+ virtual_network_name:
+ description:
+ - Name of virtual network.
+ required: false
+ default: null
hostname:
description:
- hostname to write /etc/hostname. Defaults to <name>.cloudapp.net.
@@ -233,6 +238,7 @@ def create_virtual_machine(module, azure):
role_size = module.params.get('role_size')
storage_account = module.params.get('storage_account')
image = module.params.get('image')
+ virtual_network_name = module.params.get('virtual_network_name')
wait = module.params.get('wait')
wait_timeout = int(module.params.get('wait_timeout'))
@@ -295,7 +301,9 @@ def create_virtual_machine(module, azure):
system_config=linux_config,
network_config=network_config,
os_virtual_hard_disk=os_hd,
- role_size=role_size)
+ role_size=role_size,
+ role_type='PersistentVMRole',
+ virtual_network_name=virtual_network_name)
_wait_for_completion(azure, result, wait_timeout, "create_virtual_machine_deployment")
except WindowsAzureError as e:
module.fail_json(msg="failed to create the new virtual machine, error was: %s" % str(e))
@@ -391,6 +399,7 @@ def main():
user=dict(),
password=dict(),
image=dict(),
+ virtual_network_name=dict(default=None),
state=dict(default='present'),
wait=dict(type='bool', default=False),
wait_timeout=dict(default=600),