fortinet.fortimanager.fmgr_vpnmgr_vpntable 模块 – Vpnmgr vpntable

注意

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

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

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

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

fortinet.fortimanager 2.0.0 中的新增功能

概要

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

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

参数

参数

注释

access_token

字符串

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

adom

字符串 / 必需

请求 URL 中的参数 (adom)。

bypass_validation

布尔值

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

选项

  • false ← (默认)

  • true

enable_log

布尔值

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

选项

  • false ← (默认)

  • true

forticloud_access_token

字符串

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

proposed_method

字符串

底层 Json RPC 请求的覆盖方法。

选项

  • "update"

  • "set"

  • "add"

rc_failed

列表 / 元素=整数

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

rc_succeeded

列表 / 元素=整数

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

state

字符串 / 必需

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

选项

  • "present"

  • "absent"

vpnmgr_vpntable

字典

设置的顶级参数。

authmethod

字符串

身份验证方法。

选项

  • "psk"

  • "rsa-signature"

  • "signature"

auto_zone_policy

别名:auto-zone-policy

字符串

自动区域策略。

选项

  • "disable"

  • "enable"

certificate

任意

(列表或字符串) 证书。

description

字符串

描述。

dpd

字符串

Dpd。

选项

  • "disable"

  • "enable"

  • "on-idle"

  • "on-demand"

dpd_retrycount

别名:dpd-retrycount

整数

Dpd 重试次数。

dpd_retryinterval

别名:dpd-retryinterval

任意

(列表) Dpd 重试间隔。

fcc_enforcement

别名:fcc-enforcement

字符串

Fcc 强制执行。

选项

  • "disable"

  • "enable"

hub2spoke_zone

别名:hub2spoke-zone

任意

(列表或字符串) Hub2spoke 区域。

ike1dhgroup

列表 / 元素=字符串

Ike1dhgroup。

选项

  • "1"

  • "2"

  • "5"

  • "14"

  • "15"

  • "16"

  • "17"

  • "18"

  • "19"

  • "20"

  • "21"

  • "27"

  • "28"

  • "29"

  • "30"

  • "31"

  • "32"

ike1dpd

字符串

Ike1dpd。

选项

  • "disable"

  • "enable"

ike1keylifesec

整数

Ike1keylifesec。

ike1localid

字符串

Ike1localid。

ike1mode

字符串

Ike1mode。

选项

  • "main"

  • "aggressive"

ike1natkeepalive

整数

Ike1natkeepalive。

ike1nattraversal

字符串

Ike1nattraversal。

选项

  • "disable"

  • "enable"

  • "forced"

ike1proposal

字符串

Ike1proposal。

选项

  • "des-md5"

  • "des-sha1"

  • "3des-md5"

  • "3des-sha1"

  • "aes128-md5"

  • "aes128-sha1"

  • "aes192-md5"

  • "aes192-sha1"

  • "aes256-md5"

  • "aes256-sha1"

  • "des-sha256"

  • "3des-sha256"

  • "aes128-sha256"

  • "aes192-sha256"

  • "aes256-sha256"

  • "des-sha384"

  • "des-sha512"

  • "3des-sha384"

  • "3des-sha512"

  • "aes128-sha384"

  • "aes128-sha512"

  • "aes192-sha384"

  • "aes192-sha512"

  • "aes256-sha384"

  • "aes256-sha512"

  • "aria128-md5"

  • "aria128-sha1"

  • "aria128-sha256"

  • "aria128-sha384"

  • "aria128-sha512"

  • "aria192-md5"

  • "aria192-sha1"

  • "aria192-sha256"

  • "aria192-sha384"

  • "aria192-sha512"

  • "aria256-md5"

  • "aria256-sha1"

  • "aria256-sha256"

  • "aria256-sha384"

  • "aria256-sha512"

  • "seed-md5"

  • "seed-sha1"

  • "seed-sha256"

  • "seed-sha384"

  • "seed-sha512"

  • "aes128gcm-prfsha1"

  • "aes128gcm-prfsha256"

  • "aes128gcm-prfsha384"

  • "aes128gcm-prfsha512"

  • "aes256gcm-prfsha1"

  • "aes256gcm-prfsha256"

  • "aes256gcm-prfsha384"

  • "aes256gcm-prfsha512"

  • "chacha20poly1305-prfsha1"

  • "chacha20poly1305-prfsha256"

  • "chacha20poly1305-prfsha384"

  • "chacha20poly1305-prfsha512"

ike2autonego

字符串

Ike2autonego。

选项

  • "disable"

  • "enable"

ike2dhgroup

列表 / 元素=字符串

Ike2dhgroup。

选项

  • "1"

  • "2"

  • "5"

  • "14"

  • "15"

  • "16"

  • "17"

  • "18"

  • "19"

  • "20"

  • "21"

  • "27"

  • "28"

  • "29"

  • "30"

  • "31"

  • "32"

ike2keepalive

字符串

Ike2keepalive。

选项

  • "disable"

  • "enable"

ike2keylifekbs

整数

Ike2keylifekbs。

ike2keylifesec

整数

Ike2keylifesec。

ike2keylifetype

字符串

Ike2keylifetype。

选项

  • "seconds"

  • "kbs"

  • "both"

ike2proposal

字符串

Ike2proposal。

