minifirewall: merge the "tail" pattern back into the main role

This commit is contained in:
Jérémy Lecour 2017-07-13 15:06:49 +02:00 committed by Jérémy Lecour
parent 913e547f04
commit b2278a151c
7 changed files with 17 additions and 30 deletions

View File

@ -1,10 +0,0 @@
# minifirewall-tail
Compiles a `minifirewall.tail` file based on templates and source it at the end of minifirewall configuration.
Templates are looked up in that order :
1. `{{ playbook_dir}}/templates/minifirewall-tail/minifirewall.{{ inventory_hostname}}.tail.j2`
2. `{{ playbook_dir}}/templates/minifirewall-tail/minifirewall.{{ host_group}}.tail.j2` (NB : `host_group` is not a core variable, it must be defined in `group_vars` files.)
3. `{{ playbook_dir}}/templates/minifirewall-tail/minifirewall.default.tail.j2`
If nothing is found, the role falls back to the template embedded in the role : `templates/minifirewall.default.tail.j2`

View File

@ -1,19 +0,0 @@
galaxy_info:
author: Evolix
description: Additionla configuration for Minifirewall
issue_tracker_url: https://forge.evolix.org/projects/ansible-roles/issues
license: GPLv2
min_ansible_version: 2.2
platforms:
- name: Debian
versions:
- jessie
dependencies: []
# List your role dependencies here, one per line.
# Be sure to remove the '[]' above if you add dependencies
# to this list.

View File

@ -15,7 +15,18 @@ Everything is in the `tasks/main.yml` file.
* `minifirewall_int_lan`: (default: IP/32)
* `minifirewall_trusted_ips`: with IP/hosts should be trusted for full access (default: none)
* `minifirewall_privilegied_ips`: with IP/hosts should be trusted for restricted access (default: none)
* `minifirewall_tail_included` : source a "tail" file at the end of the main config file. (default: `False`)
The full list of variables (with default values) can be found in `defaults/main.yml`.
**Some IP/hosts must be configured or the server will be inaccessible via network.**
## minifirewall-tail
Compiles a `minifirewall.tail` file based on templates and source it at the end of minifirewall configuration.
Templates are looked up in that order :
1. `{{ playbook_dir}}/templates/minifirewall-tail/minifirewall.{{ inventory_hostname}}.tail.j2`
2. `{{ playbook_dir}}/templates/minifirewall-tail/minifirewall.{{ host_group}}.tail.j2` (NB : `host_group` is not a core variable, it must be defined in `group_vars` files.)
3. `{{ playbook_dir}}/templates/minifirewall-tail/minifirewall.default.tail.j2`
If nothing is found, the role falls back to the template embedded in the role : `templates/minifirewall.default.tail.j2`

View File

@ -1,4 +1,6 @@
---
minifirewall_tail_included: False
minifirewall_git_url: "https://forge.evolix.org/minifirewall.git"
minifirewall_checkout_path: "/tmp/minifirewall"
minifirewall_int: "{{ ansible_default_ipv4.interface }}"

View File

@ -5,3 +5,6 @@
- include: config.yml
- include: activate.yml
- include: tail.yml
when: minifirewall_tail_included