847 Commits

Author SHA1 Message Date
Jakob Meng
546f24940f Refactored tests for keystone_federation_protocol{,_info} modules
Change-Id: I9665f04e6c0d5a84d6c20a73ef7b0dfdc7bd8159
2023-01-26 13:36:03 +01:00
Jakob Meng
f507465c9e Pivoted docs to generic resource{,s} modules and StateMachine class
Change-Id: Iebcd45d0eae79ab3911fd97c63d17b42d238f875
2023-01-26 13:35:45 +01:00
Jakob Meng
90b110794f Refactored federation_idp{,_info} modules
Change-Id: Icbff6c799a9c33f1104633f7d9521f02228217a5
2023-01-26 13:35:27 +01:00
Jakob Meng
c9afdbfd73 Refactored identity_user{,_info} modules
Change-Id: Iae52d1a86f8f78790290be3966681f2277b9701d
2023-01-26 13:35:09 +01:00
Jakob Meng
4a27306440 Refactored identity_role{,_info} modules
Change-Id: If8230eb8b41b5461e1eaa470569030e8a888015b
2023-01-26 13:34:53 +01:00
Jakob Meng
8534990840 Refactored identity_group{,_info} modules
Change-Id: I72dce1278a7623d4f68cabcceafcdfefda900195
2023-01-26 13:34:33 +01:00
Jakob Meng
16a8a9e5d4 Refactored identity_domain{,_info} modules
Change-Id: Idf48f10e66a5651fa4693774eecd2c8683703082
2023-01-26 13:34:06 +01:00
Jakob Meng
a4a6e6d4ec Added resource{,s} modules
Change-Id: I0b04d43d5095ee74ec5af27013b6159a6a4d0f13
2023-01-26 09:34:30 +01:00
Rafael Castillo
778cf14f1b Refactored server_action module
Co-Authored-By: Jakob Meng <code@jakobmeng.de>
Change-Id: Ib9b7e26889123443a67b35e094deb3cadeb615fe
2023-01-19 08:54:40 +01:00
Jakob Meng
1b38b7c500 Properly documented openstacksdk version requirements
With "extends_documentation_fragment: ['openstack.cloud.openstack']"
it is not necessary to list required Python libraries in section
'requirements' of DOCUMENTATION docstring in modules. Ansible will
merge requirements from doc fragments and DOCUMENTATION docstring
which previously resulted in duplicates such as in server module [0]:

* openstacksdk
* openstacksdk >= 0.36, < 0.99.0
* python >= 3.6

When removing the 'requirements' section from server module, then
Ansible will list openstacksdk once only:

* openstacksdk >= 0.36, < 0.99.0
* python >= 3.6

To see what documentation Ansible will produce for server module run:

  ansible-doc --type module openstack.cloud.server

[0] https://docs.ansible.com/ansible/latest/collections/openstack/\
    cloud/server_module.html

Change-Id: I727ed95ee480bb644b5a533f6a9526973677064c
2023-01-16 13:51:01 +01:00
Jakob Meng
a46bbd0d48 Warn about issues with (de)attaching floating ip addresses to/from servers
Change-Id: I6d3349537ad836385fc415d51009fb868b6279e0
2023-01-16 13:35:48 +01:00
Jakob Meng
39ffebea4c Removed TripleO related Zuul CI jobs
TripleO jobs are no longer relevant for upcoming
releases of Ansible OpenStack collection.

Change-Id: I1d4faa295d3e146514c33a6307d205aaf0e0ba4b
2023-01-15 19:38:05 +01:00
Jakob Meng
cc9ca5a34b Refactored image{,_info} modules
Code of the image module has been refactored partially only.
It will have to be completed in a follow up patch.

Change-Id: Id2360163117db9639a0af502ab44e02cae5cebaa
2023-01-14 09:12:21 +01:00
Jakob Meng
1f8c9fee05 Fixed ci integration tests for server actions
Change-Id: I151510cb0e914c33a86d2eb9d205c389bbe2acba
2023-01-13 21:00:59 +01:00
Jakob Meng
0c75f19e4c Refactored compute_flavor_info module
Change-Id: Ic598a60c2dd6fb465965fa8beee0ea973385bbcf
2023-01-13 20:59:59 +01:00
Jakob Meng
e34f259566 Added support for 'any' protocol in security group rules
Story: 2007849
Task: 40143

Story: 2008064
Task: 40747
Change-Id: I1e2f6dde4c7a17b6c5c9fcffad1b5748a1d44a15
2023-01-13 20:55:05 +01:00
Jakob Meng
5aaa41c9c4 Inlined network_external variable
Change-Id: I4cbbd84eaed99dae40c72fbdf567b480a1f268a4
2023-01-12 13:49:43 +01:00
Jakob Meng
eaa26c6b9c Refactored project{,_info} modules
Change-Id: I863d08c42b4c708444b74e3d47f0ca70a8ff94fd
2023-01-11 07:39:17 +01:00
Jakob Meng
0071fdcd97 Refactored compute_service_info module
Change-Id: I1773b72f8c7eaec77f0480045c45073dc522c5cf
2023-01-11 07:38:57 +01:00
Balazs Pokoradi
124e174d27 Added parameter for managing rules in security_group module
Co-Authored-By: Jakob Meng <code@jakobmeng.de>

Change-Id: I571955e8f4023293cce325604de5f1689b855416
2023-01-11 07:38:05 +01:00
Jakob Meng
4dc6c421db Refactored security_group_rule{,_info} modules
Change-Id: Ie953bee843a43b945d24d6152766b3ae418f797c
2023-01-11 07:37:18 +01:00
Jakob Meng
4cf6842222 Refactored security_group{,_info} modules
Change-Id: I8ae38c038e24ae53704224adb614b98e2e56a271
2023-01-11 07:36:59 +01:00
Jakob Meng
647ffef375 Refactored coe_cluster{,_template} modules
Change-Id: I209b242b43d8b79740752cd2c405705d247326c4
2023-01-10 16:16:28 +01:00
Jakob Meng
97c4531d15 Refactored lb_{health_monitor,listener,member,pool} modules
Change-Id: Iffd6ffb08aae4cbd84e4cade79993d82e8c2b2de
2023-01-10 16:16:03 +01:00
Jakob Meng
407b50c8b2 Refactored loadbalancer module breaking backward compatibility
Module option 'listeners' has been removed because it shares
functionality and a huge amount of code with
lb_{listener,member,pool} modules.

Co-Authored-By: Rafael Castillo <rcastill@redhat.com>

Change-Id: I839365bd3485859a2351b0124eae9d09a9d0b31a
2023-01-10 16:15:45 +01:00
Jakob Meng
122afc170c Fixed docs
Change-Id: I33953e9293a2ef2715bfcf076a262c474da40dc3
2023-01-10 15:20:07 +01:00
Polina-Gubina
52e7bfe7a4 Added is_multiattach parameter to volume module
Change-Id: Ieb98d78d730ee51480c78053152da265481c11f1
2023-01-10 13:33:53 +01:00
Jakob Meng
7d9de2858a Updated docs
Co-Authored-By: Sagi Shnaidman <sshnaidm@redhat.com>

Change-Id: Ib94adb1c6d6237800db13b3cc243e0897aa6a49f
2023-01-10 13:16:01 +01:00
Arnaud Morin
852d971d50 Add reboot and reboot_hard actions on server
Reboot actions (both SOFT and HARD) were missing in ansible actions.
Reboot is different than stop and start, because reboot (HARD) is asking
openstack nova to recreate the libvirt XML, which is sometimes needed.

