Refactored stack module and use stack's tag(s) attribute
Dropped stack status checks for CREATE_COMPLETE and UPDATE_\ COMPLETE and instead pass wait=True to openstacksdk's create_stack() and update_stack() calls because those will call event_utils.\ poll_for_events() which garantees that stack has reached those states when they return [1],[2]. Check for duplicate keys in parameters which already have been defined by regular module attributes. Raise an error to warn users that they tried to overwrite parameters which they already specified with module attributes. Renamed stack's module attribute 'tag' to 'tags' to match both openstacksdk and OpenStack API and clarify that more than a single tag can be specified. Added 'tag' as an alias to keep backward compatibility. Actually pass the 'tags' aka 'tag' attribute to stack create and update functions of the openstacksdk which was lost in [3]. Added tags to integration tests. Sorted argument specs and documentation of the stack module and marked attributes which are not updatable. Dropped condition from self.conn.delete_stack() because the latter will only return False when a stack could not be found which we already. self.conn.delete_stack() will raise an exception when stack deletion fails. Renamed ci integration tests from 'orchestration' to 'stack' in order to match module name and adapted tags accordingly. Fixed and enabled ci integration tests for stack and stack_info modules. Dropped 'stack_name' from module return values in RETURN docstring and ci integration tests because openstacksdk not return this attribute. [1] https://opendev.org/openstack/openstacksdk/src/commit/9b1c4333526862d0edfc8e5f7bd421b0065b06db/openstack/cloud/_orchestration.py#L92 [2] https://opendev.org/openstack/openstacksdk/src/commit/9b1c4333526862d0edfc8e5f7bd421b0065b06db/openstack/cloud/_orchestration.py#L148 [3] https://opendev.org/openstack/ansible-collections-openstack/commit/af79857bfb9f391e43eaab0f0c94d8c2b7b74c86 Change-Id: I4ace6012112bbcce9094353e27eb4066cf25f229
Showing
- .zuul.yaml 1 addition, 1 deletion.zuul.yaml
- ci/roles/stack/defaults/main.yaml 0 additions, 1 deletionci/roles/stack/defaults/main.yaml
- ci/roles/stack/files/hello-world.yaml 0 additions, 0 deletionsci/roles/stack/files/hello-world.yaml
- ci/roles/stack/tasks/main.yaml 89 additions, 0 deletionsci/roles/stack/tasks/main.yaml
- ci/run-collection.yml 1 addition, 3 deletionsci/run-collection.yml
- plugins/modules/stack.py 75 additions, 71 deletionsplugins/modules/stack.py
Loading
Please register or sign in to comment