Page MenuHomeDevCentral

routes.sls
No OneTemporary

routes.sls

# -------------------------------------------------------------
# Salt — Network
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Project: Nasqueron
# License: Trivial work, not eligible to copyright
# -------------------------------------------------------------
{% from "roles/core/network/map.jinja" import routes_config with context %}
# -------------------------------------------------------------
# Routes
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
{{ routes_config["config_path"] }}:
file.managed:
- source: salt://roles/core/network/files/{{ routes_config["source_path"] }}
- makedirs: True
- template: jinja
- context:
routes: {{ salt["node.get_routes"]() }}
# -------------------------------------------------------------
# Enable packet forwarding for routers
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
{% if "router" in salt['node.get_list']('roles') %}
{% if grains['os'] == 'FreeBSD' %}
/etc/rc.d/routing/router:
file.managed:
- source: salt://roles/core/network/files/FreeBSD/router.rc
- makedirs: True
{% endif %}
{% endif %}
# -------------------------------------------------------------
# Systemd unit for Linux systems using our /etc/routes.conf
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
{% if routes_config["provider"] == "custom-service" %}
/usr/sbin/routes:
file.managed:
- source: salt://roles/core/network/files/Linux/routes.sh
- mode: 755
/etc/systemd/system/routes.service:
file.managed:
- source: salt://roles/core/network/files/Linux/routes.service
service.running:
- name: routes
- enable: true
{% endif %}

File Metadata

Mime Type
text/plain
Expires
Thu, Dec 26, 01:57 (5 h, 46 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2310419
Default Alt Text
routes.sls (1 KB)

Event Timeline