53 Commits

Author SHA1 Message Date
Grzegorz Koper
1a654a9c38 Add baremetal_port_group module
Add support for managing Ironic baremetal port groups.

Include CI role coverage and unit tests for create, update, delete, and check mode behavior.

Add a reno fragment describing the new module.

Tests-Run: python -m pytest tests/unit/modules/cloud/openstack/test_baremetal_port_group.py
Change-Id: I98564fcb5b81a1dd7be1fbf5ffca364483296655
2026-02-10 14:45:35 +01:00
Takashi Kajinami
d18ea87091 Drop compat implementations for tests
Python < 3.4.4 has already reached its EOL.

Change-Id: Ieb7cfd796991645db44dafc0e5ba82855c08853a
2024-12-19 19:00:27 +00:00
Sagi Shnaidman
4074db1bd0 Replace 2.16 jobs by 2.18 Ansible jobs
Change-Id: I4cae065e961a06d44792bef2e6479c30fe242911
2024-12-13 21:41:53 +00:00
Sagi Shnaidman
2d5ca42629 Fix CI and add 2.16 Ansible job
Change-Id: Idcb5d2db4a92084239b80703be6a80de3e9f1116
2024-12-10 17:00:47 +02:00
James Denton
d4f25d2282 Allow wait: false when auto_ip is false
There is an issue with the logic that results in a failure
to create a server when auto_ip is false. This patch tests
for the bool value of auto_ip and the two lists rather that
None.

Closes-Bug: #2049046
Change-Id: I2664c087c4bde83c4033ab3eb9d3e97dafb9e5cb
Signed-off-by: James Denton <james.denton@rackspace.com>
Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
2024-10-30 17:44:06 -05:00
Dmitriy Rabotyagov
407369da6e Fix linters for mocking
Right now linters test fail due to a trivial issue in mock loader.
This aims to fix CI for the repo.

Change-Id: Ib58e70d3a54b75ca4cb9ad86b761db1ded157143
2023-08-15 20:16:31 +02:00
Jakob Meng
19d1d41ee0 Bump minimum required openstacksdk release to 1.0.0
openstacksdk's first major release brings new features and bug fixes,
e.g. for Magnum clusters and cluster templates [1], [2], [3].

[1] https://review.opendev.org/c/openstack/openstacksdk/+/865267
[2] https://review.opendev.org/c/openstack/openstacksdk/+/871648
[3] https://review.opendev.org/c/openstack/openstacksdk/+/871987

Change-Id: Ic7aa998ac5fa5c05dbea188a4d3b76ea774ff797
2023-01-31 19:52: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
0ade33eb6f Bump minimum required openstacksdk release to 0.102.0
Latest release candidate 0.102.0 of openstacksdk's first major release
brings new features and bug fixes, e.g. for floating ips [1], [2].

[1] https://review.opendev.org/c/openstack/openstacksdk/+/859672
[2] 2535ba7a28

Change-Id: I009c8515e853baf4df3455fab19571f28e02ab46
2022-10-14 12:08:43 +02:00
Jakob Meng
57cc3e6aad Bump minimum required openstacksdk release to 0.101.0
Latest release candidate 0.101.0 of openstacksdk's first major release
brings new features and bug fixes, e.g. for floating ips [1], [2].

[1] https://review.opendev.org/c/openstack/openstacksdk/+/851976
[2] 0ded7ac398

Change-Id: I4f63e9edab19ba25918513b8c89fcd62913ae75a
2022-09-22 04:49:40 +00:00
Jakob Meng
0ec16fbecc Dropped extra interfaces_info attribute from routers_info module
routers_info's interfaces_info attribute is not provided by
openstacksdk, it is added to each router resource by the routers_info
module after retrieving the routers list. To get the required data
list_router_interfaces() [1] is being called for each router resource
which then retrieves all ports for each router. This requires extra
api calls which might be useless because we do not know whether the
user actually cares about the ports. For getting ports of a router
we have the openstack.cloud.ports module. So instead of proactively
retrieving the router ports we drop the interfaces_info attribute.

The interfaces_info attribute was introduced because retrieving
interfaces via openstacksdk and openstack.cloud modules was
complex in the past [2]. Nowadays, using openstack.cloud.ports
Ansible and Jinja2 filters retrieving ip addresses of a router
is straight forward. In case someone still needs the old
interfaces_info attribute, one can refer to the module example
to see how it could be reproduced. But in general, retrieving the
router interfaces is much easier as can be seen in the updated
integration tests.

[1] 3f81d0001d/openstack/cloud/_network.py (L1926)
[2] https://review.opendev.org/c/openstack/ansible-collections-openstack/+/703927/6/plugins/modules/os_routers_info.py

