Skip to content

Commit

Permalink
fb_network_scripts: add ability to configure system wide static defau…
Browse files Browse the repository at this point in the history
…lt gateway

Summary:

Add ability to configure system wide static default gateway
And remove incorrect comment

Differential Revision: D51118754

fbshipit-source-id: 15e533972e90282bb515a4634bf53f208c0bf2f4
  • Loading branch information
joshuamiller01 authored and facebook-github-bot committed Nov 9, 2023
1 parent dfcd3be commit 35fefd3
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
3 changes: 3 additions & 0 deletions cookbooks/fb_network_scripts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ Controls whether to manage packages for `network-scripts`; defaults to `true`.
Controls pause frame settings of the primary interface. Keys correspond to
parameters of `ethtool -a/-A`, values: `nil` (don't care), `true`, `false`.

#### `node['fb_network_scripts']['v6_default_gw']`
Sets IPV6_DEFAULTGW in /etc/sysconfig/network. Defaults to `nil`

### Interface Configs
This cookbook also provides interface configuration:

Expand Down
1 change: 1 addition & 0 deletions cookbooks/fb_network_scripts/attributes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
'enable_tun' => false,
'enable_bridge_filter' => false,
'linkdelay' => 0,
'v6_default_gw' => nil,

# Internal attributes, do not use
'_rerun_ifup_local' => false,
Expand Down
4 changes: 3 additions & 1 deletion cookbooks/fb_network_scripts/templates/default/network.erb
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
# This file is maintained by Chef. Do not edit, all changes will be
# overwritten. See fb_network_scripts/README.md

# Note that we don't set GATEWAY in here because ifup-local will do it
NETWORKING=yes
HOSTNAME=<%= node['fqdn'] %>
LINKDELAY=<%= node['fb_network_scripts']['linkdelay'] %>
NETWORKING_IPV6=yes
IFDOWN_ON_SHUTDOWN=no
<% if node['fb_network_scripts']['v6_default_gw'] %>
IPV6_DEFAULTGW="<%= node['fb_network_scripts']['v6_default_gw'] %>"
<% end %>

0 comments on commit 35fefd3

Please sign in to comment.