-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
LOAD_BALANCER: Move defines to separate namespaced files
- Loading branch information
1 parent
0aed680
commit c418076
Showing
5 changed files
with
49 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
define sunet::frontend::load_balancer::configure_peers($router_id, $peers) | ||
{ | ||
$defaults = { | ||
router_id => $router_id, | ||
} | ||
create_resources('sunet::frontend::load_balancer::peer', $peers, $defaults) | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
|
||
define sunet::frontend::load_balancer::configure_websites($websites, $basedir, $confdir) | ||
{ | ||
create_resources('sunet::frontend::load_balancer::website', $websites, { | ||
'basedir' => $basedir, | ||
'confdir' => $confdir, | ||
}) | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
|
||
define sunet::frontend::load_balancer::configure_websites2($websites, $basedir, $confdir, $scriptdir) | ||
{ | ||
each($websites) | $site, $config | { | ||
create_resources('sunet::frontend::load_balancer::website2', {$site => {}}, { | ||
'basedir' => $basedir, | ||
'confdir' => $confdir, | ||
'scriptdir' => $scriptdir, | ||
'config' => $config, | ||
}) | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
manifests/frontend/load_balancer/sysctl_ip_nonlocal_bind.pp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
|
||
define sunet::frontend::load_balancer::sysctl_ip_nonlocal_bind() { | ||
# Allow haproxy to bind() to a service IP address even if it haven't actually | ||
# been set up on an interface yet | ||
augeas { 'frontend_ip_nonlocal_bind_config': | ||
context => '/files/etc/sysctl.d/10-sunet-frontend-ip-non-local-bind.conf', | ||
changes => [ | ||
'set net.ipv4.ip_nonlocal_bind 1', | ||
'set net.ipv6.ip_nonlocal_bind 1', | ||
], | ||
notify => Exec['reload_sysctl_10-sunet-frontend-ip-non-local-bind.conf'], | ||
} | ||
|
||
exec { 'reload_sysctl_10-sunet-frontend-ip-non-local-bind.conf': | ||
command => '/sbin/sysctl -p /etc/sysctl.d/10-sunet-frontend-ip-non-local-bind.conf', | ||
refreshonly => true, | ||
} | ||
} |