yabusygin.iptables
Ansible 角色用于管理 iptables
防火墙
已废弃。 请使用 Ansible 集合 yabusygin.netfilter
。
这是一个配置 iptables
管理防火墙的 Ansible 角色。防火墙规则是持久的。
要求
无特别要求。
角色变量
iptables_rules_ipv4
和 iptables_rules_ipv6
变量指定自定义规则文件的路径(分别为 IPv4 和 IPv6)。规则文件格式对应于 iptables-save
(ip6tables-save
)的输出。
依赖关系
无。
示例剧本
---
- name: 示例剧本
hosts: server
tasks:
- name: 配置防火墙
ansible.builtin.import_role:
name: yabusygin.iptables
vars:
iptables_rules_ipv4: config/iptables.ipv4.rules
iptables_rules_ipv6: config/iptables.ipv6.rules
许可
MIT
作者信息
Alexey Busygin <yaabusygin@gmail.com>