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
Allow to update server attributes such as its description.
Changed default value of server attribute 'security_groups' from
['default'] to [] because the latter is the default in
python-openstackclient [1] and the former behavior causes issues
with existing servers [2]: Previously, when no 'security_groups'
parameter was given, the server module would change existing
servers to use the default security group, dropping all other
security groups assigned to the server.
Our (undocumented) guideline when writing modules is to only
add or change what has been requested by the user and to stick to
defaults from openstacksdk and python-openstackclient whenever
possible. Since we have to break backward compatibility with the
next release anyway, we take this opportunity to clean up this odd
behavior. Now, when no security groups are given, then security
groups of an existing server will not be touched.
Closes story #2007893 [2].
Note, Nova will create a server in the default security group,
if the security_groups parameter is omitted.
Dropped 'openstack' field from server module's results. This
variable expanded to additional server information which might
be useful for Ansible inventories and was filled from
openstacksdk's get_openstack_vars() function [3]. Variables in
this function can make additional cloud queries to retrieve
additional data, so calling this function can be expensive [4].
Users can use *_info modules to retrieve this data on-demand.
Dropped 'availabity_zone' attribute from generic OpenStackModule
arguments and inserted it into server and volume modules because
it is relevant to those two modules only. This is completes what
was started years ago [5] and is possible now since we have
breaking changes anyway.
Switched attribute name 'userdata' with its alias 'user_data' to
match openstacksdk's attribute names which are used e.g. in module
results. The previous attribute name 'userdata' is now used as an
alias and 'user_data' is used as the attribute name to keep backward
compatibility.
Wait for server to get into 'ACTIVE' state when creating a server
and attribute 'wait' has been set to true.
Sorted argument specs and documentation of the server module and
marked attributes which are not updatable. Changed unstable bash
script example in server module documentation.
Renamed server's module attribute 'delete_fip' to 'delete_ips' to
match openstacksdk and clarify that it includes all floating ip
addresses of the server.
Renamed server_info's module attribute 'server' to 'name' and added
the former as an alias to be consistent with other *_info modules.
Added RETURN fields documentation for the module results of both
server and server_info modules.
Added description and examples of how to use the 'filters' attribute
of the server_info module. Closes story #2007873 [6].
Removed 'openstack_' prefix from module results because the prefix is
not consistently used across modules, is more to type without any
benefit and removal of the prefix allows us to signal to users that
their code for handling module results has to be updated. Many modules
have different return values with openstacksdk >= 0.99.0 because it
consistently uses resource proxies now.
Added assertions for module results to catch future changes in the
openstacksdk and our Ansible modules.
Added integration tests to check the update mechanism of the server
module.
Fixed indentation in integration tests.
Ensure proper creation and deletion of resources such as networks,
subnets and servers in integration tests of server_action module.
Renamed ci/roles/server/defaults/main.yaml to main.yml, removing the
'a' in the file extension to be consistent with other filenames.
Dropped deprecated function openstack_find_nova_addresses() and
incorporated its code directly into the server module because it
is not used anywhere else.
[1] e49ad1795b/openstackclient/compute/v2/server.py (L1070)
[2] https://storyboard.openstack.org/#!/story/2007893
[3] 9e9fc98795/openstack/cloud/_compute.py (L1772)
[4] 9e9fc98795/openstack/cloud/meta.py (L482)
[5] 9bf33e56dd
[6] https://storyboard.openstack.org/#!/story/2007873
Signed-off-by: Jakob Meng <code@jakobmeng.de>
Change-Id: I2f955519a7e8c782b1dab8f94f7a019ed384b81d
This reapplies commit 4bfa135b20caeb6d6c2717049059ac52fd08e0e1 [1]
which got reverted in commit 1b59c19a24c55aa236d80552dcbf70c9c7b5088e
[2] due to issues in how TripleO Quickstart installed the Ansible
OpenStack collection. TripleO Quickstart has now been fixed and
will install code from our stable/1.0.0 branch instead of master for
all RDO branches which have openstacksdk <0.99.0 [3][4].
[1] 4bfa135b20
[2] 1b59c19a24
[3] https://review.opendev.org/c/openstack/tripleo-ci/+/849500
[4] https://review.opendev.org/c/openstack/tripleo-quickstart/+/849620/
Change-Id: I918d776c1560f03a4a84df371feb013d47043aa0
This reverts commit 4bfa135b20caeb6d6c2717049059ac52fd08e0e1 [1] because
it broke TripleO [2] and possibly other users which were using code from
master branch with incompatible SDK releases. We will reapply this
safety check later once dust has settled.
Ref.:
[1] 4bfa135b20
[2] https://bugs.launchpad.net/tripleo/+bug/1975646
Change-Id: I637f1b7c1b792adf6d3d17a27ccb42179f56a83b
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 bumps the minimum required SDK versions to 0.99.0, 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 master branch with
a OpenStack SDK 0.x.x release.
Change-Id: I3974deabc516379745794806886352279dc4f4a7
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
Change I51105f11565c5ff33b04add36259c8703af11240 moved validate_certs default from None to False.
This causes checks to fail in openstack_cloud_from_module as validate_certs is never None anymore.
This patch changes reverts the default back to None, and reflects this in the documentation.
Task: 41776
Story: 2008600
Change-Id: Ic79510f863cf3a39c3f5c6d99f61d335f92f9388
Collections are new. openstacksdk as of now doesn't support python2.
We shouldn't pretend to support python2 either. If you're using
ansible new enough to use collections, you can use python3.
This release of openstacksdk only supports 3.6 and onwards, so
set that as our min.
Change-Id: I34d544ce48f25bffde8e6e0cf82cdf9a85e681c3