-
Notifications
You must be signed in to change notification settings - Fork 145
/
Copy pathmain.yml
47 lines (46 loc) · 2.49 KB
/
main.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
---
# Create EDA Controller Credential
- name: Add EDA Controller credential
ansible.eda.credential:
name: "{{ __credential_item.name }}"
new_name: "{{ __credential_item.new_name | default(omit) }}"
description: "{{ __credential_item.description | default(omit) }}"
organization_name: "{{ __credential_item.organization | default(omit) }}"
credential_type_name: "{{ __credential_item.credential_type | mandatory }}"
inputs: "{{ __credential_item.inputs | default(omit) }}"
state: "{{ __credential_item.state | default(eda_state | default('present')) }}"
controller_host: "{{ aap_hostname | default(omit, true) }}"
controller_username: "{{ aap_username | default(omit, true) }}"
controller_password: "{{ aap_password | default(omit, true) }}"
request_timeout: "{{ aap_request_timeout | default(omit, true) }}"
validate_certs: "{{ aap_validate_certs | default(omit) }}"
loop: "{{ eda_credentials }}"
loop_control:
loop_var: __credential_item
label: "{{ __operation.verb }} the credential {{ __credential_item.name }} to EDA"
pause: "{{ eda_configuration_credentials_async_delay }}"
no_log: "{{ eda_configuration_credentials_secure_logging }}"
async: 1000
poll: 0
register: __credentials_job_async
changed_when: not __credentials_job_async.changed
vars:
__operation: "{{ operation_translate[__credentials_job_async.state | default(platform_state) | default('present')] }}"
ansible_async_dir: "{{ aap_configuration_async_dir }}"
- name: Create credential | Wait for finish the credential creation
ansible.builtin.async_status:
jid: "{{ __credentials_job_async_result_item.ansible_job_id }}"
register: __credentials_job_async_result
until: __credentials_job_async_result.finished
retries: "{{ eda_configuration_credentials_async_retries }}"
delay: "{{ eda_configuration_credentials_async_delay }}"
loop: "{{ __credentials_job_async.results }}"
loop_control:
loop_var: __credentials_job_async_result_item
label: "{{ __operation.verb }} credential {{ __credentials_job_async_result_item.__credential_item.name }} | Wait for finish the credential {{ __operation.action }}"
when: __credentials_job_async_result_item.ansible_job_id is defined
no_log: "{{ eda_configuration_credentials_secure_logging }}"
vars:
__operation: "{{ operation_translate[__credentials_job_async_result_item.__controller_user_accounts_item.state | default(platform_state) | default('present')] }}"
ansible_async_dir: "{{ aap_configuration_async_dir }}"
...