systemd-networkd/tasks/main.yml

31 lines
712 B
YAML
Raw Normal View History

2020-05-05 19:19:38 +03:00
---
2020-06-04 00:41:22 +03:00
- name: Check role vars
assert:
that:
- networkd_apply_action == "restart" or networkd_apply_action == "reload" or networkd_apply_action == "nothing"
fail_msg: 'networkd_apply_action shoud be "restart", "reload" or "nothing"'
quiet: yes
2020-05-05 19:19:38 +03:00
- import_tasks: deploy_configs.yml
- import_tasks: remove_unmanaged.yml
- name: networkd | Deploy resolv.conf
template:
src: resolv.conf.j2
dest: /etc/resolv.conf
2020-06-04 00:57:09 +03:00
mode: 0644
2020-05-05 19:19:38 +03:00
owner: root
group: root
2020-06-04 00:41:22 +03:00
when: networkd_resolv_conf_content is defined
2020-05-05 19:19:38 +03:00
- name: networkd | Enable and start service
systemd:
name: systemd-networkd
state: started
enabled: yes
- name: networkd | Run handlers now
meta: flush_handlers