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)
- 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)
- 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)
- 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)
Alongside OpenStack SDK 1.0.0 we will release a new collection version
2.0.0 which is compatible to OpenStack SDK 1.x.x series only. Code in
branch stable/1.0.0 will remain compatible to OpenStack SDK 0.x.x
series only. Release candidates for the first major release of
OpenStackSDK 1.x.x will be numbered using 0.99.x versions.
At Ansible OpenStack modules PTG on 2022-04-07 it was decided to raise
an error if one is using a incompatible releases of the OpenStack SDK
with our collection. We decided against showing warnings only because
they can be missed easily and functionality will be broken but
probably hardly detectable when using the wrong SDK.
This patch caps the maximum required SDK versions to 0.98.999, so
that an error will be raised when users try to use our collection with
an incompatible SDK release, e.g. use code from our stable/1.0.0 branch
with a OpenStack SDK 0.99.x or 1.x.x release.
Change-Id: Ic077f7a906698025edf20acf22c7a5c6caa8734a
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)
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
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)
Added ci integration tests, updated return value documentation and
refactored to simplify code.
Change-Id: If8a1145a31d685d41367383930e6fd08d64c6ae8
(cherry picked from commit 1d22a94a90)
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)
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)
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)
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)
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)
Older releases of OpenStack SDK do not support filtering services.
Change-Id: I613c76b8f794ea2024939e07250a50edc5b9e49a
(cherry picked from commit e85a0b809a)
Alongside OpenStack SDK 1.0.0 we will release a new collection version
2.0.0 which is compatible to OpenStack SDK 1.x.x series only. Code in
branch stable/1.0.0 will remain compatible to OpenStack SDK 0.x.x
series only.
At Ansible OpenStack modules PTG on 2022-04-07 it was decided to raise
an error if one is using a incompatible releases of the OpenStack SDK
with our collection. We decided against showing warnings only because
they can be missed easily and functionality will be broken but
probably hardly detectable when using the wrong SDK.
This patch implements the code to raise errors when users are trying
to use our collection with an incompatible SDK release, e.g. use code
from our stable/1.0.0 branch with a OpenStack SDK 1.x.x release.
It does not yet change the minimum and maximum required SDK versions
because OpenStack SDK 1.0.0 has not yet been released to PyPI and
SDK's master branch still does not return a 1.x.x version number.
Change-Id: I1052d21cf8f108dbc99619cd4c4072488645b855
(cherry picked from commit bc6622e0e7)
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)
Commit 879270aa47 [1] bumped the required minimum SDK release
but missed to update two locations in code and docs.
Ref.:
[1] 879270aa47
Change-Id: I725a26b07484619f6f2c460e974821f81d60b153
(cherry picked from commit 5a43bdb873)
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)
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
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
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
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
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
This commit adds the ability to specify whether the ansible_host and
ansible_ssh_host variables should use 'name' inplace of 'interface_ip'.
The primary use case for this, is if you want to access hosts using
the instance name defined in OpenStack instead of the floating IP.
This is usually when using a jump/bastion host.
Implements: use_names
Change-Id: I809cca0f27f16b37cb9c1c18121f468ccf5c805c
Create, Update, Remove ironic ports from OpenStack.
NOTE: Does not support 'is_smart_nic', afict this is
not implemented in openstacksdk.
Change-Id: I6d9519988e98b10d0f7bd19b1387fb1f3b657046
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
Add module baremetal_node_info / os_ironic_info.
Retrieve information about Bare Metal nodes from OpenStack
Change-Id: I597a66b817bb6b53ecad7503e44f6818aec031a2
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
The module retrieve the nova compute services info
filters by
* host
* binary ( nova-compute, nova-conductor, ... )
Closes-Bug: 2009775
Change-Id: I0f9cac27a7a91727ba1d005e04431e8f83c46fa8