summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDustin Lundquist <dustin@null-ptr.net>2015-06-24 09:43:58 -0700
committerDustin Lundquist <dustin@null-ptr.net>2015-06-24 09:43:58 -0700
commitfda0a0fd15dae2de6cdf213405949e0f2ff00fa9 (patch)
treeb0f31021c4df2c71384e3e012e78455ba708dcbe
parent2e6c9b42fe872260cd8d0cfecb9a97773221bf05 (diff)
downloadopenstack-ansible-modules-fda0a0fd15dae2de6cdf213405949e0f2ff00fa9.tar.gz
neutron_floating_ip: add fixed_ip parameter
This allows associating floating IP addresses with an instance port with multiple IP addresses.
-rw-r--r--neutron_floating_ip8
1 files changed, 8 insertions, 0 deletions
diff --git a/neutron_floating_ip b/neutron_floating_ip
index fbece6c..544b723 100644
--- a/neutron_floating_ip
+++ b/neutron_floating_ip
@@ -77,6 +77,11 @@ options:
- The name of the instance to which the IP address should be assigned
required: true
default: None
+ fixed_ip:
+ description:
+ - IP address on the instance's port. Useful when the port has more than one IP
+ required: false
+ default: None
requirements: ["novaclient", "neutronclient", "keystoneclient"]
'''
@@ -194,6 +199,8 @@ def _create_floating_ip(neutron, module, port_id, net_id):
'port_id': port_id,
'floating_network_id': net_id
}
+ if 'fixed_ip' in module.params:
+ kwargs['fixed_ip_address'] = module.params['fixed_ip']
try:
result = neutron.create_floatingip({'floatingip': kwargs})
except Exception as e:
@@ -235,6 +242,7 @@ def main():
network_name = dict(required=True),
instance_name = dict(required=True),
port_network_name = dict(default=None),
+ fixed_ip = dict(default=None),
state = dict(default='present', choices=['absent', 'present'])
),
)