Merge pull request #3732 from GheRivero/devel
Make add ip_floating_ip idempotent
This commit is contained in:
commit
d952087557
1 changed files with 4 additions and 0 deletions
|
@ -163,6 +163,10 @@ def main():
|
||||||
msg="server {0} not found".format(server_name_or_id))
|
msg="server {0} not found".format(server_name_or_id))
|
||||||
|
|
||||||
if state == 'present':
|
if state == 'present':
|
||||||
|
fip_address = cloud.get_server_public_ip(server)
|
||||||
|
f_ip = _get_floating_ip(cloud, fip_address)
|
||||||
|
if f_ip:
|
||||||
|
module.exit_json(changed=False, floating_ip=f_ip)
|
||||||
server = cloud.add_ips_to_server(
|
server = cloud.add_ips_to_server(
|
||||||
server=server, ips=floating_ip_address, ip_pool=network,
|
server=server, ips=floating_ip_address, ip_pool=network,
|
||||||
reuse=reuse, fixed_address=fixed_address, wait=wait,
|
reuse=reuse, fixed_address=fixed_address, wait=wait,
|
||||||
|
|
Loading…
Reference in a new issue