fortinet.fortios.fortios_vpn_certificate_local 模块 – Fortinet 的 FortiOS 和 FortiGate 中的本地密钥和证书。

注意

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

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

要安装它,请使用: ansible-galaxy collection install fortinet.fortios。您需要满足其他要求才能使用此模块,请参阅 要求 以了解详细信息。

要在 playbook 中使用它,请指定: fortinet.fortios.fortios_vpn_certificate_local

fortinet.fortios 2.0.0 中的新增功能

概要

  • 此模块能够通过允许用户设置和修改 vpn_certificate 功能和本地类别来配置 FortiGate 或 FortiOS (FOS) 设备。示例包括所有参数,在使用前需要将值调整到数据源。在 FOS v6.0.0 上测试。

要求

执行此模块的主机需要以下要求。

  • ansible>=2.15

参数

参数

注释

access_token

字符串

基于令牌的身份验证。从 Fortigate 的 GUI 生成。

enable_log

布尔值

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

选项

  • false ← (默认)

  • true

member_path

字符串

要操作的成员属性路径。

如果有多个属性,则用斜杠字符分隔。

标有 member_path 的参数对于执行成员操作是合法的。

member_state

字符串

在指定的属性路径下添加或删除成员。

指定 member_state 时,将忽略 state 选项。

选项

  • "present"

  • "absent"

state

字符串 / 必需

指示是创建还是删除对象。

选项

  • "present"

  • "absent"

vdom

字符串

虚拟域,属于先前定义的那些域。vdom 是 FortiGate 的虚拟实例,可以将其配置并用作不同的单元。

默认值: "root"

vpn_certificate_local

字典

本地密钥和证书。

acme_ca_url

字符串

