--- - block: - name: Create interfaces config files template: src: "ifcfg-{{ item.type | default('ethernet') }}.j2" dest: "/etc/sysconfig/network-scripts/ifcfg-{{ item.name }}" notify: - Up interface loop: "{{ network.network_scripts.iface }}" - name: Create routing table in rt_tables template: src: rt_tables.j2 dest: /etc/iproute2/rt_tables notify: - Up interface - name: Create routing rules for interfaces template: src: rule.j2 dest: "/etc/sysconfig/network-scripts/rule-{{ item.name }}" notify: - Up interface loop: "{{ network.network_scripts.iface }}" - name: Create routes for interfaces template: src: route.j2 dest: "/etc/sysconfig/network-scripts/route-{{ item.name }}" notify: - Up interface loop: "{{ network.network_scripts.iface }}" when: network.network_scripts is defined