Commit c40c3fd6 authored by nanahira's avatar nanahira

use item.value

parent 058953a6
......@@ -96,17 +96,17 @@
- mci{{inventory_hostname_short}}
# 为了提高测试时候的性能,不改动wg的时候注释掉这段
- name: 'clean up null connections first'
include_tasks: 'protocols/{{item.protocol}}/configure.yaml'
include_tasks: 'protocols/{{item.value.protocol}}/configure.yaml'
vars:
conn: '{{item}}'
with_items: '{{ connections }}'
when: "not noUpdateLinks and item.protocol is defined and item.protocol == 'null' and not item.noUpdate"
conn: '{{item.value}}'
with_dict: '{{ connections }}'
when: "not noUpdateLinks and item.protocol is defined and item.protocol == 'null' and not item.value.noUpdate"
- name: 'loop through list from a variable'
include_tasks: 'protocols/{{item.protocol}}/configure.yaml'
include_tasks: 'protocols/{{item.value.protocol}}/configure.yaml'
vars:
conn: '{{item}}'
with_items: '{{ connections }}'
when: "not noUpdateLinks and item.protocol is defined and item.protocol != 'null' and not item.noUpdate"
conn: '{{item.value}}'
with_dict: '{{ connections }}'
when: "not noUpdateLinks and item.value.protocol is defined and item.value.protocol != 'null' and not item.value.noUpdate"
# end
- name: services conf
copy:
......
......@@ -14,9 +14,9 @@
- name: 'update oc things'
include_tasks: 'protocols/{{item.protocol}}/configure.yaml'
vars:
conn: '{{item}}'
with_items: '{{ connections }}'
when: "not noUpdateLinks and item.protocol == 'oc' and not item.noUpdate"
conn: '{{item.value}}'
with_dict: '{{ connections }}'
when: "not noUpdateLinks and item.value.protocol == 'oc' and not item.value.noUpdate"
- name: start services
docker_compose:
project_src: '{{ansible_user_dir}}/nextgen-network/services'
......
......@@ -423,7 +423,7 @@ class InventoryBuilder {
ocMetric: host.ocMetric || null,
ocpasswdLines: host.ocpasswdLines || [],
gateways: _.values(this.gateways[host.name]),
connections,
connections: _.keyBy(connections, 'name'),
lanInterfaces,
localSubnets,
masqInterfaces,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment