From 7fe300bb29fe16a4a90870efcb2d6703692818e1 Mon Sep 17 00:00:00 2001 From: Monty Taylor Date: Thu, 15 Sep 2016 15:07:34 -0500 Subject: [PATCH] Expose the reuse_fips flag on os_server (#4849) * Expose the reuse_fips flag on os_server * Remove useless line --- lib/ansible/modules/cloud/openstack/os_server.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/lib/ansible/modules/cloud/openstack/os_server.py b/lib/ansible/modules/cloud/openstack/os_server.py index 0dca88b6e26..1bea3b4220c 100644 --- a/lib/ansible/modules/cloud/openstack/os_server.py +++ b/lib/ansible/modules/cloud/openstack/os_server.py @@ -187,6 +187,18 @@ options: required: false default: false version_added: "2.2" + reuse_fips: + description: + - When I(auto_ip) is true and this option is true, the I(auto_ip) code + will attempt to re-use unassigned floating ips in the project before + creating a new one. It is important to note that it is impossible + to safely do this concurrently, so if your use case involves + concurrent server creation, it is highly recommended to set this to + false and to delete the floating ip associated with a server when + the server is deleted using I(delete_fip). + required: false + default: true + version_added: "2.2" requirements: - "python >= 2.6" - "shade" @@ -477,6 +489,7 @@ def _create_server(module, cloud): boot_volume=module.params['boot_volume'], boot_from_volume=module.params['boot_from_volume'], terminate_volume=module.params['terminate_volume'], + reuse_fips=module.params['reuse_fips'], wait=module.params['wait'], timeout=module.params['timeout'], **bootkwargs ) @@ -577,6 +590,7 @@ def main(): scheduler_hints = dict(default=None, type='dict'), state = dict(default='present', choices=['absent', 'present']), delete_fip = dict(default=False, type='bool'), + reuse_fips = dict(default=True, type='bool'), ) module_kwargs = openstack_module_kwargs( mutually_exclusive=[