选项

  • “null-md5”

  • “null-sha1”

  • “des-null”

  • “3des-null”

  • "des-md5"

  • "des-sha1"

  • "3des-md5"

  • "3des-sha1"

  • "aes128-md5"

  • "aes128-sha1"

  • "aes192-md5"

  • "aes192-sha1"

  • "aes256-md5"

  • "aes256-sha1"

  • “aes128-null”

  • “aes192-null”

  • “aes256-null”

  • “null-sha256”

  • "des-sha256"

  • "3des-sha256"

  • "aes128-sha256"

  • "aes192-sha256"

  • "aes256-sha256"

  • "des-sha384"

  • "des-sha512"

  • "3des-sha384"

  • "3des-sha512"

  • "aes128-sha384"

  • "aes128-sha512"

  • "aes192-sha384"

  • "aes192-sha512"

  • "aes256-sha384"

  • "aes256-sha512"

  • “null-sha384”

  • “null-sha512”

  • “aria128-null”

  • "aria128-md5"

  • "aria128-sha1"

  • "aria128-sha256"

  • "aria128-sha384"

  • "aria128-sha512"

  • “aria192-null”

  • "aria192-md5"

  • "aria192-sha1"

  • "aria192-sha256"

  • "aria192-sha384"

  • "aria192-sha512"

  • “aria256-null”

  • "aria256-md5"

  • "aria256-sha1"

  • "aria256-sha256"

  • "aria256-sha384"

  • "aria256-sha512"

  • “seed-null”

  • "seed-md5"

  • "seed-sha1"

  • "seed-sha256"

  • "seed-sha384"

  • "seed-sha512"

  • “aes128gcm”

  • “aes256gcm”

  • “chacha20poly1305”

ike_version

别名: ike-version

字符串

IKE 版本。

选项

  • "1"

  • "2"

inter_vdom

别名: inter-vdom

字符串

虚拟域间。

选项

  • "disable"

  • "enable"

intf_mode

别名: intf-mode

字符串

接口模式。

选项

  • “off”

  • “on”

localid_type

别名: localid-type

字符串

本地ID类型。

选项

  • “auto”

  • “fqdn”

  • “user-fqdn”

  • “keyid”

  • “address”

  • “asn1dn”

名称

字符串 / 必需

名称。

negotiate_timeout

别名: negotiate-timeout

整数

协商超时。

network_id

别名: network-id

整数

网络ID。

network_overlay

别名: network-overlay

字符串

网络覆盖。

选项

  • "disable"

  • "enable"

npu_offload

别名: npu-offload

字符串

NPU卸载。

选项

  • "disable"

  • "enable"

pfs

字符串

PFS。

选项

  • "disable"

  • "enable"

psk_auto_generate

别名: psk-auto-generate

字符串

PSK自动生成。

选项

  • "disable"

  • "enable"

psksecret

任意

(列表) PSK密钥。

replay

字符串

重放保护。

选项

  • "disable"

  • "enable"

rsa_certificate

别名: rsa-certificate

字符串

RSA证书。

spoke2hub_zone

别名: spoke2hub-zone

任意

(列表或字符串) spoke到hub区域。

topology

字符串

拓扑结构。

选项

  • “meshed”

  • “star”

  • “dialup”

vpn_zone

别名: vpn-zone

任意

(列表或字符串) VPN区域。

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 (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: Vpnmgr vpntable
      fortinet.fortimanager.fmgr_vpnmgr_vpntable:
        # 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>
        state: present # <value in [present, absent]>
        vpnmgr_vpntable:
          authmethod: <value in [psk, rsa-signature, signature]>
          auto_zone_policy: <value in [disable, enable]>
          certificate: <list or string>
          description: <string>
          dpd: <value in [disable, enable, on-idle, ...]>
          dpd_retrycount: <integer>
          dpd_retryinterval: <list or integer>
          fcc_enforcement: <value in [disable, enable]>
          hub2spoke_zone: <list or string>
          ike_version: <value in [1, 2]>
          ike1dhgroup:
            - "1"
            - "2"
            - "5"
            - "14"
            - "15"
            - "16"
            - "17"
            - "18"
            - "19"
            - "20"
            - "21"
            - "27"
            - "28"
            - "29"
            - "30"
            - "31"
            - "32"
          ike1dpd: <value in [disable, enable]>
          ike1keylifesec: <integer>
          ike1localid: <string>
          ike1mode: <value in [main, aggressive]>
          ike1natkeepalive: <integer>
          ike1nattraversal: <value in [disable, enable, forced]>
          ike1proposal: <value in [des-md5, des-sha1, 3des-md5, ...]>
          ike2autonego: <value in [disable, enable]>
          ike2dhgroup:
            - "1"
            - "2"
            - "5"
            - "14"
            - "15"
            - "16"
            - "17"
            - "18"
            - "19"
            - "20"
            - "21"
            - "27"
            - "28"
            - "29"
            - "30"
            - "31"
            - "32"
          ike2keepalive: <value in [disable, enable]>
          ike2keylifekbs: <integer>
          ike2keylifesec: <integer>
          ike2keylifetype: <value in [seconds, kbs, both]>
          ike2proposal: <value in [null-md5, null-sha1, des-null, ...]>
          inter_vdom: <value in [disable, enable]>
          intf_mode: <value in [off, on]>
          localid_type: <value in [auto, fqdn, user-fqdn, ...]>
          name: <string>
          negotiate_timeout: <integer>
          npu_offload: <value in [disable, enable]>
          pfs: <value in [disable, enable]>
          psk_auto_generate: <value in [disable, enable]>
          psksecret: <list or string>
          replay: <value in [disable, enable]>
          rsa_certificate: <string>
          spoke2hub_zone: <list or string>
          topology: <value in [meshed, star, dialup]>
          vpn_zone: <list or string>
          network_id: <integer>
          network_overlay: <value in [disable, enable]>

返回值

公共返回值已在此处记录,以下是此模块独有的字段

描述

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)