fortinet.fortimanager.fmgr_firewall_proxyaddress 模块 – Web 代理地址配置。

注意

此模块是 fortinet.fortimanager 集合 (版本 2.8.2) 的一部分。

如果您使用的是 ansible 包,则可能已安装此集合。它不包含在 ansible-core 中。要检查是否已安装,请运行 ansible-galaxy collection list

要安装它,请使用: ansible-galaxy collection install fortinet.fortimanager

要在 playbook 中使用它,请指定: fortinet.fortimanager.fmgr_firewall_proxyaddress

fortinet.fortimanager 2.0.0 中的新增功能

概要

  • 此模块能够配置 FortiManager 设备。

  • 示例包含所有需要在使用前调整为数据源的参数和值。

参数

参数

注释

access_token

字符串

无需使用用户名和密码即可访问 FortiManager 的令牌。

adom

字符串 / 必需

请求 URL 中的参数 (adom)。

bypass_validation

布尔值

仅当模块模式与 FortiManager API 结构不同时设置为 True,模块将继续执行而不验证参数。

选项

  • false ← (默认)

  • true

enable_log

布尔值

启用/禁用任务日志记录。

选项

  • false ← (默认)

  • true

firewall_proxyaddress

字典

设置的顶级参数。

_image_base64

别名:_image-base64

字符串

图像 base64。

application

任意

(列表) SaaS 应用程序。

case_sensitivity

别名:case-sensitivity

字符串

启用以使模式区分大小写。

选项

  • "disable"

  • "enable"

category

任意

(列表或字符串) FortiGuard 类别 ID。

color

整数

确定 GUI 中图标颜色的整数值

comment

字符串

可选注释。

header

字符串

HTTP 头名称,作为正则表达式。

header_group

别名:header-group

列表 / 元素=字典

报头组。

case_sensitivity

别名:case-sensitivity

字符串

模式中的大小写敏感性。

选项

  • "disable"

  • "enable"

header

字符串

HTTP 头正则表达式。

header_name

别名:header-name

字符串

HTTP 头。

id

整数

ID。

header_name

别名:header-name

字符串

HTTP 头的名称。

host

字符串

主机的地址对象。

host_regex

别名:host-regex

字符串

主机名,作为正则表达式。

method

列表 / 元素=字符串

要使用的 HTTP 请求方法。

选项

  • "delete"

  • "get"

  • "head"

  • "options"

  • "post"

  • "put"

  • "trace"

  • "connect"

name

字符串 / 必需

地址名称。

path

字符串

URL 路径,作为正则表达式。

query

字符串

将 URL 的查询部分与正则表达式匹配。

referrer

字符串

启用/禁用使用 HTTP 标头中的引用程序字段来匹配地址。

选项

  • "disable"

  • "enable"

tagging

列表 / 元素=字典

标记。

category

字符串

标签类别。

name

字符串

标记条目名称。

tags

任意

(列表) 标签。

tags

字符串

对象标签的名称

type

字符串

代理地址类型。

选项

  • "host-regex"

  • "url"

  • "category"

  • "method"

  • "ua"

  • "header"

  • "src-advanced"

  • "dst-advanced"

  • "url-list"

  • "saas"

ua

列表 / 元素=字符串

要用作用户代理的浏览器名称。

选项

  • "chrome"

  • "ms"

  • "firefox"

  • "safari"

  • "other"

  • "ie"

  • "edge"

ua_max_ver

别名:ua-max-ver

字符串

以点分十进制表示法指定的用户代理的最大版本。

ua_min_ver

别名:ua-min-ver

字符串

以点分十进制表示法指定的用户代理的最小版本。

uuid

字符串

通用唯一标识符

visibility

字符串

启用/禁用对象在 GUI 中的可见性。

选项

  • "disable"

  • "enable"

forticloud_access_token

字符串

使用 FortiCloud API 访问令牌验证 Ansible 客户端。

proposed_method

字符串

底层 Json RPC 请求的重写方法。

选项

  • "update"

  • "set"

  • "add"

rc_failed

列表 / 元素=整数

将被覆盖的失败条件对应的rc代码列表。

rc_succeeded

列表 / 元素=整数

将被覆盖的成功条件对应的rc代码列表。

state

字符串 / 必需

创建、更新或删除对象的指令。

选项

  • "present"

  • "absent"

workspace_locking_adom

字符串

FortiManager在工作区模式下运行时需要锁定的ADOM,值可以是global和其他包括root在内的值。

workspace_locking_timeout

整数

等待其他用户释放工作区锁的最大时间(秒)。

默认值: 300

注释

注意

  • 从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
  hosts: fortimanagers
  connection: httpapi
  vars:
    ansible_httpapi_use_ssl: true
    ansible_httpapi_validate_certs: false
    ansible_httpapi_port: 443
  tasks:
    - name: Web proxy address configuration.
      fortinet.fortimanager.fmgr_firewall_proxyaddress:
        bypass_validation: false
        adom: ansible
        state: present
        firewall_proxyaddress:
          case-sensitivity: disable
          color: 1
          comment: "ansible-comment"
          name: "ansible-test"

- name: Gathering fortimanager facts
  hosts: fortimanagers
  gather_facts: false
  connection: httpapi
  vars:
    ansible_httpapi_use_ssl: true
    ansible_httpapi_validate_certs: false
    ansible_httpapi_port: 443
  tasks:
    - name: Retrieve all the proxy addresses
      fortinet.fortimanager.fmgr_fact:
        facts:
          selector: "firewall_proxyaddress"
          params:
            adom: "ansible"
            proxy-address: "your_value"

返回值

常见的返回值已在此处记录,以下是此模块特有的字段

描述

meta

字典

请求的结果。

返回: 始终

request_url

字符串

请求的完整URL。

返回: 始终

示例: "/sys/login/user"

response_code

整数

API请求的状态。

返回: 始终

示例: 0

response_data

列表 / 元素=字符串

API响应。

返回: 始终

response_message

字符串

API响应的描述性消息。

返回: 始终

示例: "OK."

system_information

字典

目标系统的信息。

返回: 始终

rc

整数

请求的状态。

返回: 始终

示例: 0

version_check_warning

列表 / 元素=字符串

如果剧本中使用的参数不受当前FortiManager版本支持,则会发出警告。

返回: 复杂类型

作者

  • 杜欣伟 (@dux-fortinet)

  • 李星 (@lix-fortinet)

  • 薛杰 (@JieX19)

  • 郑凌 (@chillancezen)

  • 沈峰 (@fshen01)

  • 卢洪斌 (@fgtdev-hblu)