[PR #8887/0bc5f248 backport][stable-8] one_service: fix recreation (#8931)
one_service: fix recreation (#8887)
* Fix one_service unique creation
* Revert empty space
* Add CHANGELOG fragment
* Update CHANGELOG fragment
(cherry picked from commit 0bc5f24863
)
Co-authored-by: alexander <79072457+abakanovskii@users.noreply.github.com>
pull/8939/head
parent
1caee897b1
commit
18a8c6f350
|
@ -0,0 +1,2 @@
|
|||
bugfixes:
|
||||
- one_service - fix service creation after it was deleted with ``unique`` parameter (https://github.com/ansible-collections/community.general/issues/3137, https://github.com/ansible-collections/community.general/pull/8887).
|
|
@ -522,7 +522,7 @@ def create_service_and_operation(module, auth, template_id, service_name, owner_
|
|||
if unique:
|
||||
service = get_service_by_name(module, auth, service_name)
|
||||
|
||||
if not service:
|
||||
if not service or service["TEMPLATE"]["BODY"]["state"] == "DONE":
|
||||
if not module.check_mode:
|
||||
service = create_service(module, auth, template_id, service_name, custom_attrs, unique, wait, wait_timeout)
|
||||
changed = True
|
||||
|
@ -637,7 +637,6 @@ def get_service_id_by_name(module, auth, service_name):
|
|||
|
||||
|
||||
def get_connection_info(module):
|
||||
|
||||
url = module.params.get('api_url')
|
||||
username = module.params.get('api_username')
|
||||
password = module.params.get('api_password')
|
||||
|
|
Loading…
Reference in New Issue