Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Files
F9123395
network.pp
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Subscribers
None
network.pp
View Options
# Network configuration for Software Heritage servers
#
# Supports one private and one public interface
class
profile
::
network
{
debnet
::
iface
::
loopback
{
'lo'
:
}
$interfaces
=
lookup
(
'networks'
)
each
(
$interfaces)
|
$label,
$data|
{
if
$label
==
'private'
{
file_line
{
'private route table'
:
ensure
=>
'present'
,
line
=>
'42 private'
,
path
=>
'/etc/iproute2/rt_tables'
,
}
$ups
=
[
"ip route add 192.168.101.0/24 via ${data['gateway']}"
,
"ip route add 192.168.200.0/21 via ${data['gateway']}"
,
"ip rule add from ${data['address']} table private"
,
"ip route add default via ${data['gateway']} dev ${data['interface']} table private"
,
'ip route flush cache'
,
]
$downs
=
[
"ip route del default via ${data['gateway']} dev ${data['interface']} table private"
,
"ip rule del from ${data['address']} table private"
,
"ip route del 192.168.200.0/24 via ${data['gateway']}"
,
"ip route del 192.168.101.0/24 via ${data['gateway']}"
,
'ip route flush cache'
,
]
$gateway
=
undef
}
else
{
$ups
=
[]
$downs
=
[]
$gateway
=
$data
[
'gateway'
]
}
debnet
::
iface
{
$data
[
'interface'
]:
method
=>
'static'
,
address
=>
$data
[
'address'
],
netmask
=>
$data
[
'netmask'
],
gateway
=>
$gateway,
ups
=>
$ups,
downs
=>
$downs,
}
}
}
File Metadata
Details
Attached
Mime Type
text/x-c++
Expires
Sat, Jun 21, 5:25 PM (1 w, 3 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3242791
Attached To
rSPSITE puppet-swh-site
Event Timeline
Log In to Comment