Skip to content

Commit 39f7ce2

Browse files
joshuamiller01meta-codesync[bot]
authored andcommitted
fb_systemd: add a knob to disable service restart for networkd
Reviewed By: dafyddcrosby Differential Revision: D91718540 fbshipit-source-id: 6859cbd1ba3ff379cbe07caea38368b96625b902
1 parent 5e92b96 commit 39f7ce2

File tree

3 files changed

+6
-0
lines changed

3 files changed

+6
-0
lines changed

cookbooks/fb_systemd/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ Attributes
2424
* node['fb_systemd']['logind']['enable']
2525
* node['fb_systemd']['logind']['config']
2626
* node['fb_systemd']['networkd']['enable']
27+
* node['fb_systemd']['networkd']['disable_restart']
2728
* node['fb_systemd']['networkd']['config']
2829
* node['fb_systemd']['nspawn']['enable']
2930
* node['fb_systemd']['resolved']['enable']
@@ -369,6 +370,9 @@ drop `netdev`, `link`, `network` definitions under `/etc/systemd/network` from
369370
another cookbook you'll want to request a restart of the `systemd-networkd`
370371
service.
371372

373+
You can choose to disable chef restarts of `systemd-networkd` with the
374+
`node['fb_systemd']['networkd']['disable_restart']` attribute, which defaults to `false`.
375+
372376
### resolved configuration
373377
You can choose whether or not to enable `systemd-resolved` with the
374378
`node['fb_systemd']['resolved']['enable']` attribute, which defaults to

cookbooks/fb_systemd/attributes/default.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@
114114
},
115115
'networkd' => {
116116
'enable' => enable_networkd,
117+
'disable_restart' => false,
117118
'use_networkd_socket_with_networkd' => false,
118119
'config' => {},
119120
},

cookbooks/fb_systemd/recipes/networkd.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@
8181

8282
service 'systemd-networkd.service' do
8383
only_if { node['fb_systemd']['networkd']['enable'] }
84+
not_if { node['fb_systemd']['networkd']['disable_restart'] }
8485
action [:enable, :start]
8586
end
8687

0 commit comments

Comments
 (0)