Change-Id: I7fbdf11d07c95421d3aee800bfeebb88ea829817
2022-08-11 08:37:10 +00:00
Jakob Meng
1bf22feb2d Fixed code violating Flake8 rule E275
assert [1] is a Python keyword hence Flake8 raised an error:
"E275 missing whitespace after keyword" [2].

[1] https://docs.python.org/3/reference/lexical_analysis.html#keywords
[2] https://www.flake8rules.com/rules/E275.html

Change-Id: I76bbe10b850c38a3fbb38c4a2f5ee17ca5b91b4e
2022-08-01 14:32:24 +02:00
Jakob Meng
c6c1c6a070 Applied workaround in CI for issue #78017 in ansible-core
Module ansible.builtin.user in ansible-core 2.13.0 and 2.13.1 is
affected by #78017 [1] which results in an exception being raised
in ci/roles/keypair/tasks/main.yml [2]. Until this issue is fixed,
we will exclude the broken versions 2.13.0 and 2.13.1 in
requirements.txt [3].

[1] https://github.com/ansible/ansible/issues/78017
[2] 802e46d554/ci/roles/keypair/tasks/main.yml (L72)
[3] https://opendev.org/openstack/ansible-collections-openstack/src/branch/master/tests/requirements.txt

Change-Id: I61bec4e62ecbcf357f3c1279a7373049077cb8d4
Signed-off-by: Jakob Meng <code@jakobmeng.de>
2022-06-26 13:07:34 +02:00
Jakob Meng
c7ae7a5f98 Updated pip constraints for release candidates of OpenStackSDK's first major release
A release candidate for the first major release of OpenStackSDK 1.x.x
has been published with version number 0.99.0. Release candidates will
be numbered using 0.99.x versions.

Ref.: https://meetings.opendev.org/irclogs/%23openstack-release/%23openstack-release.2022-05-19.log.html

Change-Id: I51a5b803f6646d3b1c5e198072cb3da19925fc3f
2022-05-23 14:07:41 +02:00
Jakob Meng
a03dd05465 Refactored tox requirements for different Ansible releases
Sorted pip requirements file to improve readability.

Moved pip requirements for tests into tests subdirectory and dropped
'pip-' prefix to shorten filenames and conform with common naming
scheme for pip requirements files.

Added constrains on OpenStack SDK 1.*.* to job ansible-collections-\
openstack-functional-devstack-releases on master branch because only
stable/1.0.0 branch is compatible to the OpenStack SDK 0.*.* series.

Changed job ansible-collections-openstack-functional-devstack-releases
on master branch to non-voting because OpenStack SDK 1.*.* has not
been released to PyPI yet, so tests on master branch are expected to
fail once we introduce breaking changes from stable/1.0.0 branch.

Change-Id: I6b6bb8c6900f7c8341bbf3f9a24999fbf693ba4b
2022-03-31 10:35:16 +00:00
Jakob Meng
749f04bcfb Added job variants for stable/1.0.0 branch to Zuul CI config
Releases of OpenStack SDK on PyPI will soon switch to the 1.*.* series
which our stable/1.0.0 branch is incompatible with. Previously, in
commit 0f532d10f3, several jobs have been changed to run on master
branch only.

This patch adds siblings jobs for our stable/1.0.0 branch which
pull the latest SDK releases of the 0.*.* series from PyPI instead.

Ref.: 0f532d10f3

Change-Id: Iefc6acfa4c25eb5d9ab062a3bfa655be2188cb77
2022-03-29 07:32:06 +00:00
Sagi Shnaidman
980536c32e Move CI to use Ansible 2.12 version as main
Move only from victoria, since Ansible 2.12 is installed with
py > 3.8.
Remove ussuri from voting jobs, use it for experimental only.
Change-Id: I74b7272794ea5fbafb7d81a5cf0068c09130bb0d
2021-10-04 15:05:51 +03:00
Sagi Shnaidman
17a1d72b1c Prepare for Ansible 2.11 tests
Change-Id: I3914db6e5c4f279f2aeae051fd6a1a4254f554c9
2021-04-08 00:19:24 +03:00
Sagi Shnaidman
c329f65b41 Fix issues with newest ansible-test 2.11
Change-Id: Ifdf253ca01b0e19b55867d8ead03eaceb5b2d73a
2021-04-07 14:47:00 +03:00
Zuul
7e20a8fc97 Merge "Migrating image_info module from AnsibleModule to OpenStackModule" 2021-02-16 00:43:51 +00:00
anbanerj
8d2391d873 Migrating image_info module from AnsibleModule to OpenStackModule
1. Added ImageInfoModule class
2. Added basic test to see if image_info reflects created image and deletion of image
3. Added deprecated_names
4. Added 'type'/'required' in argument_spec
5. Removed debug statements from test as we are checking already with image_info module

