manala.shorewall

#######################################################################################################

:exclamation: 弃用通知 :exclamation:

该仓库及相关角色已弃用,推荐使用 Manala Ansible 集合

关于使用该集合的信息可以在 集合仓库 找到

#######################################################################################################

Ansible 角色: Shorewall 构建状态

:exclamation: 在 主要 Ansible 角色仓库报告问题发送拉取请求 :exclamation:

此角色用于设置 Shorewall

它是 Manala Ansible 堆栈 的一部分,但也可以作为独立组件使用。

需求

无。

依赖

无。

安装

Ansible 2+

使用 ansible galaxy 命令行工具:

ansible-galaxy install manala.shorewall

使用 ansible galaxy 需求文件:

- src: manala.shorewall

角色处理器

名称 类型 描述
shorewall restart 服务 重新启动 shorewall

角色变量

名称 默认值 类型 描述
manala_shorewall_install_packages ~ 数组 要安装的依赖包
manala_shorewall_install_packages_default ['shorewall'] 数组 默认要安装的依赖包
manala_shorewall_config_file '/etc/shorewall/shorewall.conf' 字符串 主配置文件路径
manala_shorewall_config {} 数组 主配置指令
manala_shorewall_configs_exclusive false 布尔型 是否排除现有文件的附加配置
manala_shorewall_configs_dir '/etc/shorewall' 字符串 附加配置目录路径
manala_shorewall_configs_defaults {} 数组 附加配置的默认值
manala_shorewall_configs [] 数组 附加配置指令(区域、规则、接口等)

配置示例 (有关更多信息,请参见 Shorewall 文档)

manala_shorewall_config:
  LOG_MARTIANS: "Yes"
  IP_FORWARDING: "On"

manala_shorewall_configs:
  # 基于内容
  - file: policy
    config: |
      # FW 到互联网
      fw  all ACCEPT
      # 默认规则 DROP
      net all DROP   info
      dmz all DROP   info
      # 必须最后
      all all REJECT info
  # 基于模板(文件名基于模板)
  - template: policy.j2
    config:
      foo: bar
  # 基于模板(强制文件名)
  - file: policy
    template: policy_foo.j2
    config:
      foo: bar
  # 字典数组模板(已弃用)
  - file: policy
    config:
      # FW 到互联网
      - fw:  all ACCEPT
      # 默认规则 DROP
      - net: all DROP   info
      - dmz: all DROP   info
      # 必须最后
      - all: all REJECT info
  # 确保配置缺失
  - file: policy
    state: absent # 默认是 "present"
  # 忽略配置
  - file: policy
    state: ignore
  # 扁平化配置
  - "{{ my_custom_configs_array }}"

示例剧本

- hosts: servers
  roles:
    - role: manala.shorewall

许可证

MIT

作者信息

Manala (http://www.manala.io/)

关于项目

Handle shorewall

安装
ansible-galaxy install manala.shorewall
许可证
Unknown
下载
1.8k
拥有者
Manala is an open source project supported by the french web agency ELAO providing advanced ansible roles for website's infrastructures and far more.