Browse Source

Iterate over list of values of PPC packages dict

Currently as we are iterating over a higher level dictionary
and it is not possible to access the item.value.url attribute
directly.

Alternatively, we could get the values that is a list and
then iterate over that list to get properly the url and
checksum variables.

Also, we are not iterating over the dictionary we alternatively change
the item.key to galera_server_percona_distro_packages_alt_arch.keys()[0]
that produces the result as item.key.

Change-Id: I3e102377630d9c8ea5c9e3ea03cae3975a05dbb8
Closes-Bug: #1815902
Guilherme Steinmüller 2 months ago
parent
commit
36d95a112d
1 changed files with 5 additions and 5 deletions
  1. 5
    5
      tasks/galera_install_download_extra_packages.yml

+ 5
- 5
tasks/galera_install_download_extra_packages.yml View File

@@ -22,12 +22,12 @@
22 22
 
23 23
 - name: Download extra packages
24 24
   get_url:
25
-    url: "{{ item.value.url }}"
26
-    dest: "{{ galera_server_extra_package_path }}/{{ item.key }}/"
27
-    checksum: "{{ item.value.checksum | default(omit) }}"
28
-    force: "{{ item.value.checksum is not defined }}"
25
+    url: "{{ item.url }}"
26
+    dest: "{{ galera_server_extra_package_path }}/{{ galera_server_percona_distro_packages_alt_arch.keys()[0] }}/"
27
+    checksum: "{{ item.checksum | default(omit) }}"
28
+    force: "{{ item.checksum is not defined }}"
29 29
     validate_certs: "{{ galera_server_extra_package_validate_certs }}"
30
-  with_dict: "{{ galera_server_percona_distro_packages_alt_arch }}"
30
+  with_items: "{{ galera_server_percona_distro_packages_alt_arch.values() | flatten | list }}"
31 31
   register: fetch_url
32 32
   until: fetch_url is success
33 33
   retries: 3

Loading…
Cancel
Save