From cd2b4450388e138eef1789c5f8eeee6c7e83c31b Mon Sep 17 00:00:00 2001 From: Sejin Park Date: Wed, 28 Aug 2024 05:38:54 -0700 Subject: [PATCH] Create drop-in directories for .network config Summary: # Context # For classic hosts, chef creates a `.link.d` link drop-in directory. However, the logic for creating `.network.d` network drop-in directory is missing. # Changes # * Added logic to create `.network.d` network drop-in directory for `shard(0)` Differential Revision: D61904224 fbshipit-source-id: d78a06706730bd0a68e12767c1d46d5ef0e80f67 --- cookbooks/fb_networkd/resources/default.rb | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/cookbooks/fb_networkd/resources/default.rb b/cookbooks/fb_networkd/resources/default.rb index eb2e7f82..5ddebdfc 100644 --- a/cookbooks/fb_networkd/resources/default.rb +++ b/cookbooks/fb_networkd/resources/default.rb @@ -164,6 +164,17 @@ def validate_network_addresses(conf) notifies :run, "execute[networkctl reconfigure #{conf['name']}]" end + if node.in_shard?(0) + # Create dropin directory for network config file. + dropin_dir = conffile + '.d' + directory dropin_dir do + action :create + owner node.root_user + group node.root_group + mode '0755' + end + end + # This file is actively managed and already exists on the host so remove it # from the "on_host" array. if on_host_networks.include?(conffile)