robertdebock.firewall
Ansible Role Firewall
This tool helps you manage firewall ports on various Linux operating systems.
GitHub | GitLab | Downloads | Version |
---|---|---|---|
Example Playbook
Here’s an example playbook that shows how to use this role. It is taken from molecule/default/converge.yml
and is tested regularly.
---
- name: Converge
hosts: all
become: true
gather_facts: true
roles:
- role: robertdebock.firewall
Before running the main playbook, you must prepare the machine. This is done using molecule/default/prepare.yml
:
---
- name: Prepare
hosts: all
become: true
gather_facts: false
roles:
- role: robertdebock.bootstrap
For more information on using these roles, refer to a full explanation and example.
Role Variables
The default values for the variables are defined in defaults/main.yml
:
---
# defaults file for firewall
# Default protocol if not specified in `firewall_services`.
firewall_default_protocol: tcp
# Default rule if not specified in `firewall_services`.
firewall_default_rule: allow
# List of services to allow traffic to.
firewall_services:
- name: ssh
# More complex example:
# firewall_services:
# - name: ssh
# - name: https
# - name: 5353
# protocol: udp
# - name: 1234
# protocol: tcp
# - name: 1337
# state: absent
Requirements
- Python packages listed in requirements.txt.
State of Used Roles
The following roles are used to prepare a system. You can prepare your system differently.
Requirement | GitHub | GitLab |
---|---|---|
robertdebock.bootstrap |
Context
This role works with many other compatible roles. You can find more information in the documentation of these roles.
Here’s a diagram of related roles:
Compatibility
This role has been tested with these container images:
Container | Tags |
---|---|
Alpine | all |
EL | 9 |
Debian | all |
Fedora | all |
Ubuntu | all |
The minimum Ansible version required is 2.12. Testing has also been done on:
- Previous versions.
- The current version.
- Development version.
If you encounter any issues, please report them on GitHub.
License
This role is licensed under Apache-2.0.
Author Information
This role is maintained by robertdebock.
Consider sponsoring me.
Manage firewall ports on all (known) Linux operating systems.
ansible-galaxy install robertdebock.firewall