297 Commits

Author SHA1 Message Date
Jakob Meng
8dfcd17731 Do not remove trailing spaces when reading public key in keypair module
Previously, openstack.cloud.keypair would remove trailing spaces after
reading a public key from a file. The openstack cli tool, python-\
openstackclient, does not do so, i.e. it does not use rstrip to remove
spaces at the end [1]. This breaks idempotency when using openstack
cli tool and our keypair module at the same time.

The rstrip code was introduced to keypair when our modules were still
part of ansible (non-core) in a completely unrelated change [2].

Now, keypair module does no longer alter the public key and instead
uploads it unchanged to OpenStack API.

[1] 7df94c9f82/openstackclient/compute/v2/keypair.py (L103)
[2] 341efbf7ae

Story: 2008574
Task: 41726
Change-Id: Ia09658467d98516ca1ea612e7301629b2f69d2d1
(cherry picked from commit 73827a3d57)
2022-09-07 14:04:48 +00:00
Arx Cruz
7a9837dfb5 Backport improvements to endpoint module
- Adds endpoint tests
- Update docs

Change-Id: Ibd647d0c2cd2f90310f381e56088e7e8e93f76fc
(cherry picked from commit 452404ee87)
2022-07-12 10:33:50 +02:00
Arx Cruz
26b53e78b2 Backport improvements to catalog_service
- Adds tests
- Update docs
- Add option aliases

This patch do the following:

* Update catalog_service to use new openstacksdk
* Add catalog_service role to test catalog_service module

Change-Id: I6778f5e91cb0ead63cede28af0111d7ffbbf3ab1
(cherry picked from commit 7c7e61d36b)
2022-07-07 11:35:40 +00:00
Arx Cruz
b8c2310963 Backport improvements to role_assignment
- Refactor module

Change-Id: I09258e18d50acb57501ea1b47d9422dad857607e
(cherry picked from commit 8d5195fdf2)
2022-07-07 06:43:33 +00:00
anbanerj
915a78d7af Backport improvements to keypair_info
- Updates docs
- Improves test coverage

Change-Id: I09c75717a620272904b023179c726a19c4bca000
(cherry picked from commit 595f7d1093)
2022-07-06 15:19:50 +02:00
Zuul
3ecd3b6e64 Merge "Backport improvements to recordset module" into stable/1.0.0 2022-06-17 01:20:56 +00:00
Rafael Castillo
c4a296c07c Backport improvements to recordset module
- General refactoring of module
- Move recordset specific tests from the dns role to new recordset role
- Adds additional tests to recordset role

Note that this is not a clean cherry pick due to sdk changes

Change-Id: If8fda40780050d271c9d869d8959ef569644fd88
(cherry picked from commit 97b05533f1)
2022-06-16 13:41:44 -07:00
Rafael Castillo
6b58d28a4e Backport enhancements to host_aggregate module
- Update the module to return an aggregate object
- Adds a role to test the module

Note that this is not a clean cherry pick as it excludes changes related
to new sdk compatibility.

Change-Id: I6a98ba8466863b41fc996855fd12cf9f3097abe0
(cherry picked from commit 4ea2c5b50d)
2022-06-02 12:45:01 +02:00
Jakob Meng
3c047406dc Backported changes to identity_group_info from master branch
Added ci integration tests and updated return value documentation.
Reverted function calls which would break backward compatibility
with previous collection releases.

Change-Id: I24e64c9455618952ee612d7413882f0ac022189f
(cherry picked from commit a6805cd019)
2022-05-11 10:43:20 +02:00
Jan Horstmann
acf64a1f72 Set owner in image module
Previously the owner field was not set by module
`cloud.openstack.image`, although it is specified as a module parameter.
The usual approach in `ansible-collections-openstack` is to accept both
names and IDs when referencing openstack resources.
Therefore this commit follows the approach taken by
`python-openstackclient` in [1] and introduces a `project` and a
`project_domain` parameter to identify projects by name or ID and
assign the ID to the `owner` attribute of the image.
The `owner` parameter is left as an alias to `project` in the module.

