diff --git a/roles/gateway_applications/tasks/main.yml b/roles/gateway_applications/tasks/main.yml index 97daa4ecd..a77c98158 100644 --- a/roles/gateway_applications/tasks/main.yml +++ b/roles/gateway_applications/tasks/main.yml @@ -34,6 +34,7 @@ register: __gateway_applications_job_async changed_when: not __gateway_applications_job_async.changed vars: + __operation: "{{ operation_translate[__gateway_application_item.state | default(platform_state) | default('present')] }}" ansible_async_dir: "{{ aap_configuration_async_dir | default(omit) }}" - name: Applications | Wait for finish the configuration @@ -50,5 +51,6 @@ when: __gateway_applications_job_async_results_item.ansible_job_id is defined no_log: "{{ applications_secure_logging }}" vars: + __operation: "{{ operation_translate[__gateway_applications_job_async_results_item.state | default(platform_state) | default('present')] }}" ansible_async_dir: "{{ aap_configuration_async_dir | default(omit) }}" ... diff --git a/roles/gateway_authenticator_maps/tasks/main.yml b/roles/gateway_authenticator_maps/tasks/main.yml index 519b19b41..50d882352 100644 --- a/roles/gateway_authenticator_maps/tasks/main.yml +++ b/roles/gateway_authenticator_maps/tasks/main.yml @@ -32,6 +32,7 @@ register: __gateway_authenticator_maps_job_async changed_when: not __gateway_authenticator_maps_job_async.changed vars: + __operation: "{{ operation_translate[__gateway_authenticator_maps_item.state | default(platform_state) | default('present')] }}" ansible_async_dir: "{{ aap_configuration_async_dir | default(omit) }}" - name: Authenticator Map | Wait for finish the configuration @@ -48,5 +49,6 @@ when: __gateway_authenticator_maps_job_async_results_item.ansible_job_id is defined no_log: "{{ gateway_authenticator_maps_secure_logging }}" vars: + __operation: "{{ operation_translate[__gateway_authenticator_maps_job_async_results_item.state | default(platform_state) | default('present')] }}" ansible_async_dir: "{{ aap_configuration_async_dir | default(omit) }}" ... diff --git a/roles/gateway_authenticators/tasks/main.yml b/roles/gateway_authenticators/tasks/main.yml index f15bbd9bb..f8f334212 100644 --- a/roles/gateway_authenticators/tasks/main.yml +++ b/roles/gateway_authenticators/tasks/main.yml @@ -30,6 +30,7 @@ register: __gateway_authenticators_job_async changed_when: not __gateway_authenticators_job_async.changed vars: + __operation: "{{ operation_translate[__gateway_authenticators_item.state | default(platform_state) | default('present')] }}" ansible_async_dir: "{{ aap_configuration_async_dir | default(omit) }}" - name: Authenticators | Wait for finish the configuration @@ -46,5 +47,6 @@ when: __gateway_authenticators_job_async_results_item.ansible_job_id is defined no_log: "{{gateway_authenticators_secure_logging }}" vars: + __operation: "{{ operation_translate[__gateway_authenticators_job_async_results_item.state | default(platform_state) | default('present')] }}" ansible_async_dir: "{{ aap_configuration_async_dir | default(omit) }}" ... diff --git a/roles/gateway_http_ports/tasks/main.yml b/roles/gateway_http_ports/tasks/main.yml index 4ba160fd6..dd089b1f2 100644 --- a/roles/gateway_http_ports/tasks/main.yml +++ b/roles/gateway_http_ports/tasks/main.yml @@ -26,6 +26,7 @@ register: __gateway_http_ports_job_async changed_when: not __gateway_http_ports_job_async.changed vars: + __operation: "{{ operation_translate[__gateway_http_ports_item.state | default(platform_state) | default('present')] }}" ansible_async_dir: "{{ aap_configuration_async_dir | default(omit) }}" - name: Http Ports | Wait for finish the configuration @@ -42,5 +43,6 @@ when: __gateway_http_ports_job_async_results_item.ansible_job_id is defined no_log: "{{ gateway_http_ports_secure_logging }}" vars: + __operation: "{{ operation_translate[__gateway_http_ports_job_async_results_item.state | default(platform_state) | default('present')] }}" ansible_async_dir: "{{ aap_configuration_async_dir | default(omit) }}" ... diff --git a/roles/gateway_organizations/tasks/main.yml b/roles/gateway_organizations/tasks/main.yml index 047ac3b83..36c1cdf63 100644 --- a/roles/gateway_organizations/tasks/main.yml +++ b/roles/gateway_organizations/tasks/main.yml @@ -24,6 +24,7 @@ register: __gateway_organizations_job_async changed_when: not __gateway_organizations_job_async.changed vars: + __operation: "{{ operation_translate[__gateway_organizations_item.state | default(platform_state) | default('present')] }}" ansible_async_dir: "{{ aap_configuration_async_dir | default(omit) }}" - name: Organizations | Wait for finish the configuration @@ -40,5 +41,6 @@ when: __gateway_organizations_job_async_results_item.ansible_job_id is defined no_log: "{{ gateway_organizations_secure_logging }}" vars: + __operation: "{{ operation_translate[__gateway_organizations_job_async_results_item.state | default(platform_state) | default('present')] }}" ansible_async_dir: "{{ aap_configuration_async_dir | default(omit) }}" ... diff --git a/roles/gateway_routes/tasks/main.yml b/roles/gateway_routes/tasks/main.yml index 61c59ea76..ad5dd19ca 100644 --- a/roles/gateway_routes/tasks/main.yml +++ b/roles/gateway_routes/tasks/main.yml @@ -32,6 +32,7 @@ register: __gateway_routes_job_async changed_when: not __gateway_routes_job_async.changed vars: + __operation: "{{ operation_translate[__gateway_routes_item.state | default(platform_state) | default('present')] }}" ansible_async_dir: "{{ aap_configuration_async_dir | default(omit) }}" - name: Routes | Wait for finish the configuration @@ -48,5 +49,6 @@ when: __gateway_routes_job_async_results_item.ansible_job_id is defined no_log: "{{ gateway_routes_secure_logging }}" vars: + __operation: "{{ operation_translate[__gateway_routes_job_async_results_item.state | default(platform_state) | default('present')] }}" ansible_async_dir: "{{ aap_configuration_async_dir | default(omit) }}" ... diff --git a/roles/gateway_service_clusters/tasks/main.yml b/roles/gateway_service_clusters/tasks/main.yml index 47b6accad..d584354e0 100644 --- a/roles/gateway_service_clusters/tasks/main.yml +++ b/roles/gateway_service_clusters/tasks/main.yml @@ -34,6 +34,7 @@ register: __gateway_service_clusters_job_async changed_when: not __gateway_service_clusters_job_async.changed vars: + __operation: "{{ operation_translate[__gateway_service_clusters_item.state | default(platform_state) | default('present')] }}" ansible_async_dir: "{{ aap_configuration_async_dir | default(omit) }}" - name: Service Clusters | Wait for finish the configuration @@ -50,5 +51,6 @@ when: __gateway_service_clusters_job_async_results_item.ansible_job_id is defined no_log: "{{ gateway_service_clusters_secure_logging }}" vars: + __operation: "{{ operation_translate[__gateway_service_clusters_job_async_results_item.state | default(platform_state) | default('present')] }}" ansible_async_dir: "{{ aap_configuration_async_dir | default(omit) }}" ... diff --git a/roles/gateway_service_keys/tasks/main.yml b/roles/gateway_service_keys/tasks/main.yml index 74f0c45a7..ab6b107b7 100644 --- a/roles/gateway_service_keys/tasks/main.yml +++ b/roles/gateway_service_keys/tasks/main.yml @@ -29,6 +29,7 @@ register: __gateway_service_keys_job_async changed_when: not __gateway_service_keys_job_async.changed vars: + __operation: "{{ operation_translate[__gateway_service_keys_item.state | default(platform_state) | default('present')] }}" ansible_async_dir: "{{ aap_configuration_async_dir | default(omit) }}" - name: Service Keys | Wait for finish the configuration @@ -45,5 +46,6 @@ when: __gateway_service_keys_job_async_results_item.ansible_job_id is defined no_log: "{{ gateway_gateway_service_keys_secure_logging }}" vars: + __operation: "{{ operation_translate[__gateway_service_keys_job_async_results_item.state | default(platform_state) | default('present')] }}" ansible_async_dir: "{{ aap_configuration_async_dir | default(omit) }}" ... diff --git a/roles/gateway_service_nodes/tasks/main.yml b/roles/gateway_service_nodes/tasks/main.yml index b9216651e..fa4ea99dd 100644 --- a/roles/gateway_service_nodes/tasks/main.yml +++ b/roles/gateway_service_nodes/tasks/main.yml @@ -26,6 +26,7 @@ register: __gateway_service_nodes_job_async changed_when: not __gateway_service_nodes_job_async.changed vars: + __operation: "{{ operation_translate[__gateway_service_nodes_item.state | default(platform_state) | default('present')] }}" ansible_async_dir: "{{ aap_configuration_async_dir | default(omit) }}" - name: Service Nodes | Wait for finish the configuration @@ -42,5 +43,6 @@ when: __gateway_service_nodes_job_async_results_item.ansible_job_id is defined no_log: "{{ service_nodes_secure_logging }}" vars: + __operation: "{{ operation_translate[__gateway_service_nodes_job_async_results_item.state | default(platform_state) | default('present')] }}" ansible_async_dir: "{{ aap_configuration_async_dir | default(omit) }}" ... diff --git a/roles/gateway_services/tasks/main.yml b/roles/gateway_services/tasks/main.yml index c41f2ae3c..bd54972aa 100644 --- a/roles/gateway_services/tasks/main.yml +++ b/roles/gateway_services/tasks/main.yml @@ -33,6 +33,7 @@ register: __gateway_services_job_async changed_when: not __gateway_services_job_async.changed vars: + __operation: "{{ operation_translate[__gateway_services_item.state | default(platform_state) | default('present')] }}" ansible_async_dir: "{{ aap_configuration_async_dir | default(omit) }}" - name: Services | Wait for finish the configuration @@ -49,5 +50,6 @@ when: __gateway_services_job_async_results_item.ansible_job_id is defined no_log: "{{ services_secure_logging }}" vars: + __operation: "{{ operation_translate[__gateway_services_job_async_results_item.state | default(platform_state) | default('present')] }}" ansible_async_dir: "{{ aap_configuration_async_dir | default(omit) }}" ... diff --git a/roles/gateway_teams/tasks/main.yml b/roles/gateway_teams/tasks/main.yml index 9bdf4d44a..22ee1c092 100644 --- a/roles/gateway_teams/tasks/main.yml +++ b/roles/gateway_teams/tasks/main.yml @@ -26,6 +26,7 @@ register: __gateway_teams_job_async changed_when: not __gateway_teams_job_async.changed vars: + __operation: "{{ operation_translate[__gateway_teams_item.state | default(platform_state) | default('present')] }}" ansible_async_dir: "{{ aap_configuration_async_dir | default(omit) }}" - name: Teams | Wait for finish the configuration @@ -42,5 +43,6 @@ when: __gateway_teams_job_async_results_item.ansible_job_id is defined no_log: "{{ platform_teams_secure_logging }}" vars: + __operation: "{{ operation_translate[__gateway_teams_job_async_results_item.state | default(platform_state) | default('present')] }}" ansible_async_dir: "{{ aap_configuration_async_dir | default(omit) }}" ... diff --git a/roles/gateway_users/tasks/main.yml b/roles/gateway_users/tasks/main.yml index 44adcae73..ee5d4b23b 100644 --- a/roles/gateway_users/tasks/main.yml +++ b/roles/gateway_users/tasks/main.yml @@ -32,6 +32,7 @@ register: __gateway_user_accounts_job_async changed_when: not __gateway_user_accounts_job_async.changed vars: + __operation: "{{ operation_translate[__gateway_user_accounts_item.state | default(platform_state) | default('present')] }}" ansible_async_dir: "{{ aap_configuration_async_dir | default(omit) }}" - name: Users | Wait for finish the configuration @@ -48,5 +49,6 @@ when: __gateway_user_accounts_job_async_results_item.ansible_job_id is defined no_log: "{{ users_secure_logging }}" vars: + __operation: "{{ operation_translate[__gateway_user_accounts_job_async_results_item.state | default(platform_state) | default('present')] }}" ansible_async_dir: "{{ aap_configuration_async_dir | default(omit) }}" ... diff --git a/roles/hub_collection/tasks/main.yml b/roles/hub_collection/tasks/main.yml index d73b42bcd..4b74f7951 100644 --- a/roles/hub_collection/tasks/main.yml +++ b/roles/hub_collection/tasks/main.yml @@ -16,17 +16,17 @@ - name: Update or destroy Automation Hub Collection ansible.hub.ah_collection: - namespace: "{{ __collection.namespace }}" - name: "{{ __collection.name }}" - version: "{{ __collection.version | default(omit) }}" - path: "{{ __collection.path | default(omit) }}" - repository: "{{ __collection.repository | default(omit) }}" - wait: "{{ __collection.wait | default(omit) }}" - auto_approve: "{{ __collection.auto_approve | default(omit) }}" - timeout: "{{ __collection.timeout | default(omit) }}" - interval: "{{ __collection.interval | default(omit) }}" - overwrite_existing: "{{ __collection.overwrite_existing | default(omit) }}" - state: "{{ __collection.state | default('present') }}" + namespace: "{{ __collections_item.namespace }}" + name: "{{ __collections_item.name }}" + version: "{{ __collections_item.version | default(omit) }}" + path: "{{ __collections_item.path | default(omit) }}" + repository: "{{ __collections_item.repository | default(omit) }}" + wait: "{{ __collections_item.wait | default(omit) }}" + auto_approve: "{{ __collections_item.auto_approve | default(omit) }}" + timeout: "{{ __collections_item.timeout | default(omit) }}" + interval: "{{ __collections_item.interval | default(omit) }}" + overwrite_existing: "{{ __collections_item.overwrite_existing | default(omit) }}" + state: "{{ __collections_item.state | default('present') }}" ah_host: "{{ aap_hostname | default(omit) }}" ah_username: "{{ aap_username | default(omit) }}" ah_password: "{{ aap_password | default(omit) }}" @@ -36,7 +36,7 @@ request_timeout: "{{ aap_request_timeout | default(omit) }}" loop: "{{ ah_collections }}" loop_control: - loop_var: "__collection" + loop_var: __collections_item label: "{{ __operation.verb }} the label {{ __ah_configuration_collection__item.name }} to Controller" pause: "{{ ah_configuration_collection__loop_delay }}" no_log: "{{ ah_configuration_collection_secure_logging }}" @@ -45,6 +45,7 @@ register: __collections_job_async changed_when: not __collections_job_async.changed vars: + __operation: "{{ operation_translate[__collections_item.state | default(platform_state) | default('present')] }}" ansible_async_dir: '{{ aap_configuration_async_dir }}' - name: Sleep for 10 seconds and continue with play @@ -61,9 +62,10 @@ loop: "{{ __collections_job_async.results }}" loop_control: loop_var: __collections_job_async_result_item - label: "{{ __operation.verb }} Label {{ __collections_job_async_result_item.__collection.name }} | Wait for finish the Label {{ __operation.action }}" + label: "{{ __operation.verb }} Label {{ __collections_job_async_result_item.__collections_item.name }} | Wait for finish the Label {{ __operation.action }}" when: __collections_job_async_result_item.ansible_job_id is defined no_log: "{{ ah_configuration_collection_secure_logging }}" vars: + __operation: "{{ operation_translate[__collections_job_async_result_item.state | default(platform_state) | default('present')] }}" ansible_async_dir: '{{ aap_configuration_async_dir }}' ... diff --git a/roles/hub_collection_repository/tasks/main.yml b/roles/hub_collection_repository/tasks/main.yml index 1a9c2282d..740f807bf 100644 --- a/roles/hub_collection_repository/tasks/main.yml +++ b/roles/hub_collection_repository/tasks/main.yml @@ -22,7 +22,7 @@ request_timeout: "{{ aap_request_timeout | default(omit) }}" loop: "{{ ah_collection_repositories }}" loop_control: - loop_var: "__collection_repository_item" + loop_var: __collection_repository_item label: "{{ __operation.verb }} the label {{ __ah_configuration_collection_repository__item.name }} to Controller" pause: "{{ ah_configuration_collection_repository__loop_delay }}" no_log: "{{ ah_configuration_collection_repository_secure_logging }}" @@ -31,6 +31,7 @@ register: __collection_repository_job_async changed_when: not __collection_repository_job_async.changed vars: + __operation: "{{ operation_translate[__collection_repository_item.state | default(platform_state) | default('present')] }}" ansible_async_dir: '{{ aap_configuration_async_dir }}' - name: "Create Repository | Wait for finish the repository creation" @@ -47,6 +48,7 @@ when: __collection_repository_job_async_result_item.ansible_job_id is defined no_log: "{{ ah_configuration_collection_repository_secure_logging }}" vars: + __operation: "{{ operation_translate[__collection_repository_job_async_result_item.state | default(platform_state) | default('present')] }}" ansible_async_dir: '{{ aap_configuration_async_dir }}' ... diff --git a/roles/hub_collection_repository_sync/tasks/main.yml b/roles/hub_collection_repository_sync/tasks/main.yml index 6d6bc3039..4667e5ea8 100644 --- a/roles/hub_collection_repository_sync/tasks/main.yml +++ b/roles/hub_collection_repository_sync/tasks/main.yml @@ -14,7 +14,7 @@ request_timeout: "{{ aap_request_timeout | default(omit) }}" loop: "{{ ah_collection_repositories }}" loop_control: - loop_var: "__collection_repository_sync_item" + loop_var: __collection_repository_sync_item label: "{{ __operation.verb }} the label {{ __ah_configuration_collection_repository_sync__item.name }} to Controller" pause: "{{ ah_configuration_collection_repository_sync__loop_delay }}" no_log: "{{ ah_configuration_collection_repository_sync_secure_logging }}" @@ -23,6 +23,7 @@ register: __collection_repository_sync_job_async changed_when: not __collection_repository_sync_job_async.changed vars: + __operation: "{{ operation_translate[__collection_repository_sync_item.state | default(platform_state) | default('present')] }}" ansible_async_dir: '{{ aap_configuration_async_dir }}' - name: "Sync Repository | Wait for finish the repository sync" @@ -39,6 +40,7 @@ when: __collection_repository_sync_job_async_result_item.ansible_job_id is defined no_log: "{{ ah_configuration_collection_repository_sync_secure_logging }}" vars: + __operation: "{{ operation_translate[__collection_repository_sync_job_async_result_item.state | default(platform_state) | default('present')] }}" ansible_async_dir: '{{ aap_configuration_async_dir }}' ... diff --git a/roles/hub_ee_image/tasks/main.yml b/roles/hub_ee_image/tasks/main.yml index 7b246eba9..1236952bc 100644 --- a/roles/hub_ee_image/tasks/main.yml +++ b/roles/hub_ee_image/tasks/main.yml @@ -16,7 +16,7 @@ request_timeout: "{{ aap_request_timeout | default(omit) }}" loop: "{{ ah_ee_images }}" loop_control: - loop_var: "__ee_image_item" + loop_var: __ee_image_item label: "{{ __operation.verb }} the label {{ __ah_configuration_ee_image__item.name }} to Controller" pause: "{{ ah_configuration_ee_image__loop_delay }}" no_log: "{{ ah_configuration_ee_image_secure_logging }}" @@ -25,6 +25,7 @@ register: __ee_images_job_async changed_when: not __ee_images_job_async.changed vars: + __operation: "{{ operation_translate[__ee_image_item.state | default(platform_state) | default('present')] }}" ansible_async_dir: '{{ aap_configuration_async_dir }}' - name: "Create EE Image | Wait for finish the ee_image creation" @@ -41,5 +42,6 @@ when: __ee_images_job_async_result_item.ansible_job_id is defined no_log: "{{ ah_configuration_ee_image_secure_logging }}" vars: + __operation: "{{ operation_translate[__ee_images_job_async_result_item.state | default(platform_state) | default('present')] }}" ansible_async_dir: '{{ aap_configuration_async_dir }}' ... diff --git a/roles/hub_ee_registry/tasks/main.yml b/roles/hub_ee_registry/tasks/main.yml index ff3a03f96..3f7d58fd7 100644 --- a/roles/hub_ee_registry/tasks/main.yml +++ b/roles/hub_ee_registry/tasks/main.yml @@ -22,7 +22,7 @@ proxy_password: "{{ __ee_registry_item.proxy_password | default(proxy_password | default(omit)) }}" loop: "{{ ah_ee_registries }}" loop_control: - loop_var: "__ee_registry_item" + loop_var: __ee_registry_item label: "{{ __operation.verb }} the label {{ __ah_configuration_ee_registry__item.name }} to Controller" pause: "{{ ah_configuration_ee_registry__loop_delay }}" no_log: "{{ ah_configuration_ee_registry_secure_logging }}" @@ -31,6 +31,7 @@ register: __ee_registries_job_async changed_when: not __ee_registries_job_async.changed vars: + __operation: "{{ operation_translate[__ee_registry_item.state | default(platform_state) | default('present')] }}" ansible_async_dir: '{{ aap_configuration_async_dir }}' - name: "Create EE Registry | Wait for finish the ee_registry creation" @@ -47,5 +48,6 @@ when: __ee_registries_job_async_result_item.ansible_job_id is defined no_log: "{{ ah_configuration_ee_registry_secure_logging }}" vars: + __operation: "{{ operation_translate[__ee_registries_job_async_result_item.state | default(platform_state) | default('present')] }}" ansible_async_dir: '{{ aap_configuration_async_dir }}' ... diff --git a/roles/hub_ee_registry_index/tasks/main.yml b/roles/hub_ee_registry_index/tasks/main.yml index ceb1b9782..df344bace 100644 --- a/roles/hub_ee_registry_index/tasks/main.yml +++ b/roles/hub_ee_registry_index/tasks/main.yml @@ -15,7 +15,7 @@ request_timeout: "{{ aap_request_timeout | default(omit) }}" loop: "{{ ah_ee_registries }}" loop_control: - loop_var: "__ee_registry_item" + loop_var: __ee_registry_item label: "{{ __operation.verb }} the label {{ __ah_configuration_ee_registry_index__item.name }} to Controller" pause: "{{ ah_configuration_ee_registry_index__loop_delay }}" when: __ee_registry_item.index | default(false) @@ -25,6 +25,7 @@ register: __ee_registry_indexes_job_async changed_when: not __ee_registry_indexes_job_async.changed vars: + __operation: "{{ operation_translate[__ee_registry_item.state | default(platform_state) | default('present')] }}" ansible_async_dir: '{{ aap_configuration_async_dir }}' - name: "Index EE Registry | Wait for finish the ee_registry_index creation" @@ -41,5 +42,6 @@ when: __ee_registry_indexes_job_async_result_item.ansible_job_id is defined no_log: "{{ ah_configuration_ee_registry_secure_logging }}" vars: + __operation: "{{ operation_translate[__ee_registry_indexes_job_async_result_item.state | default(platform_state) | default('present')] }}" ansible_async_dir: '{{ aap_configuration_async_dir }}' ... diff --git a/roles/hub_ee_registry_sync/tasks/main.yml b/roles/hub_ee_registry_sync/tasks/main.yml index afcec921d..c8ede8a4f 100644 --- a/roles/hub_ee_registry_sync/tasks/main.yml +++ b/roles/hub_ee_registry_sync/tasks/main.yml @@ -25,6 +25,7 @@ register: __ee_registry_syncs_job_async changed_when: not __ee_registry_syncs_job_async.changed vars: + __operation: "{{ operation_translate[__ee_registry_syncs_job_async.state | default(platform_state) | default('present')] }}" ansible_async_dir: '{{ aap_configuration_async_dir }}' - name: "EE Registry Sync | Wait for finish the ee_registry_sync to complete" @@ -41,5 +42,6 @@ when: __ee_registry_syncs_job_async_result_item.ansible_job_id is defined no_log: "{{ ah_configuration_ee_registry_secure_logging }}" vars: + __operation: "{{ operation_translate[__ee_registry_syncs_job_async_result_item.state | default(platform_state) | default('present')] }}" ansible_async_dir: '{{ aap_configuration_async_dir }}' ... diff --git a/roles/hub_ee_repository/tasks/main.yml b/roles/hub_ee_repository/tasks/main.yml index 0c4b84a48..86f835c26 100644 --- a/roles/hub_ee_repository/tasks/main.yml +++ b/roles/hub_ee_repository/tasks/main.yml @@ -20,7 +20,7 @@ request_timeout: "{{ aap_request_timeout | default(omit) }}" loop: "{{ ah_ee_repositories }}" loop_control: - loop_var: "__ee_repository_item" + loop_var: __ee_repository_item label: "{{ __operation.verb }} the label {{ __ah_configuration_ee_registry_sync__item.name }} to Controller" pause: "{{ ah_configuration_ee_registry_sync__loop_delay }}" no_log: "{{ ah_configuration_ee_repository_secure_logging }}" @@ -29,6 +29,7 @@ register: __ee_repositories_job_async changed_when: not __ee_repositories_job_async.changed vars: + __operation: "{{ operation_translate[__ee_repository_item.state | default(platform_state) | default('present')] }}" ansible_async_dir: '{{ aap_configuration_async_dir }}' - name: "Create EE Repository | Wait for finish the ee_repository creation" @@ -45,5 +46,6 @@ when: __ee_repositories_job_async_result_item.ansible_job_id is defined no_log: "{{ ah_configuration_ee_repository_secure_logging }}" vars: + __operation: "{{ operation_translate[__ee_repositories_job_async_result_item.state | default(platform_state) | default('present')] }}" ansible_async_dir: '{{ aap_configuration_async_dir }}' ... diff --git a/roles/hub_ee_repository_sync/tasks/main.yml b/roles/hub_ee_repository_sync/tasks/main.yml index 983fd21cc..293bf7d52 100644 --- a/roles/hub_ee_repository_sync/tasks/main.yml +++ b/roles/hub_ee_repository_sync/tasks/main.yml @@ -15,7 +15,7 @@ request_timeout: "{{ aap_request_timeout | default(omit) }}" loop: "{{ ah_ee_repositories }}" loop_control: - loop_var: "__ee_repository_item" + loop_var: __ee_repository_item label: "{{ __operation.verb }} the label {{ __ah_configuration_ee_repository_sync__item.name }} to Controller" pause: "{{ ah_configuration_ee_repository_sync__loop_delay }}" when: __ee_repository_item.sync | default(false) @@ -25,6 +25,7 @@ register: __ee_repository_syncs_job_async changed_when: not __ee_repository_syncs_job_async.changed vars: + __operation: "{{ operation_translate[__ee_repository_item.state | default(platform_state) | default('present')] }}" ansible_async_dir: '{{ aap_configuration_async_dir }}' - name: "EE Repository Sync | Wait for finish the ee_repository_sync to finish" @@ -41,5 +42,6 @@ when: __ee_repository_syncs_job_async_result_item.ansible_job_id is defined no_log: "{{ ah_configuration_ee_repository_secure_logging }}" vars: + __operation: "{{ operation_translate[__ee_repository_syncs_job_async_result_item.state | default(platform_state) | default('present')] }}" ansible_async_dir: '{{ aap_configuration_async_dir }}' ... diff --git a/roles/hub_group/tasks/main.yml b/roles/hub_group/tasks/main.yml index 3023a32c3..da5af08c3 100644 --- a/roles/hub_group/tasks/main.yml +++ b/roles/hub_group/tasks/main.yml @@ -3,9 +3,9 @@ # Create AH Group - name: Add Automation Hub group ansible.hub.ah_group: - name: "{{ __group.name | default(omit) }}" + name: "{{ __group_item.name | default(omit) }}" # new_name: "{{ __group.new_name | default(omit) }}" <-- Needs adding once new_name option added to module - state: "{{ __group.state | default(ah_state | default('present')) }}" + state: "{{ __group_item.state | default(ah_state | default('present')) }}" ah_host: "{{ aap_hostname | default(omit) }}" ah_username: "{{ aap_username | default(omit) }}" ah_password: "{{ aap_password | default(omit) }}" @@ -14,7 +14,7 @@ request_timeout: "{{ aap_request_timeout | default(omit) }}" loop: "{{ aap_teams }}" loop_control: - loop_var: "__group" + loop_var: __group_item label: "{{ __operation.verb }} the label {{ __ah_configuration_group__item.name }} to Controller" pause: "{{ ah_configuration_group__loop_delay }}" no_log: "{{ ah_configuration_group_secure_logging }}" @@ -23,6 +23,7 @@ register: __groups_job_async changed_when: not __groups_job_async.changed vars: + __operation: "{{ operation_translate[__group_item.state | default(platform_state) | default('present')] }}" ansible_async_dir: '{{ aap_configuration_async_dir }}' - name: "Create Group | Wait for finish the group creation" @@ -39,5 +40,6 @@ when: __groups_job_async_result_item.ansible_job_id is defined no_log: "{{ ah_configuration_group_secure_logging }}" vars: + __operation: "{{ operation_translate[__groups_job_async_result_item.state | default(platform_state) | default('present')] }}" ansible_async_dir: '{{ aap_configuration_async_dir }}' ... diff --git a/roles/hub_group_roles/tasks/main.yml b/roles/hub_group_roles/tasks/main.yml index 7164d9f0e..b0f2cb49a 100644 --- a/roles/hub_group_roles/tasks/main.yml +++ b/roles/hub_group_roles/tasks/main.yml @@ -2,9 +2,9 @@ # Add Group Roles - name: Add Roles to Groups in Automation Hubs ansible.hub.group_roles: - groups: "{{ __group_role.groups | default(omit) }}" - role_list: "{{ __group_role.role_list | default(omit) }}" - state: "{{ __group_role.state | default(ah_state | default('present')) }}" + groups: "{{ __group_roles_item.groups | default(omit) }}" + role_list: "{{ __group_roles_item.role_list | default(omit) }}" + state: "{{ __group_roles_item.state | default(ah_state | default('present')) }}" ah_host: "{{ aap_hostname | default(omit) }}" ah_username: "{{ aap_username | default(omit) }}" ah_password: "{{ aap_password | default(omit) }}" @@ -13,7 +13,7 @@ request_timeout: "{{ aap_request_timeout | default(omit) }}" loop: "{{ ah_group_roles }}" loop_control: - loop_var: "__group_role" + loop_var: __group_roles_item label: "{{ __operation.verb }} the label {{ __ah_configuration_group_roles__item.name }} to Controller" pause: "{{ ah_configuration_group_roles__loop_delay }}" no_log: "{{ ah_configuration_group_roles_secure_logging }}" @@ -22,6 +22,7 @@ register: __group_roles_job_async changed_when: not __group_roles_job_async.changed vars: + __operation: "{{ operation_translate[__group_roles_item.state | default(platform_state) | default('present')] }}" ansible_async_dir: '{{ aap_configuration_async_dir }}' - name: "Add Roles to Groups | Wait for finish the group creation" @@ -38,5 +39,6 @@ when: __group_roles_job_async_result_item.ansible_job_id is defined no_log: "{{ ah_configuration_group_roles_secure_logging }}" vars: + __operation: "{{ operation_translate[__group_roles_job_async_result_item.state | default(platform_state) | default('present')] }}" ansible_async_dir: '{{ aap_configuration_async_dir }}' ... diff --git a/roles/hub_namespace/tasks/main.yml b/roles/hub_namespace/tasks/main.yml index 5ba348c90..cbe06949d 100644 --- a/roles/hub_namespace/tasks/main.yml +++ b/roles/hub_namespace/tasks/main.yml @@ -34,7 +34,7 @@ request_timeout: "{{ aap_request_timeout | default(omit) }}" loop: "{{ ah_namespaces }}" loop_control: - loop_var: "__namespace_item" + loop_var: __namespace_item label: "{{ __operation.verb }} the label {{ __ah_configuration_namespace__item.name }} to Controller" pause: "{{ ah_configuration_namespace__loop_delay }}" no_log: "{{ ah_configuration_namespace_secure_logging }}" @@ -43,6 +43,7 @@ register: __namespaces_job_async changed_when: not __namespaces_job_async.changed vars: + __operation: "{{ operation_translate[__namespace_item.state | default(platform_state) | default('present')] }}" ansible_async_dir: '{{ aap_configuration_async_dir }}' - name: "Create Namespace | Wait for finish the namespace creation" @@ -59,5 +60,6 @@ when: __namespaces_job_async_result_item.ansible_job_id is defined no_log: "{{ ah_configuration_namespace_secure_logging }}" vars: + __operation: "{{ operation_translate[__namespaces_job_async_result_item.state | default(platform_state) | default('present')] }}" ansible_async_dir: '{{ aap_configuration_async_dir }}' ... diff --git a/roles/hub_role/tasks/main.yml b/roles/hub_role/tasks/main.yml index 9fa741b37..8d5a91d92 100644 --- a/roles/hub_role/tasks/main.yml +++ b/roles/hub_role/tasks/main.yml @@ -3,10 +3,10 @@ # Create AH Role - name: Add Automation Hub role ansible.hub.ah_role: - name: "{{ __role.name }}" - description: "{{ __role.description | default(omit) }}" - perms: "{{ __role.perms | default(omit) }}" - state: "{{ __role.state | default(ah_state | default('present')) }}" + name: "{{ __role_item.name }}" + description: "{{ __role_item.description | default(omit) }}" + perms: "{{ __role_item.perms | default(omit) }}" + state: "{{ __role_item.state | default(ah_state | default('present')) }}" ah_host: "{{ aap_hostname | default(omit) }}" ah_username: "{{ aap_username | default(omit) }}" ah_password: "{{ aap_password | default(omit) }}" @@ -15,7 +15,7 @@ request_timeout: "{{ aap_request_timeout | default(omit) }}" loop: "{{ ah_roles }}" loop_control: - loop_var: "__role" + loop_var: __role_item label: "{{ __operation.verb }} the label {{ __ah_configuration_role__item.name }} to Controller" pause: "{{ ah_configuration_role__loop_delay }}" no_log: "{{ ah_configuration_role_secure_logging }}" @@ -24,6 +24,7 @@ register: __roles_job_async changed_when: not __roles_job_async.changed vars: + __operation: "{{ operation_translate[__role_item.state | default(platform_state) | default('present')] }}" ansible_async_dir: '{{ aap_configuration_async_dir }}' - name: "Create Role | Wait for finish the role creation" @@ -36,9 +37,10 @@ loop: "{{ __roles_job_async.results }}" loop_control: loop_var: __roles_job_async_result_item - label: "{{ __operation.verb }} Label {{ __roles_job_async_result_item.__role.name }} | Wait for finish the Label {{ __operation.action }}" + label: "{{ __operation.verb }} Label {{ __roles_job_async_result_item.__role_item.name }} | Wait for finish the Label {{ __operation.action }}" when: __roles_job_async_result_item.ansible_job_id is defined no_log: "{{ ah_configuration_role_secure_logging }}" vars: + __operation: "{{ operation_translate[__roles_job_async_result_item.state | default(platform_state) | default('present')] }}" ansible_async_dir: '{{ aap_configuration_async_dir }}' ... diff --git a/roles/hub_user/tasks/main.yml b/roles/hub_user/tasks/main.yml index ff55b6249..d503ed0f1 100644 --- a/roles/hub_user/tasks/main.yml +++ b/roles/hub_user/tasks/main.yml @@ -3,16 +3,16 @@ # Create AH Users - name: Add Automation Hub User ansible.hub.ah_user: - username: "{{ __user.username | default(omit) }}" + username: "{{ __user_item.username | default(omit) }}" # new_name: "{{ __user.new_name | default(omit) }}" <-- Needs adding once new_name option added to module - groups: "{{ __user.groups | default(omit) }}" - append: "{{ __user.append | default(omit) }}" - first_name: "{{ __user.first_name | default(omit) }}" - last_name: "{{ __user.last_name | default(omit) }}" - email: "{{ __user.email | default(omit) }}" - is_superuser: "{{ __user.is_superuser | default(omit) }}" - password: "{{ __user.password | default(omit) }}" - state: "{{ __user.state | default(ah_state | default('present')) }}" + groups: "{{ __user_item.groups | default(omit) }}" + append: "{{ __user_item.append | default(omit) }}" + first_name: "{{ __user_item.first_name | default(omit) }}" + last_name: "{{ __user_item.last_name | default(omit) }}" + email: "{{ __user_item.email | default(omit) }}" + is_superuser: "{{ __user_item.is_superuser | default(omit) }}" + password: "{{ __user_item.password | default(omit) }}" + state: "{{ __user_item.state | default(ah_state | default('present')) }}" ah_host: "{{ aap_hostname | default(omit) }}" ah_username: "{{ aap_username | default(omit) }}" ah_password: "{{ aap_password | default(omit) }}" @@ -21,8 +21,8 @@ request_timeout: "{{ aap_request_timeout | default(omit) }}" loop: "{{ aap_user_accounts }}" loop_control: - loop_var: "__user" - label: "{{ __operation.verb }} the label {{ __user.name }} to Controller" + loop_var: __user_item + label: "{{ __operation.verb }} the label {{ __user_item.name }} to Controller" pause: "{{ ah_configuration_user_accounts__loop_delay }}" no_log: "{{ ah_configuration_user_secure_logging }}" async: "{{ ah_configuration_user_async_timeout }}" @@ -30,6 +30,7 @@ register: __users_job_async changed_when: not __users_job_async.changed vars: + __operation: "{{ operation_translate[__user_item.state | default(platform_state) | default('present')] }}" ansible_async_dir: '{{ aap_configuration_async_dir }}' - name: "Create User | Wait for finish the user creation" @@ -42,9 +43,10 @@ loop: "{{ __users_job_async.results }}" loop_control: loop_var: __users_job_async_result_item - label: "{{ __operation.verb }} Label {{ __users_job_async_result_item.__user.name }} | Wait for finish the Label {{ __operation.action }}" + label: "{{ __operation.verb }} Label {{ __users_job_async_result_item.__user_item.name }} | Wait for finish the Label {{ __operation.action }}" when: __users_job_async_result_item.ansible_job_id is defined no_log: "{{ ah_configuration_user_secure_logging }}" vars: + __operation: "{{ operation_translate[__users_job_async_result_item.state | default(platform_state) | default('present')] }}" ansible_async_dir: '{{ aap_configuration_async_dir }}' ...