Signed-off-by: Arnaud Morin <arnaud.morin@ovhcloud.com>
Change-Id: I43a42010e7474f47020c8df2839f8584157c97a4
2023-01-10 08:16:19 +00:00
Jakob Meng
3b0ae6c43f Use Neutron instead of Nova when detaching floating ips if available
Nova's API for detaching floating ips is deprecated and will fail
with a 404 starting from microversion 2.44. It has been replaced with
Neutron networking service API [0].

Previously, this did not cause issues because openstacksdk was not
passing a microversion for server actions, but this has been fixed
in [1].

[0] https://docs.openstack.org/api-ref/compute/#remove-disassociate-floating-ip-removefloatingip-action-deprecated
[1] https://review.opendev.org/c/openstack/openstacksdk/+/867890

Change-Id: Idad68d12f4ee163480877418caa93146ea873237
2023-01-05 09:14:20 +01:00
Jakob Meng
7945d7f01a Improved compatibility with both tox>3,<4 and tox>=4
Tox>3,<4 does not support dots in generative envlists and tox>=4 changed
its behaviour when it detects hyphens in env names [1].

[1] 0580121601/src/tox/tox_env/python/api.py (L130)

Change-Id: I63ad716415755d2a140a6ade97d22bd18236a0df
2022-12-30 10:38:58 +01:00
Jakob Meng
85fa2bb2b6 Moved Octavia image upload and CirrOS image identification to Ansible
Change-Id: Ief843310ce57a2d1062d86c54cd7ad6e0f705b68
2022-12-10 14:25:08 +01:00
Jakob Meng
133af96666 Dropped obsolete module templates
Module templates have little benefit because
* they are not documented anywhere,
* their structure is not suitable for our modules, hence not a
  single module is written according to the templates,
* contributers better base their own modules on existing modules
  because we have modules for most OpenStack components,
* they are outdated, e.g. normalizing is a relict of
  openstacksdk<0.99.0 and results,
* they are bloated, e.g. *_info module is doing preliminary checks
  and creating filters in separate functions which proved in other
  modules to be much better readable when inlined,
* they are hard to understand, e.g. argument_spec definition is
  a huge Jinja2 template which does nothing except for copying
  arguments from one place to another,
* they are not tested.

Change-Id: I460b75c09a361e712bbfb002c1ad1d03b3dff8ee
2022-12-10 14:24:27 +01:00
Robin Koch
51f1fea8b3 Added tests for router interface creation in a shared network
Story: 2010012

Change-Id: Ifa6a7e5a799a5bdfb3bbf585436e57cc6eea0811
2022-12-10 13:21:25 +01:00
Jakob Meng
94c150b2e7 Allow all external commands in tox
Change-Id: I76e0fc0e574d791e8f4d83ccc22289fa06360709
2022-12-10 11:48:48 +01:00
Samuel Kunkel
6b911ebd21 Allow setting flavor description
This will, like all other options changes, recreate the flavor. This
matches the workflow allowed by the openstacksdk (if description is
not set, it defaults to None).

Change-Id: I3d46a3f527f0632f42f6796c0a2701addebde640
2022-11-30 10:55:01 +01:00
Jakob Meng
cec58d7560 Bump minimum required openstacksdk release to 0.103.0
Latest release candidate 0.103.0 of openstacksdk's first major release
brings new features and bug fixes, e.g. for floating ips [1],
servers [2] and flavors [3].

[1] https://review.opendev.org/c/openstack/openstacksdk/+/850115
[2] https://review.opendev.org/c/openstack/openstacksdk/+/857987
[3] https://review.opendev.org/c/openstack/openstacksdk/+/864554

Change-Id: Ib96cbc0522fcb0d7c10a11c98172184f60b4407d
2022-11-30 10:54:40 +01:00
Jakob Meng
0e07b15f92 Refactored dns_zone{,_info} modules
Change-Id: I030cc0566ae94edf340d33e1e00c20403acabb2d
2022-11-30 10:54:17 +01:00
Jakob Meng
7c536e69b3 Refactored object{,_container} modules breaking backward compatibility
Previously both modules object and object_container had huge overlaps in
functionality. Both allowed to create and delete containers. One would
not have to pass a object to the object module at all and could use it
to manage containers only. Now the object module has been changed to
manage an object in a container only while the object_container module
is responsible for managing Swift containers only.

