forked from saltstack-formulas/firewalld-formula
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
hoonetorg
committed
Sep 13, 2016
1 parent
b91d65d
commit 9dc0a77
Showing
4 changed files
with
65 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# == State: firewalld.direct | ||
|
||
{% from "firewalld/map.jinja" import firewalld with context %} | ||
# == Define: firewalld.direct | ||
# | ||
# This defines a configuration for permanent direct chains, | ||
# rules and passtthroughs, see firewalld.direct (5) man page. | ||
{%- if firewalld.get('direct', False) %} | ||
/etc/firewalld/direct.xml: | ||
file: | ||
- managed | ||
- name: /etc/firewalld/direct.xml | ||
- user: root | ||
- group: root | ||
- mode: "0644" | ||
- source: salt://firewalld/files/direct.xml | ||
- template: jinja | ||
- require: | ||
- pkg: package_firewalld # make sure package is installed | ||
- file: directory_firewalld | ||
- listen_in: | ||
- module: service_firewalld # restart service | ||
- context: | ||
direct: {{ firewalld.direct|json }} | ||
{%- endif %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<direct> | ||
{%- if 'chain' in direct %} | ||
{%- for k, v in direct.chain.items() %} | ||
<chain ipv="{{v.ipv}}" table="{{v.table}}" chain="{{k}}"/> | ||
{%- endfor %} | ||
{%- endif %} | ||
{%- if 'rule' in direct %} | ||
{%- for k, v in direct.rule.items() %} | ||
<rule priority="{{v.priority}}" table="{{v.table}}" ipv="{{v.ipv}}" chain="{{v.chain}}">{{v.args}}</rule> | ||
{%- endfor %} | ||
{%- endif %} | ||
{%- if 'passthrough' in direct %} | ||
{%- for k, v in direct.passthrough.items() %} | ||
<passthrough ipv="{{v.ipv}}">{{v.args}}</passthrough> | ||
{%- endfor %} | ||
{%- endif %} | ||
</direct> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters