fortinet.fortimanager.fmgr_pkg_firewall_consolidated_policy 模块 – 配置合并的 IPv4/IPv6 策略。
注意
此模块是 fortinet.fortimanager 集合(版本 2.8.2)的一部分。
如果您正在使用 ansible 包,您可能已经安装了此集合。它不包含在 ansible-core 中。要检查是否已安装,请运行 ansible-galaxy collection list。
要安装它,请使用:ansible-galaxy collection install fortinet.fortimanager。
要在 playbook 中使用它,请指定:fortinet.fortimanager.fmgr_pkg_firewall_consolidated_policy。
在 fortinet.fortimanager 2.1.0 中新增
概要
- 此模块能够配置 FortiManager 设备。 
- 示例包括所有参数和值,这些参数和值需要在使用前调整为数据源。 
参数
| 参数 | 注释 | 
|---|---|
| 在不使用用户名和密码的情况下访问 FortiManager 的令牌。 | |
| 请求的 URL 中的参数 (adom)。 | |
| 仅当模块模式与 FortiManager API 结构不同时才设置为 True,模块将继续执行而不验证参数。 选择 
 | |
| 启用/禁用任务的日志记录。 选择 
 | |
| 使用 forticloud API 访问令牌对 Ansible 客户端进行身份验证。 | |
| 请求的 URL 中的参数 (pkg)。 | |
| 设置的顶层参数。 | |
| 分配的策略块。 | |
| 策略操作 选择 
 | |
| (列表或字符串)应用程序类别 ID 列表。 | |
| (列表或字符串)应用程序组名称。 | |
| (列表)应用程序 ID 列表。 | |
| 现有应用程序列表的名称。 | |
| 启用/禁用将安全配置文件处理卸载到 CP 处理器。 选择 
 | |
| 现有防病毒配置文件的名称。 | |
| 启用某些用户免于强制门户。 选择 
 | |
| 现有 CIFS 配置文件的名称。 | |
| 注释。 | |
| 启用以将数据包 DiffServ 值更改为指定的 diffservcode-forward 值。 选择 
 | |
| 启用以更改数据包反向 选择 
 | |
| 将数据包 DiffServ 更改为此值。 | |
| 更改数据包反向 | |
| 现有 DLP 传感器的名称。 | |
| 现有 DNS 过滤器配置文件的名称。 | |
| (列表或字符串)目标 IPv4 地址名称和地址组名称。 | |
| (列表或字符串)目标 IPv6 地址名称和地址组名称。 | |
| 启用后,dstaddr 指定目标地址不得是什么。 选择 
 | |
| (列表或字符串)传出 | |
| 现有电子邮件过滤器配置文件的名称。 | |
| 启用以防止源 NAT 更改会话的源端口。 选择 
 | |
| (列表或字符串)FSSO 组的名称。 | |
| 当 GUI 处于全局视图模式时显示的策略标签。 | |
| (列表或字符串)可以使用此策略进行身份验证的用户组的名称。 | |
| 重定向 HTTP 选择 
 | |
| 现有 ICAP 配置文件的名称。 | |
| 基于策略的 IPsec VPN 选择 
 | |
| 策略检查模式 选择 
 | |
| 启用/禁用此策略使用互联网服务。 选择 
 | |
| (列表或字符串) 自定义互联网服务名称。 | |
| (列表或字符串) 自定义互联网服务组名称。 | |
| (列表或字符串) 互联网服务组名称。 | |
| (列表或字符串) 互联网服务 ID。 | |
| 启用后,internet-service 指定服务必须 *不* 是什么。 选择 
 | |
| 启用/禁用此策略的源中使用互联网服务。 选择 
 | |
| (列表或字符串) 自定义互联网服务源名称。 | |
| (列表或字符串) 自定义互联网服务源组名称。 | |
| (列表或字符串) 互联网服务源组名称。 | |
| (列表或字符串) 互联网服务源 ID。 | |
| 启用后,internet-service-src 指定服务必须 *不* 是什么。 选择 
 | |
| 启用以使用 IP 池进行源 NAT。 选择 
 | |
| 现有 IPS 传感器的名称。 | |
| 启用或禁用日志记录。 选择 
 | |
| 在会话开始时记录日志。 选择 
 | |
| 现有 MMS 配置文件的名称。 | |
| 策略名称。 | |
| 启用/禁用源 NAT。 选择 
 | |
| 基于策略的 IPsec VPN 选择 
 | |
| 每个 IP 流量整形器。 | |
| 策略 ID | |
| (列表或字符串) IPv4 池名称。 | |
| (列表或字符串) IPv6 池名称。 | |
| 配置文件组的名称。 | |
| 现有协议选项配置文件的名称。 | |
| 确定防火墙策略是允许安全配置文件组还是仅允许单个配置文件。 选择 
 | |
| 计划名称。 | |
| (列表或字符串) 服务和服务组名称。 | |
| 启用后,service 指定服务必须 *不* 是什么。 选择 
 | |
| 此策略接受的会话的 TTL(以秒为单位) | |
| (列表或字符串) 源 IPv4 地址名称和地址组名称。 | |
| (列表或字符串) 源 IPv6 地址名称和地址组名称。 | |
| 启用后,srcaddr 指定源地址必须 *不* 是什么。 选择 
 | |
| (列表或字符串) 传入 | |
| 现有 SSH 过滤器配置文件的名称。 | |
| 将 SSH 流量重定向到匹配的透明代理策略。 选择 
 | |
| 现有 SSL SSH 配置文件的名称。 | |
| 启用或禁用此策略。 选择 
 | |
| 接收方 TCP 最大分段大小 | |
| 发送方 TCP 最大分段大小 | |
| 流量整形器。 | |
| 反向流量整形器。 | |
| (列表或字符串) URL 类别 ID 列表。 | |
| (列表或字符串) 可以使用此策略进行身份验证的单个用户的名称。 | |
| 启用以添加一个或多个安全配置文件 选择 
 | |
| 通用唯一标识符 | |
| 现有 VoIP 配置文件的名称。 | |
| 基于策略的 IPsec VPN | |
| 现有 Web 应用程序防火墙配置文件的名称。 | |
| 启用/禁用 WAN 优化。 选择 
 | |
| WAN 优化自动检测模式。 选择 
 | |
| WAN 优化被动模式选项。 选择 
 | |
| WAN 优化对等方。 | |
| WAN 优化配置文件。 | |
| 启用/禁用 Web 缓存。 选择 
 | |
| 启用/禁用 HTTPS 的 Web 缓存。 选择 
 | |
| 现有 Web 过滤器配置文件的名称。 | |
| Web 代理转发服务器名称。 | |
| Web 代理配置文件名称。 | |
| 覆盖底层 Json RPC 请求的方法。 选择 
 | |
| 将覆盖失败条件的 rc 代码列表。 | |
| 将覆盖成功条件的 rc 代码列表。 | |
| 用于创建、更新或删除对象的指令。 选择 
 | |
| 在工作区模式下运行的 FortiManager 要锁定的 ADOM,该值可以是 global 以及包括 root 在内的其他值。 | |
| 等待其他用户释放工作区锁定的最大时间(以秒为单位)。 默认值:  | 
备注
注意
- 从 2.4.0 版本开始,所有输入参数均使用下划线命名约定 (snake_case)。请将参数(例如 “var-name”)更改为 “var_name”。旧的参数名称仍然可用,但您会收到弃用警告。您可以通过在 ansible.cfg 中设置 deprecation_warnings=False 来忽略此警告。 
- 此 FortiManager 模块支持在工作区锁定模式下运行,顶层参数 workspace_locking_adom 和 workspace_locking_timeout 有助于完成此项工作。 
- 要创建或更新对象,请使用 state present 指令。 
- 要删除对象,请使用 state absent 指令。 
- 通常,当返回非零 rc 时,运行一个模块可能会失败。您还可以使用参数 rc_failed 和 rc_succeeded 来覆盖失败或成功的条件。 
示例
- name: Example playbook (generated based on argument schema)
  hosts: fortimanagers
  connection: httpapi
  vars:
    ansible_httpapi_use_ssl: true
    ansible_httpapi_validate_certs: false
    ansible_httpapi_port: 443
  tasks:
    - name: Configure consolidated IPv4/IPv6 policies.
      fortinet.fortimanager.fmgr_pkg_firewall_consolidated_policy:
        # bypass_validation: false
        workspace_locking_adom: <value in [global, custom adom including root]>
        workspace_locking_timeout: 300
        # rc_succeeded: [0, -2, -3, ...]
        # rc_failed: [-2, -3, ...]
        adom: <your own value>
        pkg: <your own value>
        state: present # <value in [present, absent]>
        pkg_firewall_consolidated_policy:
          action: <value in [deny, accept, ipsec]>
          app_category: <list or string>
          app_group: <list or string>
          application: <list or integer>
          application_list: <string>
          auto_asic_offload: <value in [disable, enable]>
          av_profile: <string>
          cifs_profile: <string>
          comments: <string>
          diffserv_forward: <value in [disable, enable]>
          diffserv_reverse: <value in [disable, enable]>
          diffservcode_forward: <string>
          diffservcode_rev: <string>
          dlp_sensor: <string>
          dnsfilter_profile: <string>
          dstaddr4: <list or string>
          dstaddr6: <list or string>
          dstintf: <list or string>
          emailfilter_profile: <string>
          fixedport: <value in [disable, enable]>
          groups: <list or string>
          http_policy_redirect: <value in [disable, enable]>
          icap_profile: <string>
          inbound: <value in [disable, enable]>
          inspection_mode: <value in [proxy, flow]>
          internet_service: <value in [disable, enable]>
          internet_service_custom: <list or string>
          internet_service_custom_group: <list or string>
          internet_service_group: <list or string>
          internet_service_id: <list or string>
          internet_service_src: <value in [disable, enable]>
          internet_service_src_custom: <list or string>
          internet_service_src_custom_group: <list or string>
          internet_service_src_group: <list or string>
          internet_service_src_id: <list or string>
          ippool: <value in [disable, enable]>
          ips_sensor: <string>
          logtraffic: <value in [disable, all, utm]>
          logtraffic_start: <value in [disable, enable]>
          mms_profile: <string>
          name: <string>
          nat: <value in [disable, enable]>
          outbound: <value in [disable, enable]>
          per_ip_shaper: <string>
          policyid: <integer>
          poolname4: <list or string>
          poolname6: <list or string>
          profile_group: <string>
          profile_protocol_options: <string>
          profile_type: <value in [single, group]>
          schedule: <string>
          service: <list or string>
          session_ttl: <integer>
          srcaddr4: <list or string>
          srcaddr6: <list or string>
          srcintf: <list or string>
          ssh_filter_profile: <string>
          ssh_policy_redirect: <value in [disable, enable]>
          ssl_ssh_profile: <string>
          status: <value in [disable, enable]>
          tcp_mss_receiver: <integer>
          tcp_mss_sender: <integer>
          traffic_shaper: <string>
          traffic_shaper_reverse: <string>
          url_category: <list or string>
          users: <list or string>
          utm_status: <value in [disable, enable]>
          uuid: <string>
          voip_profile: <string>
          vpntunnel: <string>
          waf_profile: <string>
          wanopt: <value in [disable, enable]>
          wanopt_detection: <value in [active, passive, off]>
          wanopt_passive_opt: <value in [default, transparent, non-transparent]>
          wanopt_peer: <string>
          wanopt_profile: <string>
          webcache: <value in [disable, enable]>
          webcache_https: <value in [disable, enable]>
          webfilter_profile: <string>
          webproxy_forward_server: <string>
          webproxy_profile: <string>
          captive_portal_exempt: <value in [disable, enable]>
          dstaddr_negate: <value in [disable, enable]>
          fsso_groups: <list or string>
          global_label: <string>
          internet_service_negate: <value in [disable, enable]>
          internet_service_src_negate: <value in [disable, enable]>
          service_negate: <value in [disable, enable]>
          srcaddr_negate: <value in [disable, enable]>
          _policy_block: <integer>
返回值
常见的返回值已在此处记录:这里,以下是此模块特有的字段
| 键 | 描述 | 
|---|---|
| 请求的结果。 返回: 始终 | |
| 请求的完整 URL。 返回: 始终 示例:  | |
| API 请求的状态。 返回: 始终 示例:  | |
| API 响应。 返回: 始终 | |
| API 响应的描述性消息。 返回: 始终 示例:  | |
| 目标系统的信息。 返回: 始终 | |
| 请求的状态。 返回: 始终 示例:  | |
| 如果 playbook 中使用的参数不受当前 FortiManager 版本支持,则会发出警告。 返回: 复杂 | 
