Debian Codegraph @

ansible_collections/netapp_eseries/santricity/roles/nar_santricity_common/tasks/proxy.yml

raw symbols SCIP
1 - name: Add storage systems to SANtricity Web Services Proxy
2 na_santricity_proxy_systems:
3 api_url: "{{ item['key'] }}"
4 api_username: "{{ item['value']['proxy_username'] }}"
5 api_password: "{{ item['value']['proxy_password'] }}"
6 validate_certs: "{{ item['value']['proxy_validate_certs'] | default(omit) }}"
7 accept_certificate: "{{ item['value']['proxy_accept_certifications'] | default(omit) }}"
8 subnet_mask: "{{ item['value']['proxy_subnet'] }}"
9 password: "{{ item['value']['proxy_default_password'] | default(omit) }}"
10 tags: "{{ item['value']['proxy_default_system_tags'] | default(omit) }}"
11 systems: "{{ item['value']['proxy_systems'] }}"
12 connection: local
13 loop: "{{ lookup('dict', proxy_systems_info, wantlist=True) }}"
14 no_log: true
15 vars:
16 proxy_systems_info: |-
17 {#- Build a dictionary of all inventoried proxies keyed by their api url #}
18 {%- set systems = {} %}
19 {%- for array in ansible_play_hosts_all %}
20 {%- if hostvars[array]["current_eseries_api_is_proxy"] %}
21 {%- set array_info = {} %}
22 {%- if "eseries_system_serial" in hostvars[array] or "eseries_system_addresses" in hostvars[array] %}
23 {%- if array_info.update({
24 "ssid": hostvars[array]["current_eseries_ssid"] | default(omit),
25 "password": hostvars[array]["eseries_system_password"] | default(omit),
26 "serial": hostvars[array]["eseries_system_serial"] | default(omit),
27 "addresses": hostvars[array]["eseries_system_addresses"] | default(omit),
28 "tags": hostvars[array]["eseries_system_tags"] | default(omit)}) %}
29 {%- endif %}
30 {%- endif %}
31 {%- if "eseries_proxy_api_url" in hostvars[array] and "eseries_proxy_api_password" in hostvars[array] %}
32 {%- if hostvars[array]["eseries_proxy_api_url"] in systems %}
33 {%- if systems[hostvars[array]["eseries_proxy_api_url"]]["proxy_systems"].append(array_info) %}{%- endif %}
34 {%- else %}
35 {%- if systems.update({hostvars[array]["eseries_proxy_api_url"]: {
36 "proxy_username": hostvars[array]["eseries_proxy_api_username"] | default("admin"),
37 "proxy_password": hostvars[array]["eseries_proxy_api_password"] | default(omit),
38 "proxy_subnet": hostvars[array]["eseries_subnet"] | default(omit),
39 "proxy_systems": [array_info],
40 "proxy_validate_certs": hostvars[array]["eseries_validate_certs"] | default(omit),
41 "proxy_accept_certifications": hostvars[array]["eseries_proxy_accept_certifications"] | default(omit),
42 "proxy_default_system_tags": hostvars[array]["eseries_proxy_default_system_tags"] | default(omit),
43 "proxy_default_password": hostvars[array]["eseries_proxy_default_password"] | default(omit)}}) %}
44 {%- endif %}
45 {%- endif %}
46 {%- endif %}
47 {%- endif %}
48 {%- endfor %}
49 {{ systems }}