With object module it is now also possible to pass data instead of a
filename via module options. The container_access functionality has been
dropped from object module. It has been moved and extended as read_ACL
and write_ACL options in object_container module.

With object_container module it is now also possible to manage the
container access with read_ACL and write_ACL options. Those mirror
earlier container_access option of the object module which has been
removed.

Change-Id: I96fb9b946444866b157655e148250f1eda35e942
2022-11-30 10:53:52 +01:00
Jakob Meng
1ca6f208f7 Refactored catalog_service{,_info} and auth modules
Replaced service_catalog return value in auth module with new
catalog_service_info module.

Change-Id: I1ca5082d643eb97e8cb951a4bccf92b78537d917
2022-11-30 10:53:24 +01:00
Jakob Meng
00ec3f1c92 Refactored subnet_pool module
Change-Id: If210789edac2768178ccf323ec5be12f0c439a0f
2022-11-30 10:53:08 +01:00
Jakob Meng
0f37ed795b Refactored neutron_rbac_polic{ies_info,y} modules
Change-Id: I1cd37096834d4159b5fa46719f5c479cb2bc29a9
2022-11-30 10:52:27 +01:00
Rafael Castillo
daf79de37e Updates server_group for 2.0.0
Replaces the policies argument with policy. The policies attribute is
ancient and was superceded by policy a long time ago[0][1]. Since policy and
policies differ in type, we can't simply alias these and had to drop
policies to keep the implementation small.

[0] https://docs.openstack.org/nova/latest/reference/api-microversion-history.html#id59
[1] https://docs.openstack.org/api-ref/compute/#create-server-group

Change-Id: Icd658fb179ca0a96276b033130b9dddfedd84236
2022-11-17 04:41:14 -07:00
Jakob Meng
961bdb5bd5 Refactored federation_mapping{,_info} modules
Change-Id: I8ab45280badf7fc9448e2ebfc6e38648cc2dc1b7
2022-11-10 19:50:48 +01:00
Jakob Meng
d3c5ddd40f Refactored compute_flavor module
Change-Id: Id023d13abf5c1179044fcc611a3e509f16f10621
2022-11-10 19:41:36 +01:00
Jakob Meng
114bc855c0 Refactored keystone_federation_protocol{,_info} modules
Change-Id: I6f9eef184538df4feff49dd6ed659a9b9ac1289f
2022-11-10 19:39:51 +01:00
Jakob Meng
5862d91615 Split project_access into {compute_flavor,volume_type}_access modules
Change-Id: I33fa4b3a08392feac702f45a2c47f8b04799ac0b
2022-11-10 19:35:49 +01:00
Rafael Castillo
4fe73c978a Updates server_metadata for 2.0.0
- Switch to using proxy layer calls
- Return whole server resource instead of only metadata map
- Swap the name and server aliased parameters
- Add a server_metadata test role
- Ensure check mode returns tentatively updated metadata
- Remove server_id return value

Change-Id: Id63e6a80d1b8e3574911016fec792f00b63f1524
2022-11-10 13:04:52 +00:00
Jakob Meng
cd002a5555 Use module defaults groups in ci integration tests to reduce code bloat
Change-Id: I1370f5bcde602f63b4763c487f027677e79c73b0
2022-11-09 14:35:17 +01:00
Jakob Meng
d0ac32eefd Refactored integration test of openstacksdk logging feature
Instead of asserting that openstacksdk created a logging file,
we read the contents of that log file now. The benefit is, that
this integration test gives users an idea how to actually use the
logging feature and also read the contents of the log file.

Change-Id: I9e3c75dda4c1c920937c9780fbdcbe3caeb4d6ad
2022-11-09 14:35:09 +01:00