Change-Id: I6ab5fd5384392f9de0af01b1937a75de4f16d28d
2021-02-15 20:49:19 +00:00
Dmitry Tantsur
6d4d8d4b0c ironic: deprecate sub-options of driver_info
This structure does not reflect the actual ironic API and is mostly
meaningless nowadays. Just let people populate driver_info directly.

Change-Id: I04d168dc86e8c0115b7183b14499fe1812af7343
2021-01-09 16:31:47 +01:00
anbanerj
d5c403cded Migrating subnets_info from AnsibleModule to OpenStackModule
Updated module, added "deprecated_names", Removed "ansible-deprecated-no-collection-name" for subnets_info for ansible 2.10, 2.11

Change-Id: I5590976964543188518200f2b31a1603eb30f39b
2020-12-02 13:27:10 +01:00
frenzy_friday
d36ac1f125 Migrating networks_info from AnsibleModule to OpenStackModule
Migrated networks_info module to OpenStackModule and updated playbook to test the module in CI jobs. Added deprecated_names tyo module.
Removed "ansible-deprecated-no-collection-name" exception for networks_info for ansible 2.10 and 2.11. Reverted 'False' to 'false' and updated filters (case sensitive) to check for 'False' instead

Change-Id: I85e19f0db8b4ee549137249477d0b7f5d82e9865
2020-12-01 22:35:03 +00:00
Sagi Shnaidman
01c2499fb6 New CI jobs configuration
Change-Id: Ib6850184faf1bc0808502c098d610a5e2f41f47e
2020-06-23 12:27:04 +03:00
Sagi Shnaidman
c75ab0924a Fix ansible-devel sanity tests for deprecations
Change-Id: I02c3f2cb5a8bb4c891a8f0e36628925208251bf7
2020-06-11 12:55:43 +03:00
Sagi Shnaidman
f3610ad0e1 Redesign OpenstackModule class
don't inherit OpenstackModule class from AnsibleModule class to
prevent occasional overriding Ansible methods or vars and failing
module.

