summaryrefslogtreecommitdiffstats
path: root/deploy/adapters/ansible/roles/setup-network/tasks
diff options
context:
space:
mode:
Diffstat (limited to 'deploy/adapters/ansible/roles/setup-network/tasks')
-rw-r--r--deploy/adapters/ansible/roles/setup-network/tasks/main.yml24
1 files changed, 12 insertions, 12 deletions
diff --git a/deploy/adapters/ansible/roles/setup-network/tasks/main.yml b/deploy/adapters/ansible/roles/setup-network/tasks/main.yml
index 94816044..8df1ac3a 100644
--- a/deploy/adapters/ansible/roles/setup-network/tasks/main.yml
+++ b/deploy/adapters/ansible/roles/setup-network/tasks/main.yml
@@ -15,24 +15,24 @@
when: 'item["type"] == "ovs"'
- name: setup sys intf
- shell: ip link del {{ item["name"] }}; \
- ip link add link {{ item["interface"] }} name {{ item["name"] }} type vlan id {{ item["vlan_tag"] }}; \
- ip link set {{ item["interface"] }} up
- when: '"vlan_tag" in item'
- with_items: "{{ network_cfg['sys_intf_mappings'] }}"
+ shell: ip link del {{ item.key }}; \
+ ip link add link {{ item.value["interface"] }} name {{ item.key }} type vlan id {{ item.value["vlan_tag"] }}; \
+ ip link set {{ item.value["interface"] }} up
+ when: '"vlan_tag" in item.value and item.value["type"] == "vlan"'
+ with_dict: "{{ sys_intf_mappings }}"
- name: set sys intf ip
- shell: ip addr del {{ item["ip"] }}/{{ item["netmask"] }} dev {{ item["alias"] }}; \
- ip addr add {{ item["ip"] }}/{{ item["netmask"] }} dev {{ item["alias"] }}; \
- ip link set {{ item["alias"] }} up
- with_items: "{{ host_ip_settings }}"
+ shell: ip addr del {{ item.value["ip"] }}/{{ item.value["netmask"] }} dev {{ item.value["alias"] }}; \
+ ip addr add {{ item.value["ip"] }}/{{ item.value["netmask"] }} dev {{ item.value["alias"] }}; \
+ ip link set {{ item.value["alias"] }} up
+ with_dict: "{{ host_ip_settings }}"
- name: set gateway
shell: ip route del default; \
- ip route add default via {{ item["gw"] }} dev {{ item["alias"] }}
- when: '"gw" in item'
- with_items: "{{ host_ip_settings }}"
+ ip route add default via {{ item.value["gw"] }} dev {{ item.key }}
+ when: '"gw" in item.value'
+ with_dict: "{{ host_ip_settings }}"
- name: copy net config
template: src=my_configs.debian dest=/etc/network/interfaces.d/my_configs.cfg