mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Add support for nova availability zones
If a cloud has availability zone support, it's possible to specify an availability zone via the nova client. Add that as a config param.
This commit is contained in:
parent
8938222029
commit
1e0e7a6b28
1 changed files with 10 additions and 3 deletions
|
@ -99,6 +99,11 @@ options:
|
||||||
- list of key value pairs that determine how to assign, if specified, floating IPs. Either use an explicite list of valid floating IPs, list of floating IP pools to choose from, or auto-assign
|
- list of key value pairs that determine how to assign, if specified, floating IPs. Either use an explicite list of valid floating IPs, list of floating IP pools to choose from, or auto-assign
|
||||||
required: false
|
required: false
|
||||||
default: None
|
default: None
|
||||||
|
availability_zone:
|
||||||
|
description:
|
||||||
|
- Name of the availability zone
|
||||||
|
required: false
|
||||||
|
default: None
|
||||||
meta:
|
meta:
|
||||||
description:
|
description:
|
||||||
- A list of key value pairs that should be provided as a metadata to the new VM
|
- A list of key value pairs that should be provided as a metadata to the new VM
|
||||||
|
@ -141,7 +146,7 @@ EXAMPLES = '''
|
||||||
hostname: test1
|
hostname: test1
|
||||||
group: uge_master
|
group: uge_master
|
||||||
|
|
||||||
# Creates a new VM in HP Cloud AE1 region and automatically assigns a floating IP
|
# Creates a new VM in HP Cloud AE1 region availability zone az2 and automatically assigns a floating IP
|
||||||
- name: launch a nova instance
|
- name: launch a nova instance
|
||||||
hosts: localhost
|
hosts: localhost
|
||||||
tasks:
|
tasks:
|
||||||
|
@ -154,6 +159,7 @@ EXAMPLES = '''
|
||||||
name: vm1
|
name: vm1
|
||||||
auth_url: https://region-b.geo-1.identity.hpcloudsvc.com:35357/v2.0/
|
auth_url: https://region-b.geo-1.identity.hpcloudsvc.com:35357/v2.0/
|
||||||
region_name: region-b.geo-1
|
region_name: region-b.geo-1
|
||||||
|
availability_zone: az2
|
||||||
image_id: 9302692b-b787-4b52-a3a6-daebb79cb498
|
image_id: 9302692b-b787-4b52-a3a6-daebb79cb498
|
||||||
key_name: test
|
key_name: test
|
||||||
wait_for: 200
|
wait_for: 200
|
||||||
|
@ -313,7 +319,7 @@ def _create_server(module, nova):
|
||||||
'userdata': module.params['user_data'],
|
'userdata': module.params['user_data'],
|
||||||
}
|
}
|
||||||
|
|
||||||
for optional_param in ('region_name', 'key_name'):
|
for optional_param in ('region_name', 'key_name', 'availability_zone'):
|
||||||
if module.params[optional_param]:
|
if module.params[optional_param]:
|
||||||
bootkwargs[optional_param] = module.params[optional_param]
|
bootkwargs[optional_param] = module.params[optional_param]
|
||||||
try:
|
try:
|
||||||
|
@ -397,7 +403,8 @@ def main():
|
||||||
wait_for = dict(default=180),
|
wait_for = dict(default=180),
|
||||||
state = dict(default='present', choices=['absent', 'present']),
|
state = dict(default='present', choices=['absent', 'present']),
|
||||||
user_data = dict(default=None),
|
user_data = dict(default=None),
|
||||||
floating_ip = dict(default=None)
|
floating_ip = dict(default=None),
|
||||||
|
availability_zone = dict(default=None),
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue