fortinet.fortios.fortios_system_ssh_config 模块 – 配置 Fortinet 的 FortiOS 和 FortiGate 中的 SSH 配置。

注意

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

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

要安装它,请使用:ansible-galaxy collection install fortinet.fortios。您需要其他要求才能使用此模块,有关详细信息,请参见 要求

要在剧本中使用它,请指定:fortinet.fortios.fortios_system_ssh_config

fortinet.fortios 2.0.0 中的新增功能

概要

  • 此模块能够通过允许用户设置和修改系统功能和 ssh_config 类别来配置 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"

system_ssh_config

字典

配置 SSH 配置。

ssh_enc_algo

列表 / 元素=字符串

选择一个或多个 SSH 密码。

选项

  • "chacha20-poly1305@openssh.com"

  • "aes128-ctr"

  • "aes192-ctr"

  • "aes256-ctr"

  • "arcfour256"

  • "arcfour128"

  • "aes128-cbc"

  • "3des-cbc"

  • "blowfish-cbc"

  • "cast128-cbc"

  • "aes192-cbc"

  • "aes256-cbc"

  • "arcfour"

  • "rijndael-cbc@lysator.liu.se"

  • "aes128-gcm@openssh.com"

  • "aes256-gcm@openssh.com"

ssh_hsk

字符串

配置 SSH 主机密钥。

ssh_hsk_algo

列表 / 元素=字符串

选择一个或多个 SSH 主机密钥算法。

选项

  • "ssh-rsa"

  • "ecdsa-sha2-nistp521"

  • "ecdsa-sha2-nistp384"

  • "ecdsa-sha2-nistp256"

  • "rsa-sha2-256"

  • "rsa-sha2-512"

  • "ssh-ed25519"

ssh_hsk_override

字符串

在 SSH 守护程序中启用/禁用 SSH 主机密钥覆盖。

选项

  • "disable"

  • "enable"

ssh_hsk_password

字符串

ssh-hostkey 的密码。

ssh_kex_algo

列表 / 元素=字符串

选择一个或多个 SSH 密钥交换算法。

选项

  • "diffie-hellman-group1-sha1"

  • "diffie-hellman-group14-sha1"

  • "diffie-hellman-group14-sha256"

  • "diffie-hellman-group16-sha512"

  • "diffie-hellman-group18-sha512"

  • "diffie-hellman-group-exchange-sha1"

  • "diffie-hellman-group-exchange-sha256"

  • "curve25519-sha256@libssh.org"

  • "ecdh-sha2-nistp256"

  • "ecdh-sha2-nistp384"

  • "ecdh-sha2-nistp521"

ssh_mac_algo

列表 / 元素=字符串

选择一个或多个 SSH MAC 算法。

选项

  • "hmac-md5"

  • "hmac-md5-etm@openssh.com"

  • "hmac-md5-96"

  • "hmac-md5-96-etm@openssh.com"

  • "hmac-sha1"

  • "hmac-sha1-etm@openssh.com"

  • "hmac-sha2-256"

  • "hmac-sha2-256-etm@openssh.com"

  • "hmac-sha2-512"

  • "hmac-sha2-512-etm@openssh.com"

  • "hmac-ripemd160"

  • "hmac-ripemd160@openssh.com"

  • "hmac-ripemd160-etm@openssh.com"

  • "umac-64@openssh.com"

  • "umac-128@openssh.com"

  • "umac-64-etm@openssh.com"

  • "umac-128-etm@openssh.com"

vdom

字符串

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

默认值: "root"

备注

注意

  • 旧版 fortiosapi 已弃用,httpapi 是运行剧本的首选方法。

示例

- name: Configure SSH config.
  fortinet.fortios.fortios_system_ssh_config:
      vdom: "{{ vdom }}"
      system_ssh_config:
          ssh_enc_algo: "chacha20-poly1305@openssh.com"
          ssh_hsk: "<your_own_value>"
          ssh_hsk_algo: "ssh-rsa"
          ssh_hsk_override: "disable"
          ssh_hsk_password: "<your_own_value>"
          ssh_kex_algo: "diffie-hellman-group1-sha1"
          ssh_mac_algo: "hmac-md5"

返回值

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

描述

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)

  • Miguel Angel Munoz (@mamunozgonzalez)

  • Nicolas Thomas (@thomnico)