Pushing most recent changes; will need to refactor
This commit is contained in:
parent
10a30d68d5
commit
5c8b308e78
@ -1,35 +1,20 @@
|
|||||||
---
|
---
|
||||||
#- name: Generate and associate VMID to VM
|
- name: Generate and associate VMID to VM (new method)
|
||||||
# set_fact :
|
|
||||||
# lab_nodes :
|
|
||||||
# "{{ lab_nodes | combine({ item.name: {'vmid': lab_vmid_base + idx_lab_nodes} }, recursive=True) }}"
|
|
||||||
# loop : "{{ lab_nodes }}"
|
|
||||||
# loop_control :
|
|
||||||
# label : "{{ item.name }}"
|
|
||||||
# index_var : idx_lab_nodes
|
|
||||||
|
|
||||||
|
|
||||||
#- name: Debug lab_nodes
|
|
||||||
# debug :
|
|
||||||
# var : lab_nodes
|
|
||||||
|
|
||||||
|
|
||||||
- name: Generate and associate VMID to VM
|
|
||||||
set_fact:
|
set_fact:
|
||||||
lab_nodes: "{{ lookup('template', 'generate_vmid_lookup.j2') }}"
|
lab_nodes: |
|
||||||
|
[
|
||||||
|
{% for lab_node in lab_nodes %}
|
||||||
#- name: Debug lab_nodes
|
{
|
||||||
# debug :
|
"name" : "{{ lab_node.name }}",
|
||||||
# var : lab_nodes
|
"vmid" : "{{ lab_vmid_base + (loop.index - 1) }}",
|
||||||
|
"vm_host" : "{{ lab_node.vm_host | default(__pve_node) }}",
|
||||||
|
"vm_template_id" : "{{ lab_node.vm_template_id | default(__vm_tmpl_id) }}",
|
||||||
#- name: Debug lab_nodes again
|
"group" : "{{ lab_node.group | default(__default_inventory_group) }}",
|
||||||
# debug :
|
"cores" : "{{ lab_node.cores | default(__lab_cores_default) }}",
|
||||||
# msg : "{{ item.name }} -> {{ item.vmid }}"
|
"mem" : {{ lab_node.mem | default(__lab_mem_default) }},
|
||||||
# loop: "{{ lab_nodes }}"
|
},
|
||||||
# loop_control:
|
{% endfor %}
|
||||||
# label: "{{ item.name }}"
|
]
|
||||||
|
|
||||||
|
|
||||||
...
|
...
|
||||||
|
Loading…
x
Reference in New Issue
Block a user