Skip to content

Commit

Permalink
Create drop-in directories for .network config
Browse files Browse the repository at this point in the history
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
  • Loading branch information
sjpark0605 authored and facebook-github-bot committed Aug 28, 2024
1 parent f8ce24a commit cd2b445
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions cookbooks/fb_networkd/resources/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit cd2b445

Please sign in to comment.