Use simpler file structure
This commit is contained in:
parent
8ea9414418
commit
e8cb486c8f
96 changed files with 1001 additions and 436 deletions
27
roles/common/tasks/network.yml
Normal file
27
roles/common/tasks/network.yml
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
- name: check old network configuration
|
||||
stat: path=/etc/network/interfaces
|
||||
register: old_config
|
||||
|
||||
- name: move old network configuration
|
||||
command: mv /etc/network/interfaces /etc/network/interfaces.save
|
||||
when: old_config.stat.exists
|
||||
|
||||
- name: copy network configuration
|
||||
template:
|
||||
src: "network.j2"
|
||||
dest: "/etc/systemd/network/50-default.network"
|
||||
owner: root
|
||||
group: root
|
||||
mode: "0644"
|
||||
notify: restart systemd-networkd
|
||||
|
||||
- name: copy dns configuration
|
||||
file:
|
||||
src: "/run/systemd/resolve/resolv.conf"
|
||||
dest: "/etc/resolv.conf"
|
||||
owner: root
|
||||
group: root
|
||||
state: link
|
||||
force: yes
|
||||
mode: "0644"
|
||||
notify: restart systemd-resolved
|
||||
Loading…
Add table
Add a link
Reference in a new issue