Commit Graph

294 Commits (546187a8af4a0afb383a2a7852241d009ec73e88)

Author SHA1 Message Date
Monty Taylor 530f12035b Update docstring to show port ranges as optional 2016-12-08 11:23:18 -05:00
David Shrewsbury 789c1fcbe7 Correct port matching logic
Port matching logic did not take into account recent shade change
to equate (None, None) to (1, 65535) when Nova is the backend.

Also, this encapsulates the port matching logic into a single function
and heavily documents the logic.
2016-12-08 11:23:18 -05:00
David Shrewsbury 387fe5b0e7 Change required parameters for rules module
The ports and protocol are no longer required (and now depends on
a new version of shade).
2016-12-08 11:23:18 -05:00
Davide Guerri 531b93490b Fix reuse argument documentation 2016-12-08 11:23:18 -05:00
Davide Guerri 95cfe3da96 Update os_floating_ip with new shade methods 2016-12-08 11:23:18 -05:00
Monty Taylor 4f2028439f Use int in the parameter list instead of casting 2016-12-08 11:23:18 -05:00
dagnello 2c3fc61357 Resolving issues in rule comparison algorithm
Port range min/max values are at times represented as string and
compared to int equivalents.  This fix explicitly ensures all
port range values are ints for proper comparisons.
2016-12-08 11:23:18 -05:00
David Shrewsbury e7dd93c5c1 Compare ports as strings
Ports as returned from shade are ints. They are strings as they come
in to the module.
2016-12-08 11:23:18 -05:00
David Shrewsbury 14212c37e2 Fix syntax error 2016-12-08 11:23:18 -05:00
Monty Taylor 60102e36e2 Return rule object 2016-12-08 11:23:18 -05:00
David Shrewsbury 174254a423 Update secgroup rules module for latest shade
This allows the rules module to work against either nova or neutron
for handling security groups. New parameters for 'direction' and
'ethertype' are added.