Story: 2009983
Task: 45012

[1]
cf2de9af79

Change-Id: I3654587df8e40d554aac5126df307961f335332c
2022-05-10 13:47:33 +02:00
anbanerj
a4894337d4 Backported changes to image_info from master branch
Added ci integration tests, updated return value documentation and
refactored to simplify code. Reverted changes such as function calls
and return values which would break backward compatibility with
previous collection releases.

Change-Id: Ibf934568f069c305747fc24fbb22ce3fc095286c
(cherry picked from commit c1a9794207)
2022-05-10 10:00:48 +02:00
Jakob Meng
0b0a80796f Backported changes to identity_role_info from master branch
Added ci integration tests, updated return value documentation and
refactored to simplify code.

Change-Id: If8a1145a31d685d41367383930e6fd08d64c6ae8
(cherry picked from commit 1d22a94a90)
2022-05-09 17:05:18 +02:00
Jakob Meng
c63ff6fbc8 Backported changes to identity_domain_info from master branch
Added ci integration tests and updated return value documentation.
Reverted function calls which would break backward compatibility
with previous collection releases.

Change-Id: Ic7915fd3334266783ea5e9d442ef304fa734ca00
(cherry picked from commit b31fdf8320)
2022-05-09 13:25:27 +02:00
Jakob Meng
4f8f6ffaf4 Backported changes to identity_user from master branch
Renamed ci integration tests to match module name, updated return
value documentation and refactored to simplify code. The module will
no longer fail if no password is supplied since it is perfectly fine
to create a user with an password. Reverted function calls which
would break backward compatibility with previous collection
releases.

Change-Id: I97ee9b626f269abde3be7b2b9211d2bb5b7b3c26
(cherry picked from commit fd1b9fc0d2)
2022-05-06 14:28:34 +02:00
Jakob Meng
0204bbeede Backported changes to identity_user_info from master branch
Added ci integration tests and updated return value documentation.
Reverted function calls which would break backward compatibility
with previous collection releases.

Change-Id: I99e98a529ce74ff2ca77a67d09f188228e6a0e37
(cherry picked from commit 2df07f3523)
2022-05-05 13:14:09 +02:00
Rafael Castillo
a3bb143f34 Sychronize updates to identity_role from master branch
Rename ci role to match the module name. Reverted function calls
which would break backward compatibility with previous collection
releases.

Change-Id: Ie59da441d39fe2d0e49430662d853bc9628181e0
(cherry picked from commit cc1b5ecae8)
2022-05-04 09:21:32 +02:00
Jakob Meng
a70a4c3424 Fixed return value disable{d,s}_reason in compute_service_info module
OpenStack SDK 0.53 renamed parameter disables_reason to disabled_reason
in openstack/compute/v2/service.py, hence our compute_service_info
module will return different values depending on which release of
the OpenStack SDK is used.

Ref.: 5450c45253

Change-Id: I1c0f787f7f67c92f92dd106fc8d55580461e4aa3
(cherry picked from commit cf5007d478)
2022-05-02 12:30:33 +00:00
Jakob Meng
e64211213a Constrain filters in compute_service_info to SDK >= 0.53.0
Older releases of OpenStack SDK do not support filtering services.

