Skip to content

Commit 1d90d82

Browse files
committed
feat: netplan apply
1 parent 3119a26 commit 1d90d82

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

ansible/files/netplan-apply.service

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
[Unit]
2+
Description=Apply netplan configuration at boot
3+
After=network-online.target
4+
Wants=network-online.target
5+
6+
[Service]
7+
Type=oneshot
8+
ExecStart=/usr/sbin/netplan apply
9+
RemainAfterExit=yes
10+
TimeoutSec=60
11+
12+
[Install]
13+
WantedBy=multi-user.target

ansible/tasks/setup-system.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,21 @@
112112
systemd: daemon_reload=yes
113113
when: debpkg_mode or nixpkg_mode
114114

115+
- name: Install netplan apply service
116+
copy:
117+
src: files/netplan-apply.service
118+
dest: /etc/systemd/system/netplan-apply.service
119+
owner: root
120+
group: root
121+
mode: 0644
122+
when: debpkg_mode or nixpkg_mode
123+
124+
- name: Enable netplan apply service
125+
systemd:
126+
name: netplan-apply.service
127+
enabled: yes
128+
when: debpkg_mode or nixpkg_mode
129+
115130
- name: Configure journald
116131
copy:
117132
src: files/journald.conf

0 commit comments

Comments
 (0)