infra/roles/prepare-config/tasks/generate_nodes.yml
Sergey Bubnov d990db6f83 cleanup
2018-11-02 00:18:51 +04:00

15 lines
412 B
YAML

---
- block:
- name: "generate {{st.nodes[item].count}} nodes for {{item}}"
set_fact:
node: "{{ dict({item+n: st.nodes[item]|gen_nics_addrs(n)}) }}"
with_sequence: "start=0 end={{st.nodes[item].count-1}}"
loop_control:
loop_var: n
register: res
- set_fact:
tmp_nodes: []
- set_fact:
gen_nodes: "{{ (res.results | map(attribute='ansible_facts.node') | list) + gen_nodes }}"