Check mode is supported with this version.
2016-12-08 11:23:18 -05:00
David Shrewsbury fcc1d643f6 Recongnize None and -1 port equivalency
shade 0.7.0 represents disabled min/max ports as None (in the
neutron style) rather than -1. Recognize this as the same as -1.
2016-12-08 11:23:17 -05:00
David Shrewsbury b42a9d56e6 Fix id value reference 2016-12-08 11:23:17 -05:00
David Shrewsbury f02ec15c17 Update rules mode for latest shade
Shade 0.7.0 normalized the security group data that is returned,
when using nova, to look more like neutron security group data.
This adjusts for that change.
2016-12-08 11:23:17 -05:00
dagnello ecef2aadba Minor fixes for os_security_group_rule module
Was not able to use this module as it was.  The changes submitted
resolved the issues I ran into in order to get it working.
2016-12-08 11:23:17 -05:00
Davide Guerri 2d7dbc5d0c Fix invalid syntax in openstack_module_kwargs call 2016-12-08 11:23:17 -05:00
Monty Taylor 9acc891477 Fix example code syntax 2016-12-08 11:23:17 -05:00
Monty Taylor a657e80bc8 Add OpenStack Floating IP Module
Also deprecate the two old quantum floating ip modules.
2016-12-08 11:23:17 -05:00
Monty Taylor 8d5e43c14f Add OpenStack Security Group Rule module 2016-12-08 11:23:17 -05:00
Toshio Kuratomi cf595b3c52 Fix indentation levels in os_keypair 2016-12-08 11:23:16 -05:00
Toshio Kuratomi 4c863187ad Few minor things from review of the pull request 2016-12-08 11:23:16 -05:00
Jesse Keating 2b5af82706 Document auto_floating_ip argument 2016-12-08 11:23:16 -05:00
David Shrewsbury 3cd81d2dd3 Use newest documentation style for return value. 2016-12-08 11:23:16 -05:00
David Shrewsbury c4bc6dea13 Add a note about the return value. 2016-12-08 11:23:15 -05:00
Monty Taylor c0190b0443 Fix dict syntax typo 2016-12-08 11:23:15 -05:00
David Shrewsbury 341efbf7ae Update os_keypair for latest shade
Uses the latest version of shade for cleaner code. Also, always
return the key dict whether we create the key, or it already exists.
The example using public_key_file is corrected to use a full path
since ~ is not converted for us.
2016-12-08 11:23:15 -05:00
Monty Taylor 869da89b35 Move the order of argument processing 2016-12-08 11:23:14 -05:00
Monty Taylor 377311db56 Add filter ability 2016-12-08 11:23:14 -05:00
Davide Guerri c1d7678cc2 Avoind using lookup() in documentation
lookup() is currently broken (current Ansible devel branch), so better to avoid
it in our examples.
2016-12-08 11:23:14 -05:00
Monty Taylor 0c0359798b Add OpenStack Keypair module
Also deprecate old nova_keypair module.
2016-12-08 11:23:13 -05:00
Monty Taylor 186fbd7645 Remove duplicate shade requirement 2016-12-08 11:23:10 -05:00
Monty Taylor 73cb529d2c Make sure we're always returning objects too 2016-12-08 11:23:10 -05:00
dagnello 072110c757 Resolving secgroup.id issue in this module
secgroup['id'] was not being returned in all cases where the
specified security group exists.
2016-12-08 11:23:10 -05:00
Monty Taylor 8ff71a3fa8 Actually use changed variable 2016-12-08 11:23:09 -05:00
Monty Taylor 4125b576e9 Return the secgroup for all present states 2016-12-08 11:23:09 -05:00
Monty Taylor b955b2f5c8 Return resource objects from OpenStack modules
It's not uncommon for people to want to do additional things after
creating a module. Also, add a note about it to the dev notes.
2016-12-08 11:23:09 -05:00
Monty Taylor 89f95471f8 Return secgroup, not just id 2016-12-08 11:23:09 -05:00
David Shrewsbury 9cbd7b2ece Remove os_security_group_rule module
The rules module will have it's own branch.
2016-12-08 11:23:08 -05:00
David Shrewsbury 6527f895a1 Remove 'result' value
This value is pretty much useless, and a holdover from the old
module code. Let's remove it.
2016-12-08 11:23:08 -05:00
Monty Taylor eb2f3c8a44 Update version added 2016-12-08 11:23:08 -05:00
David Shrewsbury 7f0da6d851 Update the docstring for os_security_group
Indicate that idempotence is on security group names, and give
an example for updating a security group description.
2016-12-08 11:23:08 -05:00
David Shrewsbury 640dbee643 Update for latest shade API
Shade version 0.7.0 introduces new API methods for creating,
deleting, and updating security groups. Let's use those and
clean up the module.
2016-12-08 11:23:08 -05:00
Julia Kreger d67ba5e25b Updating os_ironic_node module
Updating the os_ironic_node module to the most recent version
including support for power and maintenance states.
2016-12-08 11:23:08 -05:00
Julia Kreger 51149b9643 Updating os_ironic module
Updating os_ironic module to the most recent version accounting for
changes in Ansible devel branch and the shade library since the
original creation of the module.
2016-12-08 11:23:08 -05:00
Greg DeKoenigsberg 18ca7aee07 Updating cloud modules with proper github author information 2016-12-08 11:23:07 -05:00
Monty Taylor 574bcac277 Add developer docs for the OpenStack modules 2016-12-08 11:23:07 -05:00
Monty Taylor 51ce05bfb9 Add Ironic Node module 2016-12-08 11:23:07 -05:00
Monty Taylor e534753092 Add Ironic module 2016-12-08 11:23:07 -05:00
Monty Taylor 0447a88c80 Add OpenStack Object module 2016-12-08 11:23:07 -05:00
Monty Taylor 234a6c93c7 Add OpenStack Security Group support
Two modules - one for security groups and one to manage rules in a
security group.
2016-12-08 11:23:07 -05:00
Monty Taylor 97ce6a500d Update doc params and version_added 2016-12-08 11:23:05 -05:00
Monty Taylor 29115f0602 AnsibleModule takes a dict as a param 2016-12-08 11:23:05 -05:00
Monty Taylor dbf821ff67 Return a list of OpenStack clouds
The main use of this is to feed jinja templating, so structure the
data returned slightly better for that purpose.
2016-12-08 11:23:05 -05:00
Monty Taylor b87c9002ae Add OpenStack Client Config module
All of the ansible OpenStack modules are driven by a clouds.yaml config
file which is processed by os-client-config. Expose the data returned by
that library to enable playbooks to iterate over available clouds.
2016-12-08 11:23:05 -05:00
Monty Taylor 58942eba2e Use the delete method from shade
Sigh. Turns out glance v1 and glance v2 delete images differently too.
2016-12-08 11:23:05 -05:00
Monty Taylor 8958deeb02 Don't update image properties if we're deleting 2016-12-08 11:23:05 -05:00
Monty Taylor a4e4dbd863 Add OpenStack Image module
Also deprecate old glance_image module
2016-12-08 11:23:05 -05:00
Monty Taylor 0bc85d461b Add missing state parameter 2016-12-08 11:23:04 -05:00
Brian Coca d7bd36a215 Revert "Add deprecated documentation for _quantum_subnet" cause it was already added
This reverts commit 3fa32c4984e3fa839d1188871b2399f184e395a5.
2016-12-08 11:23:03 -05:00
Toshio Kuratomi 8576d1f9d1 Add deprecated documentation for _quantum_subnet 2016-12-08 11:23:03 -05:00
David Shrewsbury 67d8ff197e Rename os_subnet to os_subnet.py 2016-12-08 11:23:03 -05:00
Monty Taylor acdc90f31d Add OpenStack Subnet module
Also deprecated old quantum_subnet module
2016-12-08 11:23:03 -05:00
Jesse Keating 96b03ce138 Add an openstack servers actions module
This module supports a few of the server actions that are easy to
initially impiment. Other actions require input and provide return
values in the API calls that will be more difficult to impliment, and
thus are not part of this initial commit.
2016-12-08 11:23:01 -05:00
Monty Taylor eeacb7486d Add OpenStack Network module
Also, deprecate the old quantum network module
2016-12-08 11:23:00 -05:00
Brian Coca fb527955c9 added deprecated doc entry 2016-12-08 11:22:57 -05:00
David Shrewsbury dd6b153700 Update os_server for shade flavor API changes
Latest shade fixes the flavor API so that raw objects are not
returned.
2016-12-08 11:22:57 -05:00
Monty Taylor 78daf52994 Add OpenStack Server module
Also deprecated old nova_compute module
2016-12-08 11:22:56 -05:00
David Shrewsbury c29ae705f0 Update os_server_volume for latest shade
The shade volume API was updated to return a dict rather than the
object as returned by cinder.
2016-12-08 11:22:56 -05:00
David Shrewsbury 4ea6bded61 Update os_volume for latest shade
The shade volume API was updated to return a dict rather than the
object as returned by cinder.
2016-12-08 11:22:56 -05:00
mcameron dcb8fa0cb9 Net_id already present, remove unnecessary lookup. 2016-12-08 11:22:55 -05:00
mcameron 1cc057ca97 Valodate fip is on the correct network 2016-12-08 11:22:55 -05:00
mcameron 9f30125876 Adding openstack multiregion support 2016-12-08 11:22:55 -05:00
David Shrewsbury 4699e5b905 Recognize when volume attach/detach is not necessary
Do not attempt to attach an already attached volume.
Likewise, do not attempt to detach a volume that is not
attached.

