network/salt/upstream/shaping.sls

33 lines
795 B
Plaintext
Raw Normal View History

2016-11-16 02:22:59 +01:00
{%- set upstream = pillar['upstream'] %}
2016-11-16 02:46:07 +01:00
iproute2:
2016-11-16 02:22:59 +01:00
pkg.installed: []
2017-02-05 03:22:06 +01:00
{%- if upstream.get('up-bandwidth') %}
/etc/network/if-up.d/up-shaping:
2016-11-16 02:22:59 +01:00
file.managed:
- source: salt://upstream/shaping
- template: 'jinja'
2017-02-05 03:22:06 +01:00
- context:
iface: {{ pillar['upstream']['interface'] }}
bandwidth: {{ pillar['upstream']['up-bandwidth'] }}
flow_keys: nfct-src
2016-11-16 02:22:59 +01:00
- mode: 755
- require:
2016-11-16 02:46:07 +01:00
- pkg: iproute2
2017-02-05 03:22:06 +01:00
{%- endif %}
{%- if upstream.get('down-bandwidth') %}
/etc/network/if-up.d/down-shaping:
file.managed:
- source: salt://upstream/shaping
- template: 'jinja'
- context:
iface: core
bandwidth: {{ pillar['upstream']['down-bandwidth'] }}
flow_keys: nfct-dst
- mode: 755
- require:
- pkg: iproute2
{%- endif %}