Commit | Line | Data |
---|---|---|
c3c15dc7 KS |
1 | --- |
2 | - when: netplan_manage | |
3 | block: | |
4 | - name: Install netplan | |
5 | ansible.builtin.apt: | |
6 | name: netplan.io | |
7 | - name: Update netplan default.yaml | |
8 | ansible.builtin.copy: | |
9 | content: "{{netplan_content}}" | |
10 | dest: /etc/netplan/default.yaml | |
11 | owner: root | |
12 | group: root | |
0d8f931b | 13 | mode: '0600' |
c3c15dc7 | 14 | register: netplan_default_yaml |
719e10f6 KS |
15 | - name: Disable ifupdown on Debian |
16 | when: ansible_distribution == "Debian" | |
17 | block: | |
18 | - name: Disable ifupdown networking | |
19 | ansible.builtin.systemd: | |
20 | name: networking.service | |
21 | masked: true | |
22 | - name: Enable systemd-networkd | |
23 | ansible.builtin.systemd: | |
24 | name: systemd-networkd | |
25 | enabled: true | |
26 | state: started | |
c3c15dc7 KS |
27 | - name: Apply netplan |
28 | when: netplan_default_yaml.changed and netplan_apply | |
29 | ansible.builtin.command: | |
30 | argv: ['netplan', 'apply'] |