Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F56327655
gre.sls
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
gre.sls
View Options
# -------------------------------------------------------------
# Salt — Network — GRE tunnels
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Project: Nasqueron
# Created: 2020-09-20
# License: Trivial work, not eligible to copyright
# -------------------------------------------------------------
{%
from
"roles/core/network/map.jinja"
import
gre
with context
%}
{%
set
boot_loader
=
namespace
(
gre
=
false
)
%}
{%
set
is_router
=
salt
[
"node.has_role"
](
"router"
)
%}
# -------------------------------------------------------------
# Tunnels network configuration files
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
{%
for
tunnel
in
salt
[
'node.resolve_gre_tunnels'
]()
%}
{%
set
boot_loader.gre
=
True
%}
{{
gre.config_path
}}{{
tunnel
[
"description"
]
}}
:
file.managed
:
-
source
:
salt://roles/core/network/files/
{{
gre.source_path
}}
-
makedirs
:
True
-
template
:
jinja
-
defaults
:
{{
tunnel
}}
{%
if
grains
[
'os_family'
]
==
'Debian'
%}
-
context
:
interface
:
gre-
{{
tunnel
[
"network"
]
}}
{%
endif
%}
{%
if
not
is_router
and
grains
[
'os'
]
==
'FreeBSD'
%}
# Only once iteration of the loop is expected, as it's not a router
/usr/local/etc/rc.d/route-drake
:
file.managed
:
-
source
:
salt://roles/core/network/files/FreeBSD/route-drake.service
-
mode
:
755
/etc/rc.conf.d/route_drake
:
file.managed
:
-
source
:
salt://roles/core/network/files/FreeBSD/route_drake.rc
-
template
:
jinja
-
context
:
tunnel_endpoint
:
{{
tunnel
[
"dst"
]
}}
{%
endif
%}
{%
endfor
%}
# -------------------------------------------------------------
# Kernel configuration
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
{%
if
boot_loader.gre
%}
{%
if
grains
[
'os'
]
==
'FreeBSD'
%}
load_gre_kernel_module
:
file.append
:
-
name
:
/boot/loader.conf
-
text
:
|
if_gre_load="YES"
{%
endif
%}
{%
if
grains
[
'os_family'
]
==
'Debian'
%}
ip_gre
:
kmod.present
:
-
persist
:
True
{%
endif
%}
{%
endif
%}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Nov 7, 02:10 (1 d, 8 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
4227574
Default Alt Text
gre.sls (1 KB)
Attached To
Mode
rOPS Nasqueron Operations
Attached
Detach File
Event Timeline
Log In to Comment