ansible/roles/network/tasks/ifupdown.yml

23 lines
629 B
YAML
Raw Normal View History

2019-08-25 02:07:11 +00:00
---
# 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