Commit graph

272 commits

Author SHA1 Message Date
Michael Scherer
90f8228fb1 Fix #2629, replace choices=BOOLEANS by type='bool' 2015-12-22 16:10:01 +01:00
Sam Thursfield
6e9adc4687 os_server: Add some error checking for the 'nics' parameter
If this parameter was not of the right type, the module would fail with a
traceback, with a "AttributeError: 'str' object has no attribute 'get'"
exception.

It now gives a proper error message on type errors.
2015-12-21 12:53:43 +00:00
Alberto Gireud
9cc67e45a6 Update root_volume variable 2015-12-17 07:21:17 -06:00
Toshio Kuratomi
f04cd88d22 Fix os_server docs build 2015-12-16 08:06:29 -08:00
Donovan Jones
cf061dd93a fix typo in os_server security_groups description 2015-12-16 15:20:55 +13:00
Monty Taylor
187a4bd505 Add support for network, boot_from_volume and volumes
nics is a great flexible parameter, but it's wordy. Shade now supports
a simple parameter too, which is just "network" and takes a name or id.
Add passthrough support.

In addition to supporting booting from a pre-existing volume, nova and
shade both support the concept of booting from volume based on an image.
Pass the parameters through.

Shade supports boot-time attachment of additional volumes for OpenStack
instances. Pass through the parameter so that ansible users can also
take advantage of this.
2015-12-15 07:32:28 -05:00
Timothy R. Chavez
05e16c950d Pass network argument to add_ips_to_server
The `network` argument needs to be passed through `add_ips_to_server`
so that the default value can be properly overridden from ansible.
2015-12-13 09:30:20 -08:00
Timothy R. Chavez
b9fe8166fd Get new server object after adding floating IP
We need a new server object once we add the floating ip, otherwise we
will be operating with the older server object pre-floating-ip
assignment.
2015-12-10 13:01:57 -06:00
Markus Suonto
32edc2f56f fixed quantum_ modules to work with minimum access rights if greater access rights are not needed 2015-11-26 15:34:47 +02:00
David Shrewsbury
d13741314e Bug fix for os_image and min_disk/min_ram
The min_disk and min_ram parameters were not being passed to
the shade API. They also need to be integer values. Also
updated the description of these parameters for better
clarification.
2015-11-23 11:29:00 -05:00
David Shrewsbury
2a306c6b8c Fix os_user_group module
This module had a couple of errors in it. Also added check mode
support.
2015-11-18 15:03:07 -05:00
Monty Taylor
ccb39767cf Use add_ips_to_server API
This module is still using an old pre-release API and needs to update
to use the current API.

Co-Authored-By: Marton Kiss <marton.kiss@gmail.com>
2015-11-09 11:38:04 -05:00
Brian Coca
1f9c204178 Merge pull request #2379 from larsks/feature/os_server_facts_returns_list
os_server_facts returns facts about multiple servers
2015-11-05 12:50:29 -05:00
Greg DeKoenigsberg
57dcf2c9dd @lorin stepping down as maintainer 2015-10-28 14:38:11 -04:00
Lars Kellogg-Stedman
e70002d2f9 os_server_facts returns facts about multiple servers
have `os_server_facts` call `list_servers` rather than `get_server`, and
treat the `server` parameter as a wildcard pattern.  This permits one to
get facts on a single server:

    - os_server:
        server: webserver1

On mutiple servers:

    - os_server:
        server: webserver*

Or on all servers:

    - os_server:

Introduces a `detailed` parameter to request additional server details
at the cost of additional API calls.
2015-10-28 13:18:54 -04:00
Brian Coca
30951e2811 Merge pull request #2345 from larsks/bug/port-allow-secgroup-list
allow os_port to accept a list of security groups
2015-10-26 19:45:39 -04:00
Brian Coca
7c1fcd8e13 Merge pull request #2349 from larsks/bug/router-should-return-id
make os_router return a top level 'id' key
2015-10-26 18:20:26 -04:00
Brian Coca
ad8fd86467 Merge pull request #2338 from larsks/bug/flavor-should-return-id
make os_flavor return a top-level 'id' key
2015-10-23 14:52:03 -04:00
Brian Coca
0e0c28bfb1 Merge pull request #2344 from larsks/bug/allow-secgroup-list
allow os_server to accept a list of security groups
2015-10-23 14:51:45 -04:00
Brian Coca
3199a73927 Merge pull request #2339 from larsks/bug/keypair-should-return-id
make os_keypair return a top level 'id' key
2015-10-23 14:51:27 -04:00
Brian Coca
59f11aa973 Merge pull request #2336 from larsks/feature/os-subnet-returns-something
return information about created subnet
2015-10-23 14:51:05 -04:00
Lars Kellogg-Stedman
d82460a372 make os_router return a top level 'id' key
make os_router return a top-level 'id' key, much like other
os_* resources.
2015-10-23 13:32:37 -04:00
Lars Kellogg-Stedman
a2fe8dba68 allow os_port to accept a list of security groups
with this commit, the `security_groups` attribute for `os_port` will
accept either a common-delimited string or ` YAML list.  That is, either
this:

    - os_port:
        [...]
        security_groups: group1,group2

Or this:

    - os_port:
        [...]
        security_groups:
          - group1
          - group2
2015-10-23 09:44:07 -04:00
Brian Coca
12b0582f9e Merge pull request #2343 from larsks/bug/secgroup-allow-empty-description
allow empty description attribute for os_security_group
2015-10-23 09:43:01 -04:00
Brian Coca
49a66eb8d2 Merge pull request #2337 from larsks/bug/os-network-always-unchanged
make os_network correctly report changed status
2015-10-23 09:42:45 -04:00
Lars Kellogg-Stedman
b0c10a7d31 allow os_server to accept a list of security groups
This commit allows the `security_groups` parameter of the `os_server`
module to be either a YAML list or a common-delimited string (much like
the `nics` attribute).  E.g., this:

    - os_nova_server:
        [...]
        security_groups:
          - default
          - webserver

Or this:

    - os_nova_server:
        [...]
        security_groups: default,webserver
2015-10-22 22:53:05 -04:00
Lars Kellogg-Stedman
da0fbfc564 allow empty description attribute for os_security_group
The `os_security_group` module would fail if there was no `description:`
attribute:

    localhost | FAILED! => {
        "changed": false,
        "failed": true,
	"msg": "Error creating security group larstest: Invalid input for
	description. Reason: 'None' is not a valid string."
    }

This commit makes the default description `''` rather than `None`.
2015-10-22 21:26:47 -04:00
Lars Kellogg-Stedman
377811dac2 make os_keypair return a top level 'id' key
make os_keypair return a top-level 'id' key, much like other os_*
resources.
2015-10-22 13:59:45 -04:00
Lars Kellogg-Stedman
8368da4297 make os_flavor return a top-level 'id' key
make os_flavor return a top-level 'id' key, much like other os_*
resources.
2015-10-22 13:56:56 -04:00
Lars Kellogg-Stedman
c54c5c8234 make os_network correctly report changed status
The `os_network` module was incorrectly returning changed=False whether
or not the network was created.  This commit makes the changed return
value useful.
2015-10-22 13:38:32 -04:00
Lars Kellogg-Stedman
d73f5a4adb return information about created subnet
make os_subnet behave like os_network in terms of returning information
about the created resource.  With this commit, os_subnet will return the
created subnet in `subnet` and the subnet id in `id`.
2015-10-22 13:27:17 -04:00
David Shrewsbury
5d73a9a4c5 Fix for routers without external interfaces 2015-10-22 11:52:28 -04:00
Matt Martz
2e49d89be7 Merge pull request #2328 from emonty/bug/is-public
Actually pass in is_public to create_image
2015-10-21 19:46:18 -05:00
Monty Taylor
e7bdf7f7f6 Actually pass in is_public to create_image
Fixes #2325
2015-10-22 08:52:05 +09:00
Brian Coca
88e7dcf174 fixed mispelled description 2015-10-21 19:39:17 -04:00
Matt Martz
dc1f0c6f9f Merge pull request #2319 from Shrews/os_user
Add OpenStack Keystone User module
2015-10-20 15:43:50 -05:00
David Shrewsbury
fde149cbe8 Clarify password requirement and add return docs. 2015-10-20 15:49:52 -04:00
David Shrewsbury
cdf7117f7e Add OpenStack Keystone User module
This is a replacement for PR #1598 and fixes #283
2015-10-20 13:29:41 -04:00
Brian Coca
0f308e1e07 Merge pull request #2275 from larsks/bug/2253
fix handling of nics argument
2015-10-19 16:39:51 -04:00
Brian Coca
b73ffa3b6f Merge pull request #2310 from Shrews/os_router
Fix os_router to accept internal interfaces
2015-10-19 16:24:54 -04:00
David Shrewsbury
55e9dc73f5 Fix os_router to accept internal interfaces
Allow the 'interfaces' attribute to represent internal router
interfaces, composed of subnet names, and the 'external_fixed_ips'
attribute to represent external interface subnet/IP.
2015-10-19 15:53:15 -04:00
Lars Kellogg-Stedman
06098a9d69 fix handling of nics argument
The existing code was receiving a list of strings and erroneously
assuming it was being given a list of dictionaries, leading it to fail
with:

    AttributeError: 'str' object has no attribute 'get'

This commit corrects the list handling code to check the type of each
item and handle it appropriately.   Also, based on bcoca's comment
in #2253, thie code removes the special case for a string-only argument.

By transforming string arguments into dicts and then handling them like
any other dict argument, this also permits arguments of the form:

    nics: net-name=mynet

Or:

    nics: port-name=mynet

Previous versions of this code only supported `net-id` and `port-id` in
string specifications.
2015-10-18 21:54:40 -04:00
Monty Taylor
4590ba4e59 Make the auto ip parameter auto_ip
There was a parameter in the docs called 'public_ip' that didn't
actually exist. Additionally, auto_floating_ip is not consistent with
the underlying parameter which is auto_ip - for no good reason.

Add auto_ip as the real parameter, and then make public_ip and
auto_floating_ip as aliases for it for backwards compatability.

Fixes #2301
2015-10-18 14:11:26 -04:00
Brian Coca
5da7cf696c fixed results docs 2015-10-16 14:12:11 -04:00
Toshio Kuratomi
3af0d509c5 Some docs fixes 2015-10-16 11:03:53 -07:00
Brian Coca
7b21bc7144 Merge pull request #2238 from dagnello/server_meta_string
Adding string support to metadata argument
2015-10-15 14:44:57 -04:00
Brian Coca
6e54a5edc5 Merge pull request #2077 from dagnello/subnet_list_state
Adding os_subnets_facts module
2015-10-15 08:52:19 -04:00
Brian Coca
f35ab5faca Merge pull request #2106 from dagnello/port_module
Adding os_port Module to openstack ansible modules
2015-10-14 16:40:11 -04:00
Brian Coca
f707a711cd doc fixes 2015-10-09 18:36:58 -04:00
dagnello
83a9f293fd Adding string support to metadata argument
This patch adds support to setting metadata key/value through a string
argument.  Variables can now be used for both the metadata key and
value.

example:
meta: "{{ var1 }}:SomeValue,key:{{ var2 }}"
2015-10-09 15:28:56 -04:00
Brian Coca
969c4eb493 Merge pull request #2078 from abithap/devel
os_server: Adding support to accept 'n' nic args as a string containi…
2015-10-07 21:34:33 -04:00
Brian Coca
af82f4b23e Merge pull request #2105 from dagnello/network_list_state
Adding os_networks_facts module
2015-10-07 21:33:28 -04:00
Brian Coca
00a18c2a6e Merge pull request #2110 from dagnello/os_image_facts
Adding new image facts module
2015-10-07 21:32:48 -04:00
Adrian Lopez
8c7d697c17 Fix yaml syntax 2015-10-06 10:26:44 +02:00
dagnello
3365dad0d8 Adding os_port Module to openstack ansible modules 2015-10-05 19:36:37 -04:00
James Cammarata
02c9a1b336 Merge pull request #2158 from Shrews/os_network
Allow setting external attribute
2015-10-05 16:22:42 -04:00
Toshio Kuratomi
dbc860daaa Fix docs build 2015-10-02 09:21:29 -07:00
Brian Coca
79ec9efd7b Merge pull request #1048 from emonty/feature/os_router
Add OpenStack Router module
2015-10-02 10:10:31 -04:00
David Shrewsbury
aa1e8b8b05 Add author to os_router 2015-10-02 09:41:18 -04:00
David Shrewsbury
08e91ef68f Deprecate older router modules.
The quantum_router_gateway.py and quantum_router_interface.py modules
are deprecated with this change.
2015-10-02 09:24:03 -04:00
David Shrewsbury
750a91520f Allow setting external attribute
With shade > 0.13.0, networks can be created that are externally
accessible. This adds a parameter for that.

Also, add RETURN documentation and 'if __name__' check around call
to main().
2015-09-25 14:58:47 -04:00
David Shrewsbury
d52bb67978 Allow complete router configuration
This change allows one to completely configure a router, including
gateway and interfaces, using the latest shade (>0.13.0).
2015-09-25 13:09:02 -04:00
dagnello
40974a9811 Adding new os_subnets_facts module
There can be instances during an Ansible play where the list of subnets
currently available from OpenStack is required.  This update provides
subnet list functionality as a new os_subnets_facts module.
2015-09-24 16:08:20 -07:00
dagnello
7d09437328 Adding os_networks_facts module
There can be instances during an Ansible play where the list of networks
currently available from OpenStack is required.  This update provides
network list functionality as a new os_networks_facts module.
2015-09-24 16:07:45 -07:00
Abitha Palaniappan
e64791ef1a os_server: Adding support to accept 'n' nic args as a string containing list 2015-09-24 14:00:27 -07:00
dagnello
842f09cf24 Adding new image facts module 2015-09-20 21:15:40 -07:00
James Cammarata
d2c7d30c50 Merge pull request #250 from saito-hideki/bug/249
The nova_compute module create a list of un-use floating ip by value of fixed_ip
2015-09-17 11:25:35 -04:00
James Cammarata
64c0b67154 Merge pull request #1599 from emonty/feature/os_user_group
Add OpenStack Group content module
2015-09-17 11:22:56 -04:00
James Cammarata
b743224aa9 Merge pull request #1831 from tkinz27/os_start_stop
Adding start and stop actions to os_server_actions
2015-09-17 11:19:30 -04:00
David Shrewsbury
ef93fb1c14 More os_router module cleanup and fixes.
Added a RETURN section, corrected version_added value, removed use of
'result' in exit_json() calls.
2015-09-14 16:20:18 -04:00
Abitha Palaniappan
f449a0f48c Add support for port-id,port-name to nics in os_server 2015-09-09 15:38:39 -07:00
Victor Costan
2cc431f791 Fix indentation in os_server documentation 2015-09-09 01:29:38 -04:00
Victor Costan
2ae37e7845 os_server: nice error when flavor not found
When we can't find the VM flavor that the user requests, this change replaces the non-descript stack trace with a clear error message.
2015-09-04 20:46:26 -04:00
Brian Coca
8f31323b5c Merge pull request #1862 from SinisterLight/devel
checking remote_group_id while comparing os_security_group_rule
2015-09-04 12:48:59 -04:00
James Martin
c54f875fdd Adds sanity check to make sure nics is a list. 2015-09-02 11:02:31 -05:00
Chrrrles Paul
5fc4f9d876 Merge pull request #1982 from lowwalker/patch-2
Merging, good catch -- updated examples
2015-08-28 14:12:58 -05:00
Luke
40f2ff9fbf removed hyphens in module name in examples 2015-08-28 08:46:45 -04:00
Luke
a4aa29edd9 updated examples
When testing with existing example, I received errors about auth block not being ingested. After adding the auth block, name and state with "=" caused syntax errors.
2015-08-28 08:34:05 -04:00
Tony Kinsley
bd210e42bc Adding start and stop actions to os_server_actions
Also making the os_server module allow a server in the possible new
states from the os_server_actions changes
2015-08-23 11:51:28 -07:00
Nithy Renganathan
4171d167f4 Handle the changed value 2015-08-20 14:24:05 +00:00
Mahesh Sawaiker
f459b3773c support creating role only 2015-08-17 16:28:18 +00:00
Shobhit Srivastava
8ad072c96f checking remote_group_id while comparing os_security_group_rule 2015-08-04 12:52:56 +05:30
Brian Coca
697307f88c Merge pull request #1670 from mikeputnam/issue-1643-gpl-header
Add missing GPLv3 License header
2015-07-30 14:39:44 -04:00
Jesse Keating
84dfcf3690 Handle non-updatable openstack subnet details
Some things cannot be updated via the API, so check for those and fail
if the user is wanting to update them. Also don't try to update ipv6
stuff, as that doesn't work and will cause a traceback.
2015-07-27 14:54:29 -07:00
David Shrewsbury
6aac888c7d Add new os_nova_flavor module.
The os_nova_flavor module allows a user with administrative privileges
to create and delete nova flavors.
2015-07-16 19:06:04 -04:00
Hideki Saito
a2979a3102 The nova_compute module create a list of un-use floating ip by value of fixed_ip.
Fixes #249
2015-07-14 13:48:42 +09:00
Toshio Kuratomi
350063532e Merge pull request #1685 from j2sol/feature/os_subnet_ipv6
Plumb ipv6 modes into os_subnet
2015-07-09 14:10:56 -07:00
Monty Taylor
007efe438d Merge pull request #1690 from emonty/typo-fix
Fix a small typo in parameter processing
2015-07-09 09:36:00 -04:00
Monty Taylor
fbb6277a37 Fix a small typo in parameter processing 2015-07-09 09:33:10 -04:00
Brian Coca
e3c774be6f Merge pull request #1632 from emonty/feature/os_floating_ip
Add OpenStack Floating IP module
2015-07-07 19:42:42 -04:00
Jesse Keating
de89f9f99a Plumb ipv6 modes into os_subnet
Shade already supports these, we just need to plumb them into the module
code.
2015-07-07 16:10:44 -07:00
Jesse Keating
76398781ba Fix up docs 2015-07-07 15:29:47 -07:00
Monty Taylor
dd9c292861 Update docstring to show port ranges as optional 2015-07-06 18:53:31 -04:00
David Shrewsbury
6933407cd4 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.
2015-07-06 18:50:03 -04:00
David Shrewsbury
8664c88417 Change required parameters for rules module
The ports and protocol are no longer required (and now depends on
a new version of shade).
2015-07-06 18:50:03 -04:00
Monty Taylor
9f03302b68 Use int in the parameter list instead of casting 2015-07-06 18:50:03 -04:00
dagnello
2e8daa2330 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.
2015-07-06 18:50:03 -04:00
David Shrewsbury
f027e75976 Compare ports as strings
Ports as returned from shade are ints. They are strings as they come
in to the module.
2015-07-06 18:50:03 -04:00
David Shrewsbury
9d0c8b0507 Fix syntax error 2015-07-06 18:50:03 -04:00
Monty Taylor
0e5942d7e7 Return rule object 2015-07-06 18:50:03 -04:00