This version adds support for check mode.
2016-12-08 11:22:55 -05:00
Monty Taylor 63a0c0999a Add OpenStack Volume module 2016-12-08 11:22:55 -05:00
Monty Taylor 15013cde32 Add OpenStack Server facts module 2016-12-08 11:22:55 -05:00
Monty Taylor 522a28b75c Add OpenStack Server Volume module 2016-12-08 11:22:55 -05:00
Andrey Trubachev ac5b0ca59b Fix mess of ipv6 and ipv4 addresses in private_ip 2016-12-08 11:22:53 -05:00
Brian Coca 7f618bd787 minor docfixes 2016-12-08 11:22:53 -05:00
Monty Taylor 0283791d5f Add OpenStack Auth module
Use this to pre-auth or to get a copy of the service catalog.
2016-12-08 11:22:53 -05:00
Monty Taylor ea809efe7b Revert "Add OpenStack Router Gateway module" 2016-12-08 11:22:52 -05:00
Monty Taylor c4db70a133 Add OpenStack Router Gateway module
Also deprecate old quantum_router_gateway module
2016-12-08 11:22:52 -05:00
Brian Coca 7f8094e977 undeprecated openstack modules as new ones are not making into release 2016-12-08 11:22:49 -05:00
Monty Taylor 3e3486b813 One more OpenStack deprecation notice
Fixes #858
2016-12-08 11:22:45 -05:00
Monty Taylor 411c7e22b6 Add deprecation notices for old OpenStack modules 2016-12-08 11:22:45 -05:00
Monty Taylor 7c9a36a999 Deprecate old OpenStack modules
There are a completely new set of modules that do all of the things like
keystone v3 and auth_plugins and the like correctly. Structurally
upgrading these would have been massively disruptive and there is no
real good way to do so without breaking people.

