diff options
author | Lorin Hochstein <lorinh@gmail.com> | 2015-06-24 09:49:55 -0700 |
---|---|---|
committer | Lorin Hochstein <lorinh@gmail.com> | 2015-06-24 09:49:55 -0700 |
commit | c4880b4b6133d507b76fe0db842a6f22dabb7453 (patch) | |
tree | b0f31021c4df2c71384e3e012e78455ba708dcbe | |
parent | 2e6c9b42fe872260cd8d0cfecb9a97773221bf05 (diff) | |
parent | fda0a0fd15dae2de6cdf213405949e0f2ff00fa9 (diff) | |
download | openstack-ansible-modules-c4880b4b6133d507b76fe0db842a6f22dabb7453.tar.gz |
Merge pull request #49 from dlundquist/neutron-floating-ip-fixed-ip
neutron_floating_ip: add fixed_ip parameter
-rw-r--r-- | neutron_floating_ip | 8 |
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']) ), ) |