Skip to content

Commit 85b6eaf

Browse files
committed
Fix mn_init iteration for empty/dict mnlist on newer Ansible
1 parent 7959fc6 commit 85b6eaf

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

ansible/roles/mn_init/tasks/main.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,12 @@
4141

4242
- name: Build masternode names list from mnlist
4343
ansible.builtin.set_fact:
44-
mn_names: "{{ mnlist | default({}) | dict2items | map(attribute='key') | list }}"
44+
mn_names: >-
45+
{{
46+
(mnlist | dict2items | map(attribute='key') | list)
47+
if (mnlist is mapping)
48+
else []
49+
}}
4550
4651
- name: Get list of info on owner addresses to be imported
4752
ansible.builtin.command:

0 commit comments

Comments
 (0)