These modules should be kept around for several releases - they still
work for people - and they should get bug fixes. But they should not
take new features. New features should go to the os_ modules.
2016-12-08 11:22:45 -05:00
Jorge-Rodriguez ad9379ad7d Added optional parameter scheduler_hints. 2016-12-08 11:22:44 -05:00
mcameron f799180a58 More general output. 2016-12-08 11:22:42 -05:00
mcameron 751e268f0d Useful log output. 2016-12-08 11:22:42 -05:00
Harri Hämäläinen 299d28f7e5 Fixed typo in comment 2016-12-08 11:22:32 -05:00
Francois Deppierraz 181c3aa25f Fix auto_floating_ip documentation
The default value is 'no' instead of the currently documented 'yes'.

See cloud/openstack/nova_compute.py line 543:

        auto_floating_ip                = dict(default=False, type='bool'),
2016-12-08 11:22:31 -05:00
John Batty dd78dde449 Fix get_flavor_id() when flavor_ram is specified
Without this fix, _get_flavor_id() fails to find a matching flavor if
both:
* the flavor_ram parameter is specified
* the first flavor in the list does not match.

The bug is simply that the module.fail_json() call lies within the loop
iterating through the flavors.  This call should only be made if the
loop completes and no matching flavors have been found.
2016-12-08 11:22:26 -05:00
Francois Deppierraz 9620346c36 Fix a typo in nova_compute documentation string
Without this patch, ansible-doc was failing this way:

$ ansible-doc nova_compute
Traceback (most recent call last):
  File "/home/francois/WORK/dev/ansible/bin/ansible-doc", line 324, in <module>
    main()
  File "/home/francois/WORK/dev/ansible/bin/ansible-doc", line 316, in main
    text += get_man_text(doc)
  File "/home/francois/WORK/dev/ansible/bin/ansible-doc", line 112, in get_man_text
    desc = " ".join(opt['description'])
KeyError: 'description'
2016-12-08 11:22:25 -05:00
Brian Coca 5a467bc72c added __init__.py to new cloud subcategories so builds work again 2016-12-08 11:22:25 -05:00
Brian Coca 32e85c0944 made subcategories for cloud modules for better organization 2016-12-08 11:22:24 -05:00