--- # ifupdown - name: manage ifupdown services service: name: "{{ _network_ifupdown_service_name }}" state: "{{ _network_ifupdown_enabled | ternary('started', 'stopped') }}" enabled: "{{ _network_ifupdown_enabled }}" - name: manage ifupdown package package: name: "{{ _network_ifupdown_package_name }}" state: "{{ _network_ifupdown_enabled | ternary('present', 'absent') }}" - name: manage /etc/network/interfaces template: src: network-interfaces.j2 dest: /etc/network/interfaces notify: restart ifupdown with_items: "{{ network_interfaces }}" when: _network_ifupdown_enabled | bool