ansible-collections-openstack/ci/roles
Jakob Meng ac401bb354 Refactored server and server_info modules
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
2022-07-28 21:56:30 +02:00
..
address_scope Add address scope module 2021-06-22 23:23:50 +02:00
auth/tasks Rename all of the modules 2020-05-12 10:20:50 -05:00
catalog_service/tasks Update catalog service for the new sdk 2022-06-08 13:25:14 -07:00
client_config/tasks Rename all of the modules 2020-05-12 10:20:50 -05:00
compute_flavor_info/tasks Changed compute_flavor_info module to use OpenStack SDK's proxy layer 2022-04-05 13:53:06 +02:00
dns Update recordset module to be compatible with OpenStack SDK 0.99.x/1.0.x 2022-05-31 09:43:53 +02:00
dns_zone_info/tasks Move dns zone info to use proxy layer 2022-04-26 10:04:47 +00:00
endpoint Added assertions on endpoint module results 2022-07-12 10:43:22 +02:00
floating_ip/tasks Refactored server and server_info modules 2022-07-28 21:56:30 +02:00
floating_ip_info/tasks Dropped deprecated return values in floating_ip_info and assert remaining fields 2022-04-06 07:58:41 +00:00
group Rename all of the modules 2020-05-12 10:20:50 -05:00
host_aggregate Update host_aggregate to be compatible with new sdk 2022-05-31 11:00:36 +02:00
identity_domain_info Refactored identity_domain_info 2022-05-09 09:57:43 +02:00
identity_group_info/tasks Update identity_group_info to new sdk 2022-05-11 06:50:33 +00:00
identity_role Update identity_role_info for latest openstacksdk release 2022-05-09 11:03:49 +02:00
identity_role_info/tasks Update identity_role_info for latest openstacksdk release 2022-05-09 11:03:49 +02:00
identity_user Use proxy layer in identity_user module 2022-05-05 09:21:39 -07:00
identity_user_info Use proxy layer in identity_user_info 2022-05-04 19:00:48 +00:00
image Update image for new sdk 2022-06-28 10:55:34 -07:00
image_info Moves image_info from cloud to proxy object 2022-05-09 19:09:08 +00:00
keypair Moves keypair_info from cloud to proxy object 2022-06-16 18:38:02 +02:00
keystone_domain Move identity domain to use proxy layer 2022-02-02 19:35:37 +02:00
keystone_federation_protocol Rename all of the modules 2020-05-12 10:20:50 -05:00
keystone_idp Rename all of the modules 2020-05-12 10:20:50 -05:00
keystone_mapping Rename all of the modules 2020-05-12 10:20:50 -05:00
loadbalancer Add Octavia job for testing Load Balancer 2021-02-20 17:57:20 +02:00
logging Add SDK logging option for openstack ansible collections. 2022-07-04 14:16:16 +00:00
network Change network modules to work with new SDK 2022-06-02 15:33:38 +02:00
neutron_rbac/tasks Add Neutron RBAC modules 2022-01-11 11:59:58 -05:00
nova_flavor/tasks Rename all of the modules 2020-05-12 10:20:50 -05:00
nova_services/tasks Fixed return values in compute_service_info module again 2022-05-02 20:49:39 +02:00
object/tasks Rename all of the modules 2020-05-12 10:20:50 -05:00
object_container Container module for management Swift containers 2021-04-08 18:46:53 +03:00
orchestration Fix assertion after stack deletion 2022-03-14 10:54:08 +01:00
port Add dns_[name,domain] to the port module 2022-01-25 22:51:38 +00:00
port_info/tasks Update port info 2022-07-20 06:46:33 +00:00
project Update project module to be compatible with new sdk 2022-07-12 13:12:08 +00:00
project_info/tasks Update project_info module to new sdk 2022-06-23 15:11:59 +02:00
recordset Correctly build params dict in recordset 2022-06-01 11:21:10 -07:00
role_assignment/tasks Update role_assignment to use proxy 2022-06-14 11:04:29 +02:00
router Update router for 2.0.0 2022-07-28 11:31:37 +02:00
security_group Makes security_group_info compatible with new openstacksdk 2022-07-05 15:52:48 +02:00
security_group_rule Split CI tests for security_group and security_group_rule modules 2022-07-05 12:22:35 +02:00
server Refactored server and server_info modules 2022-07-28 21:56:30 +02:00
subnet Update subnet module to be compatible with new sdk 2022-06-29 15:00:20 +02:00
subnet_pool Add subnet pool module 2022-03-31 20:05:06 +00:00
user_group/tasks Rename all of the modules 2020-05-12 10:20:50 -05:00
user_role Rename all of the modules 2020-05-12 10:20:50 -05:00
volume/tasks Switch Snapshot module to OpenStackModule 2021-05-21 13:47:50 +02:00