Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F24892483
gre.sls
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 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
# -------------------------------------------------------------
{%
set
network
=
salt
[
'node.get'
](
'network'
)
%}
{%
set
gre_tunnels
=
salt
[
'pillar.get'
](
"gre_tunnels:"
+
grains
[
'id'
],
{})
%}
{%
set
boot_loader
=
namespace
(
gre
=
false
)
%}
# -------------------------------------------------------------
# Tunnels network configuration files
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
{%
for
description
,
tunnel
in
gre_tunnels.items
()
%}
{%
set
boot_loader.gre
=
True
%}
{%
set
tunnel_network
=
pillar
[
'networks'
][
tunnel
[
'network'
]]
%}
{%
if
grains
[
'os'
]
==
'FreeBSD'
%}
/etc/rc.conf.d/netif/gre_
{{
description
}}
:
file.managed
:
-
source
:
salt://roles/core/network/files/FreeBSD/netif_gre.rc
-
makedirs
:
True
-
template
:
jinja
-
context
:
description
:
{{
description
}}
interface
:
{{
tunnel
[
'interface'
]
}}
src
:
{{
tunnel_network
[
'addr'
][
grains
[
'id'
]]
}}
dst
:
{{
tunnel_network
[
'addr'
][
tunnel
[
'to'
]]
}}
icann_src
:
{{
network
[
'ipv4_address'
]
}}
icann_dst
:
{{
salt
[
'node.get'
](
'network'
,
tunnel
[
'to'
])[
'ipv4_address'
]
}}
{%
endif
%}
{%
if
grains
[
'os_family'
]
==
'Debian'
%}
/etc/network/interfaces.d/10-gre-
{{
description
}}
:
file.managed
:
-
source
:
salt://roles/core/network/files/Debian/10-gre.jinja
-
makedirs
:
True
-
template
:
jinja
-
context
:
interface
:
gre-
{{
description
}}
src
:
{{
tunnel_network
[
'addr'
][
grains
[
'id'
]]
}}
dst
:
{{
tunnel_network
[
'addr'
][
tunnel
[
'to'
]]
}}
netmask
:
{{
tunnel_network
[
'netmask'
]
}}
icann_src
:
{{
network
[
'ipv4_address'
]
}}
icann_dst
:
{{
salt
[
'node.get'
](
'network'
,
tunnel
[
'to'
])[
'ipv4_address'
]
}}
{%
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
Wed, Mar 18, 10:13 (2 h, 58 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3539331
Default Alt Text
gre.sls (2 KB)
Attached To
Mode
rOPS Nasqueron Operations
Attached
Detach File
Event Timeline
Log In to Comment