infra/roles/prepare-config/tasks/generate_nodes.yml

15 lines
412 B
YAML
Raw Normal View History

2018-10-02 09:12:23 +03:00
---
- 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 }}"