ACME CA 服务器的 URL(Let's Encrypt 就是)。

acme_domain

字符串

解析到此 FortiGate 单元的有效域名。

acme_email

字符串

某些 CA(如 LetsEncrypt)所需的联系电子邮件地址。

acme_renew_window

整数

续期窗口的开始时间(证书过期前的几天,默认为 30)。

acme_rsa_key_size

整数

生成的证书的 RSA 私钥长度(至少 2048 位)。

auto_regenerate_days

整数

在请求更新的本地证书过期之前等待的天数 (0 = 禁用)。

auto_regenerate_days_warning

整数

在生成过期警告消息之前等待的天数 (0 = 禁用)。

ca_identifier

字符串

用于通过 SCEP 签名的 CA 服务器的 CA 标识符。

certificate

字符串

PEM 格式证书。

cmp_path

字符串

CMP 服务器内的路径位置。

cmp_regeneration_method

字符串

CMP 自动再生方法。

选项

  • "keyupate"

  • "renewal"

cmp_server

字符串

CMP 服务器的地址和端口(格式 = address:port)。

cmp_server_cert

字符串

CMP 服务器证书。来源 vpn.certificate.ca.name vpn.certificate.remote.name。

comments

字符串

注释。

csr

字符串

证书签名请求。

enroll_protocol

字符串

证书注册协议。

选项

  • "none"

  • "scep"

  • "cmpv2"

  • "acme2"

  • "est"

est_ca_id

字符串

用于通过 EST 签名的 CA 服务器的 CA 标识符。

est_client_cert

字符串

用于将此 FortiGate 认证到 EST 服务器的证书。来源 vpn.certificate.local.name。

est_http_password

字符串

用于通过 EST 签名的 HTTP 身份验证密码。

est_http_username

字符串

用于通过 EST 签名的 HTTP 身份验证用户名。

est_server

字符串

EST 服务器的地址和端口(例如 https://example.com:1234)。

est_server_cert

字符串

EST 服务器的证书必须可由此证书验证才能进行身份验证。来源 vpn.certificate.ca.name vpn.certificate.remote.name。

est_srp_password

字符串

EST SRP 身份验证密码。

est_srp_username

字符串

EST SRP 身份验证用户名。

ike_localid

字符串

FortiGate 用作 VPN 客户端进行身份验证的本地 ID。

ike_localid_type

字符串

IKE本地ID类型。

选项

  • “asn1dn”

  • “fqdn”

last_updated

整数

证书最后更新的时间。

name

字符串 / 必需

名称。

name_encoding

字符串

自动重新生成的名称编码方法。

选项

  • “printable”

  • “utf8”

password

字符串

密码(PEM文件)。

private_key

字符串

使用密码加密的PEM格式密钥。

private_key_retain

字符串

启用/禁用在SCEP续订期间保留私钥。

选项

  • “enable”

  • “disable”

range

字符串

证书的全局或VDOM IP地址范围。

选项

  • “global”

  • “vdom”

scep_password

字符串

SCEP服务器自动重新生成的挑战密码。

scep_url

字符串

SCEP服务器URL。

source

字符串

证书来源类型。

选项

  • “factory”

  • “user”

  • “bundle”

source_ip

字符串

与SCEP服务器通信的源IP地址。

state

字符串

证书签名请求状态。

注释

注意

  • 已弃用旧的fortiosapi,httpapi是运行playbook的首选方式。

  • 该模块支持check_mode。

示例

- name: Local keys and certificates.
  fortinet.fortios.fortios_vpn_certificate_local:
      vdom: "{{ vdom }}"
      state: "present"
      access_token: "<your_own_value>"
      vpn_certificate_local:
          acme_ca_url: "<your_own_value>"
          acme_domain: "<your_own_value>"
          acme_email: "<your_own_value>"
          acme_renew_window: "30"
          acme_rsa_key_size: "2048"
          auto_regenerate_days: "0"
          auto_regenerate_days_warning: "0"
          ca_identifier: "myId_10"
          certificate: "<your_own_value>"
          cmp_path: "<your_own_value>"
          cmp_regeneration_method: "keyupate"
          cmp_server: "<your_own_value>"
          cmp_server_cert: "<your_own_value> (source vpn.certificate.ca.name vpn.certificate.remote.name)"
          comments: "<your_own_value>"
          csr: "<your_own_value>"
          enroll_protocol: "none"
          est_ca_id: "<your_own_value>"
          est_client_cert: "<your_own_value> (source vpn.certificate.local.name)"
          est_http_password: "<your_own_value>"
          est_http_username: "<your_own_value>"
          est_server: "<your_own_value>"
          est_server_cert: "<your_own_value> (source vpn.certificate.ca.name vpn.certificate.remote.name)"
          est_srp_password: "<your_own_value>"
          est_srp_username: "<your_own_value>"
          ike_localid: "<your_own_value>"
          ike_localid_type: "asn1dn"
          last_updated: "2147483647"
          name: "default_name_30"
          name_encoding: "printable"
          password: "<your_own_value>"
          private_key: "<your_own_value>"
          private_key_retain: "enable"
          range: "global"
          scep_password: "<your_own_value>"
          scep_url: "<your_own_value>"
          source: "factory"
          source_ip: "84.230.14.43"
          state: "<your_own_value>"

返回值

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

描述

build

字符串

FortiGate镜像的版本号

返回值:始终

示例: "1547"

http_method

字符串

最后用于将内容置入FortiGate的方法

返回值:始终

示例: "PUT"

http_status

字符串

FortiGate在最后一次操作中给出的最后结果

返回值:始终

示例: "200"

mkey

字符串

最后一次调用FortiGate时使用的主密钥(ID)

返回值:成功

示例: "id"

name

字符串

用于满足请求的表的名称

返回值:始终

示例: "urlfilter"

path

字符串

用于满足请求的表的路径

返回值:始终

示例: "webfilter"

revision

字符串

内部修订号

返回值:始终

示例: "17.0.2.10658"

serial

字符串

设备的序列号

返回值:始终

示例: "FGVMEVYYQT3AB5352"

status

字符串

操作结果指示

返回值:始终

示例: "success"

vdom

字符串

使用的虚拟域

返回值:始终

示例: "root"

version

字符串

FortiGate的版本

返回值:始终

示例: "v5.6.3"

作者

  • 郑林 (@chillancezen)

  • 薛杰 (@JieX19)

  • 卢宏斌 (@fgtdev-hblu)

  • 沈方 (@frankshen01)

  • 米格尔·安赫尔·穆诺兹 (@mamunozgonzalez)

  • 尼古拉斯·托马斯 (@thomnico)