Change-Id: Ic34fff0c938eb87cc0d2c5e98fbafed64bf349f6
2020-06-04 13:49:48 +03:00
Sagi Shnaidman
7e4fbcf568 Fix ansible-tests for devel branch
Ignore for now deprecation warnings
(see https://github.com/ansible-collections/overview/issues/45#issuecomment-628262697)
Current there are bugs in ansible-test that prevent to run these
tests.

Change-Id: I9829bb23a45699e61d7b0af5ecc3e1a94bbbca85
2020-06-03 00:05:07 +03:00
Sagi Shnaidman
f0da22da7e Remove unnecessary requirements file
for reference:
https://github.com/ansible-collections/overview/issues/43
Change-Id: I0136b4d173cb7e1d45a2b4535d8772c68f8d5783
2020-05-25 14:43:18 +03:00
Sagi Shnaidman
bcdf749938 Improve ansible-test sanity for collection
Check only things we build into collection.
Ignore sanity files from full CI jobs.
Add queens to gate because it's voting.
Add files to ignoring when building collection.
Remove non-required lines from ignorign sanity files.

Change-Id: I0dde756efa133cf75b67d072af78a1f8307ce932
2020-05-13 13:31:29 +03:00
Monty Taylor
e47c4671c7 Rename all of the modules
This is separate from the previous patch - it's just the results
of running the script so we can review the two a little independently.
We should probably squash them.

Change-Id: I838f15cf4a32455a5be20033c8ddc27db6ca15c0
2020-05-12 10:20:50 -05:00
Monty Taylor
52905480b8 Remove all of the os_ prefixes
The 2.10 transition has a routing.yml file that points each
individual module from ansible/ansible to a new location. That means
we can put:

    os_server:
      redirect: openstack.cloud.server

into lib/ansible/config/routing.yml in ansible/ansible and have
the result be the end user's playbooks still working with the
old names while providing new names that are less ugly.

This adds a routing file to our collection repo, as well as the
script used to generate the new mapping.

Change-Id: Ia5d18282b14ad0d86a347343be8bb477ae47130a
2020-05-12 10:19:28 -05:00
Monty Taylor
6271268567 Run linters in a temp dir instead of an install
We can't run linters in an install because installs expand
symlinks to regular files so the ansible-test code that detects
symlinks can't work so it looks at docs for symlink aliases
as if they were real.

Change-Id: I0a5659a1f693261a21a5b29528f950b846205f2e
2020-05-12 09:04:54 +00:00
Abhijeet Kasurde
5576eea3ce Moved openstack inventory script from community.general
Moved Openstack inventory script from Ansible community.general to openstack collection.

Change-Id: I84f93888059ec09b182a03e751ade6810e133a29
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2020-04-13 15:22:18 +05:30
Mark Chappell
63e444a324 Ensure documented choices match spec
Change-Id: Ia40e846f970a05a894601a7a37af0231f136bab6
2020-03-16 14:15:04 +01:00
Mark Chappell
f52598dd90 Use dict rather than complex for os_quota return type.
Change-Id: Ib8275a88eefb46ace471ddd12fadb018b4adbf9b
2020-03-16 13:56:58 +01:00
Mark Chappell
f16eda89dd Ensure defaults match spec
Change-Id: Ie5c499d7e035a0e9c3ac32e5dc5d57151c1745ed
2020-03-16 13:56:58 +01:00
Mark Chappell
aeb0e78148 Clean up doc-required-mismatch
Change-Id: Ia1449c50295f6b3551f176edf9bd439ace65ec90
2020-03-16 13:56:58 +01:00
Mark Chappell
1849f8bd47 Add missing type information to docs
Change-Id: Iac23d54512b23f031460d1b7281ccb8d93e20cad
2020-03-16 13:56:58 +01:00
Mark Chappell
d39f3ae5b0 os_nova_host_aggregate: Fixup sanity test failures
Change-Id: I40cc48c8b04713a63ab8fd8c71b785a824cf3715
2020-03-13 16:49:20 +01:00
Monty Taylor
97eb24ac4d Deal with collection build modifying tree
ansible-galaxy collection build modifies the contents of the tree.
Let's not go in to why this is bad, but instead just deal with it.
The issue in question is that is removes the +x bit from files in
the tree, which means you can't run a build twice in a row locally.
Shrug. Just roll with the -x and update our usage to reflect it.

Change-Id: I0f82531e99a98d656b60079fd3e94d4e3a1dbb6b
2020-03-05 15:08:32 +00:00
Monty Taylor
96a5914eb6 Remove from __future__ lines
We only support python3

Change-Id: Ieb82eb3369c4ac73f3595dc84ca11e1f11766a79
2020-03-01 06:26:03 -06:00
Monty Taylor
9d29e8c847 Fix H236 and remove exclusion
We haven't needed this in a VERY long time.

Change-Id: I35041c2c6ae421e7caaef3c04ffca92e2ff10e35
2020-03-01 06:22:58 -06:00
Monty Taylor
86670bcec9 Fix F401 and remove exclusion
Change-Id: Id2dbff06925ed8326e4a214aabc19d4ada5db69c
2020-02-27 13:56:48 -06:00
Monty Taylor
92d7d7caeb Fix W504 and remove exclusion
This is a topic where there are two points of view. While neither
is fundamentally better than the other in reality, what's best is
to not have any arguments about it. The tox.ini comments about 503
and 504 that were in place make the argument that:

  - 503 is intended to be disabled and 504 enabled by default
  - Donald Knuth believes 504 is the right way

Since Donald Knuth is smarter than all of us, align with 504, match
the comments in the file and turn on enforcement to keep it that way.

Change-Id: I92d4d1e82935e30ae42a0e14e641cbe36fd6e811
2020-02-27 13:56:48 -06:00
Monty Taylor
2527faec28 Remove F403 and F405 exclusions
Importing from * is not a thing that should be done, as it masks
errors and makes code hard to understand. There are some copy-pasta
files that violate this. Mark them with noqa for now, because we don't
actually care about them.

Change-Id: I790f88c75ea546d83e347e42df0050ad36211936
2020-02-27 13:56:48 -06:00
Bram Verschueren
062d430f96 Cleanup unit test requirements
The unit test requirements were copied as part of the migration from the
Ansible repo. This removes requirements that are not used in the
OpenStack Ansible collections unit tests.

Change-Id: I8b8914ffa327b4914169e79625972d4c67e406cb
2020-02-20 11:57:27 +01:00
Zuul
78937f4d41 Merge "Add os_routers_info module" 2020-02-19 12:15:07 +00:00
Bram Verschueren
72944f1a3a Add os_routers_info module
Introduces a new os_routers_info module.

original github PR: https://github.com/ansible/ansible/pull/63731

Change-Id: I7fe56cfe862b2b8209675acf0f87fbad99e09546
2020-02-19 10:21:06 +01:00
Abhijeet Kasurde
fcab7a9963 os_ironic: Correct parameter name
since inception skip_update_of_masked_password is misspelled
as skip_update_of_driver_password in the documentation.

Change-Id: I439f672b82385b4e317f2442755a81ef9c7c6bda
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2020-02-17 15:05:00 +05:30