Change-Id: I613c76b8f794ea2024939e07250a50edc5b9e49a
(cherry picked from commit e85a0b809a)
2022-04-28 05:49:47 +00:00
Arx Cruz
e8f9457893 Move dns zone info to use proxy layer
Make it compatible with new SDK.
Although this one was already using self.con.dns.zones to retrieve the
zones, it wasn't using the to_dict(computed=False) and was still
removing the location (which is obsolate when you use to_dict.

Change-Id: Ie2a5b772acc0c8c8338f6f1da877564a077e3b7a
(cherry picked from commit 0c6e8bed69)
2022-04-26 15:07:46 +02:00
Jesper Schmitz Mouridsen
82311440b5 Support description in sg-rule creation
Change-Id: I7800a91682b143b29c30e97661e057c6c41f4663
Signed-off-by: Jesper Schmitz Mouridsen <jesper@schmitz.computer>
(cherry picked from commit ecf4897a55)
2022-04-26 11:50:23 +02:00
Jakob Meng
57012cbaa3 Drop username from return values of identity_user_info
Users would have a non-null username only with Identity API v2 which
was available in Keystone of OpenStack Pike. Identity API v2 has been
removed since OpenStack Queens [1].

Function search_users() from OpenStack SDK still returns the username
attribute because of [2][3] but it will always be None since
Keystone's API does not return username since OpenStack Pike.

[1] https://docs.openstack.org/releasenotes/keystone/queens.html
[2] 975cabbdd8/openstack/cloud/_utils.py (L246)
[3] 76b081efe4

Change-Id: I2054dd55662698dabd0f2b3565c31dcd3bf24e5a
(cherry picked from commit 5fc8fca06b)
2022-04-21 10:36:46 +00:00
Arx Cruz
4b9e2295e0 Fix logic in routers_info
The list of fixed ips on the routers info was wrong, adding only the
last one instead of the all of them.

Change-Id: I0bb352ea1845d25cff3aeae507aa55ba473b0a45
2022-04-12 18:47:13 +00:00
Jakob Meng
b3ac841442 Dropped deprecated return values in floating_ip_info and assert remaining fields
Attributes such as location and tenant_id are computed by OpenStack
SDK. We do not return these fields in floating_ip_info because e.g.
tenant_id has been marked as deprecated and is a copy of the
project_id field.

Ref.: 70a06d9990

Added an assertion to CI which checks that all advertised fields
are returned by floating_ip_info. This helps with detecting breaking
changes in future updates.

Change-Id: I62e4681cd57f82054f68efe1dc59be2cca118135
2022-04-06 07:58:46 +00:00
Arx Cruz
37c52c321d Changed compute_flavor_info module to use OpenStack SDK's proxy layer
We still return computed values here to keep backward compatibility.

Change-Id: Idad13228efe55b2dd35224cc37c61657590f9b8e
2022-04-05 13:46:15 +02:00
Arx Cruz
6edc70f965 Updated return value docs of compute_service_info module
We still return computed values here to keep backward compatibility.

Change-Id: I11af9486a6a284d1756380548fca22435c43765a
2022-04-04 11:33:06 +02:00
Ümit Seren
b572bf8ae9 Add subnet pool module
Change-Id: Ib8b5481a1e257490f2a9ff62659a70ea2e920304
2022-03-31 20:05:11 +00:00
Gaudenz Steinlin
b3e0d610ea Add 'all_projects' to server_action module
This allows to execute actions on servers outside of the current auth
scoped project if the user has permission to do so.

Change-Id: Ifb3f40973a76ad8c57bcbcbcb8e73c917681096b
2022-03-31 12:18:09 +00:00
Sagi Shnaidman
f70a50e363 Fix ansible-lint issues for newest version
Change-Id: I8238b5d5e49c2a4a8ed3228de23349092c9e1220
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2022-03-29 18:51:01 +00:00
anbanerj
cbcfce2e23 Remove old, unsupported parameters from documentation in image_info module
This patch removes "deleted" and "deleted_at" from the doc in image_info module.
These params were never returned since image_info started using openstacksdk.

Change-Id: Id5aa9164bacf7808fd21235bd7327569344295ab
2022-03-18 10:57:44 +00:00
Will Szumski
406558dae9 Handle aggregate host list set to None
A freshly created host aggregate can have the host list set to None,
consequently you'd hit:

```
failed: [localhost] (item={'name': 'gpu', 'hosts': [], 'metadata': {'type': 'gpu'}}) => {"ansible_loop_var": "item", "changed": false, "item": {"hosts": [], "metadata": {"type": "gpu"}, "name": "gpu"}, "module_stderr": "Traceback (most recent call last):\n  File \"/var/lib/home/stackhpc/.ansible/tmp/ansible-tmp-1642696576.6728637-1456290-187052400642084/Ansiba
llZ_host_aggregate.py\", line 100, in <module>\n    _ansiballz_main()\n  File \"/var/lib/home/stackhpc/.ansible/tmp/ansible-tmp-1642696576.6728637-1456290-187052400642084/AnsiballZ_host_aggregate.py\", line 92, in _ansiballz_main\n    invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\n  File \"/var/lib/home/stackhpc/.ansible/tmp/ansible-tmp-1642696576.672
8637-1456290-187052400642084/AnsiballZ_host_aggregate.py\", line 41, in invoke_module\n    run_name='__main__', alter_sys=True)\n  File \"/usr/lib64/python3.6/runpy.py\", line 205, in run_module\n    return _run_module_code(code, init_globals, run_name, mod_spec)\n  File \"/usr/lib64/python3.6/runpy.py\", line 96, in _run_module_code\n    mod_name, mod_spec, p
kg_name, script_name)\n  File \"/usr/lib64/python3.6/runpy.py\", line 85, in _run_code\n    exec(code, run_globals)\n  File \"/tmp/ansible_os_nova_host_aggregate_payload_qwjtdtjj/ansible_os_nova_host_aggregate_payload.zip/ansible_collections/openstack/cloud/plugins/modules/host_aggregate.py\", line 214, in <module>\n  File \"/tmp/ansible_os_nova_host_aggregate
_payload_qwjtdtjj/ansible_os_nova_host_aggregate_payload.zip/ansible_collections/openstack/cloud/plugins/modules/host_aggregate.py\", line 210, in main\n  File \"/tmp/ansible_os_nova_host_aggregate_payload_qwjtdtjj/ansible_os_nova_host_aggregate_payload.zip/ansible_collections/openstack/cloud/plugins/module_utils/openstack.py\", line 407, in __call__\n  File \
"/tmp/ansible_os_nova_host_aggregate_payload_qwjtdtjj/ansible_os_nova_host_aggregate_payload.zip/ansible_collections/openstack/cloud/plugins/modules/host_aggregate.py\", line 176, in run\n  File \"/tmp/ansible_os_nova_host_aggregate_payload_qwjtdtjj/ansible_os_nova_host_aggregate_payload.zip/ansible_collections/openstack/cloud/plugins/modules/host_aggregate.py
\", line 138, in _update_hosts\nTypeError: 'NoneType' object is not iterable\n", "module_stdout": "", "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error", "rc": 1}
```

I've not investigated which API and library combinations elict this
behaviour, but it does seem to occur. We can safely handle this
possibility in backwards compatible way.

It is possible to workaround this issue by invoking the module a second
time.

Change-Id: Ie14391f18c0f65833d00a4b4f6b1b314a0903d2b
2022-03-18 07:59:56 +00:00
Jan Weiher
a031968f80 Router: Remove unneeded 'filter' parameter
Change-Id: If46916e3480fced3be919c6d39b82a6c64321065
2022-03-14 08:31:31 +00:00
Jan Weiher
0e102b1411 [LB] Add support for setting monitor_address
Change-Id: I4897c6343813519859bd19fa162829fe2a6dc573
(cherry picked from commit 37a51ec6ad)
2022-03-09 14:06:29 +00:00
Piotr Parczewski
ba9aa9967f Fix os_quota docs
Change-Id: Ic2717669d0e9e8bb48bb7ed81fd5f5f55928fa55
2022-02-16 14:48:52 +02:00
Harald Jensås
0a7889b9a2 Add openstack.cloud.baremetal_port module
Create, Update, Remove ironic ports from OpenStack.

NOTE: Does not support 'is_smart_nic', afict this is
      not implemented in openstacksdk.

Change-Id: I6d9519988e98b10d0f7bd19b1387fb1f3b657046
2022-02-09 23:41:19 +01:00
Harald Jensås
a1b920742f Add openstack.cloud.baremetal_port_info module
Retrieve information about Bare Metal ports from OpenStack

NOTE: Does not support 'is_smart_nic', afict this is
      not implemented in openstacksdk.

Change-Id: I1d57ab976ac3b4c5552b9b21db7e90e25fd71764
2022-02-09 14:23:01 +01:00
Zuul
bd55e1f905 Merge "Add openstack.cloud.baremetal_node_info" 2022-02-09 09:48:57 +00:00
Harald Jensås
20329c0329 Add openstack.cloud.baremetal_node_info
Add module baremetal_node_info / os_ironic_info.
Retrieve information about Bare Metal nodes from OpenStack

Change-Id: I597a66b817bb6b53ecad7503e44f6818aec031a2
2022-02-03 20:23:13 +01:00
Sagi Shnaidman
bdf472a53f Move identity domain to use proxy layer
Make it compatible with new SDK and fix bug with "enabled"

Change-Id: I1f577fae27c24c257571d1cf90e49527470edace
2022-02-02 19:35:37 +02:00
hamza alqtaishat
20c2633ea3 Add dns_[name,domain] to the port module
The dns-integration extension adds the dns_name and dns_domain attributes
with this change updated/set operations can be done on those attributes

Change-Id: I4bb0f8692dec3fba5ab50f07571029f374761a5b
2022-01-25 22:51:38 +00:00
Ivan ROGER
5e2ab3d8c3 Fix identity user lookup with a domain
Task: 44308
Story: 2009790
Change-Id: I3bc99ebdf8bc915d7b1ae5e98230058a3f43223f
2022-01-18 15:39:32 +01:00
Zuul
39a627d4a0 Merge "Add Neutron RBAC modules" 2022-01-12 11:13:53 +00:00
hamza alqtaishat
4eb7c43539 Add compute services list module
The module retrieve the nova compute services info
filters by
 * host
 * binary ( nova-compute, nova-conductor, ... )

Closes-Bug: 2009775
Change-Id: I0f9cac27a7a91727ba1d005e04431e8f83c46fa8
2022-01-11 17:14:54 +00:00
Ashraf Hasson
8c6d1041fa Add Neutron RBAC modules
Change-Id: Ibaff06561055c5cd024abb789dae075dd7871f08
2022-01-11 11:59:58 -05:00
Will Szumski
86a57498e8 quota: Adds metadata_items parameter
This is used to set the maximum number of metadata items per instance.

Change-Id: Ib5b86126ec25e9e84436d7ee7f79e43e22637272
2021-12-16 18:59:40 +00:00
Zuul
22a7f516f3 Merge "server_volume: check specified server is found" 2021-11-11 12:44:07 +00:00
Baptiste Mille-Mathias
3f1a693bd6 server_volume: check specified server is found
... in order to fail nicely instead of throwing an exception.

Change-Id: I6d7f793b4058fdcaffd015724ae9b53aa21e5367
2021-11-11 11:11:45 +01:00
Sagi Shnaidman
8e87ad651f Don't require allowed_address_pairs for port
Port can miss allowed_address_pairs parameter.

Story: 2009192
Task: 43246
Resolves: rhbz#2021810

Change-Id: I8fcc19889eaaec6342c8d7910a55f06e98dbd368
2021-11-10 18:11:43 +02:00
Zuul
59d0e4c3a4 Merge "Flavor properties are not deleted on changes and id will stay" 2021-11-01 09:57:08 +00:00
Sven Anders
21b70f6b9b Flavor properties are not deleted on changes and id will stay
Fixing a bug on compute_falvor that causes that extra_specs
are deleted and the id is changing when a property of the
falvor is changed.


Changing the id will cause that a server which is using the falvor is
afterwards not assigned to the falvor anymore.


Story: 2009260
Change-Id: If7cbce107ce99de79749359e257933e4247e3634
2021-10-07 05:14:58 +00:00
Alexandru Verdes
a9a0d23441 Add client and member listener timeouts for persistence (Ex. SSH)
Add possibility to specify connection timeouts for SSH listeners.
These values are available in openstacksdk:
95ee95f52c/openstack/load_balancer/v2/listener.py (L89)

Change-Id: Ief1abd9018bb6dab73702cc416e5a916f8baa0d7
2021-10-01 09:17:55 +00:00