An Ansible role to install and configure firewalld.
Firewalld is the firewall manager for most RedHat Derivates like Fedora, CentOS or Oracle Linux. Installing and configuring firewalld is a very common task for most operators.
This role installs and configures firewalld.
- install packages
- start services
- configure rules like ports, services and interfaces
Used Modules:
Install from Ansible Galaxy
ansible-galaxy install while_true_do.sys_firewalld
Install from Github
git clone https://github.com/while-true-do/ansible-role-sys_firewalld.git while_true_do.sys_firewalld
---
# defaults file for while_true_do.sys_firewalld
## Package Management
wtd_sys_firewalld_package:
- firewalld
# State can be present|latest|absent
wtd_sys_firewalld_package_state: "present"
## Service Management
wtd_sys_firewalld_service: "firewalld"
# State can be started|stopped
wtd_sys_firewalld_service_state: "started"
wtd_sys_firewalld_service_enabled: true
wtd_sys_firewalld_conf: []
# DefaultZone: "public"
# MinimalMark: "100"
# CleanupOnExit: "yes"
# Lockdown: "no"
# IPv6_rpfilter: "yes"
# IndividualCalls: "no"
# LogDenied: "off"
# AutomaticHelpers: "system"
## Configuration Management
wtd_sys_firewalld_rules: []
# You can specify the rules as shown below.
# State and zone are defaulting and you don't need to define them.
# - State can be enabled|disabled
# - Zone is depending on the zones defined for your system
#
# - service: httpd
# state: enabled (defaults to enabled)
# zone: public (defaults to public)
#
# - port: 80/tcp
# state: enabled (defaults to enabled)
# zone: public (defaults to public)
#
# - source: 192.168.0.0/24
# state: enabled (defaults to enabled)
# zone: public (defaults to public)
#
# - interface: eth0
# state: enabled (defaults to enabled)
# zone: public (defaults to public)
#
# - masquerade: true
# state: enabled (defaults to enabled)
# zone: public (defaults to public)
#
# - rich_rule: rule service name="ftp" audit limit value="1/m" accept
# state: enabled (defaults to enabled)
# zone: public (defaults to public)
Running Ansible Roles can be done in a playbook.
---
- hosts: all
roles:
- role: while_true_do.sys_firewalld
- hosts: all
roles:
- role: while_true_do.sys_firewalld
wtd_sys_firewalld_rules:
- service: http
- service: https
- service: ssh
zone: internal
- RedHat Testing is currently not possible in public, due to limitations in subscriptions.
- Some services and features cannot be tested properly, due to limitations in docker.
- Firewalld and ansible_firewalld are untested for Debian Based Systems
Most of the "generic" tests are located in the Test Library.
Ansible specific testing is done with Molecule.
Infrastructure testing is done with testinfra.
Automated testing is done with Travis CI.
Thank you so much for considering to contribute. We are very happy, when somebody is joining the hard work. Please fell free to open Bugs, Feature Requests or Pull Requests after reading the Contribution Guideline.
See who has contributed already in the kudos.txt.
This work is licensed under a BSD-3-Clause License.
- Site https://while-true-do.io
- Twitter https://twitter.com/wtd_news
- Code https://github.com/while-true-do
- Mail [email protected]
- IRC freenode, #while-true-do
- Telegram https://t.me/while_true_do