• 博客
  • Ansible 社区论坛
  • 文档
Ansible Logo
Ansible 社区文档
Ansible

Ansible 入门

  • Ansible 入门指南
  • 执行环境入门指南

安装、升级和配置

  • 安装指南
  • Ansible 移植指南

使用 Ansible

  • 构建 Ansible 清单
  • 使用 Ansible 命令行工具
  • 使用 Ansible playbook
  • 使用 Ansible vault 保护敏感数据
  • 使用 Ansible 模块和插件
  • 使用 Ansible 集合
  • 在 Windows 和 BSD 上使用 Ansible
  • Ansible 提示和技巧

为 Ansible 贡献代码

  • Ansible 社区指南
  • Ansible 集合贡献者指南
  • ansible-core 贡献者指南
  • 高级贡献者指南
  • Ansible 文档样式指南

扩展 Ansible

  • 开发者指南

常见的 Ansible 场景

  • 旧版公共云指南

网络自动化

  • 网络入门
  • 网络高级主题
  • 网络开发者指南

Ansible Galaxy

  • Galaxy 用户指南
  • Galaxy 开发者指南

参考和附录

  • 集合索引
    • Amazon 命名空间中的集合
    • Ansible 命名空间中的集合
    • Arista 命名空间中的集合
    • AWX 命名空间中的集合
    • Azure 命名空间中的集合
    • Check Point 命名空间中的集合
    • Chocolatey 命名空间中的集合
    • Cisco 命名空间中的集合
    • Cloud 命名空间中的集合
    • Cloudscale_ch 命名空间中的集合
    • Community 命名空间中的集合
    • Containers 命名空间中的集合
    • CyberArk 命名空间中的集合
    • Dell EMC 命名空间中的集合
    • F5 Networks 命名空间中的集合
    • Fortinet 命名空间中的集合
      • Fortinet.Fortimanager
      • Fortinet.Fortios
        • 描述
        • 插件索引
    • FRR 命名空间中的集合
    • Gluster 命名空间中的集合
    • Google 命名空间中的集合
    • Grafana 命名空间中的集合
    • Hetzner 命名空间中的集合
    • HPE 命名空间中的集合
    • IBM 命名空间中的集合
    • IEISystem 命名空间中的集合
    • Infinidat 命名空间中的集合
    • Infoblox 命名空间中的集合
    • Inspur 命名空间中的集合
    • Juniper Networks 命名空间中的集合
    • Kaytus 命名空间中的集合
    • Kubernetes 命名空间中的集合
    • KubeVirt 命名空间中的集合
    • LowlyDBA 命名空间中的集合
    • Mellanox 命名空间中的集合
    • Microsoft 命名空间中的集合
    • NetApp 命名空间中的集合
    • NetApp_eSeries 命名空间中的集合
    • NetBox 命名空间中的集合
    • NGINX IO 命名空间中的集合
    • OpenStack 命名空间中的集合
    • Open vSwitch 命名空间中的集合
    • oVirt 命名空间中的集合
    • PureStorage 命名空间中的集合
    • Sensu 命名空间中的集合
    • ServiceNow 命名空间中的集合
    • Splunk 命名空间中的集合
    • T-Systems MMS 命名空间中的集合
    • Telekom MMS 命名空间中的集合
    • The Foreman 命名空间中的集合
    • VMware 命名空间中的集合
    • Vultr 命名空间中的集合
    • VyOS 命名空间中的集合
    • WTI 命名空间中的集合
  • 所有模块和插件的索引
  • Playbook 关键词
  • 返回值
  • Ansible 配置设置
  • 控制 Ansible 的行为:优先级规则
  • YAML 语法
  • Python 3 支持
  • 解释器发现
  • 发行版和维护
  • 测试策略
  • 完整性测试
  • 常见问题
  • 词汇表
  • Ansible 参考:模块实用程序
  • 特殊变量
  • Red Hat Ansible Automation Platform
  • Ansible Automation Hub
  • 记录 Ansible 输出

路线图

  • Ansible 路线图
  • ansible-core 路线图




Ansible
  • 集合索引
  • Fortinet 命名空间中的集合
  • Fortinet.Fortios
  • fortinet.fortios.fortios_system_link_monitor 模块 – 配置 Fortinet 的 FortiOS 和 FortiGate 中的链路健康监控。


fortinet.fortios.fortios_system_link_monitor 模块 – 配置 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_system_link_monitor。

fortinet.fortios 2.0.0 中的新增功能

  • 概要

  • 要求

  • 参数

  • 备注

  • 示例

  • 返回值

概要

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

system_link_monitor

字典

配置链路健康监控。

addr_mode

字符串

地址模式 (IPv4 或 IPv6)。

选项

  • "ipv4"

  • "ipv6"

class_id

整数

流量类别 ID。来源 firewall.traffic-class.class-id。

diffservcode

字符串

探测数据包的 IP 头中的区分服务代码点 (DSCP)。

fail_weight

整数

触发链路故障警报的阈值权重。

failtime

整数

在服务器被认为已宕机之前的重试次数 (1 - 3600)。

gateway_ip

字符串

用于探测服务器的网关 IP 地址。

gateway_ip6

字符串

用于探测服务器的网关 IPv6 地址。

ha_priority

整数

HA 选举优先级 (1 - 50)。

http_agent

字符串

HTTP 头中 http-agent 字段中的字符串。

http_get

字符串

如果您正在监控 HTML 服务器,您可以发送带有自定义字符串的 HTTP-GET 请求。使用此选项定义字符串。

http_match

字符串

您期望在要监控的流量的 HTTP-GET 请求中看到的字符串。

interval

整数

检测间隔,以毫秒为单位 (20 - 3600 * 1000 毫秒)。

name

字符串 / 必需

链路监控名称。

packet_size

整数

TWAMP 测试会话的数据包大小 (124/158 - 1024)。

password

字符串

身份验证模式下的 TWAMP 控制器密码。

port

整数

用于监控服务器的流量的端口号。

probe_count

整数

应用于计算延迟和抖动的最近探测次数 (5 - 30)。

probe_timeout

整数

在探测数据包被认为丢失之前等待的时间 (20 - 5000 毫秒)。

protocol

列表 / 元素=字符串

用于监控服务器的协议。

选项

  • "ping"

  • "tcp-echo"

  • "udp-echo"

  • "http"

  • "https"

  • "twamp"

  • "ping6"

recoverytime

整数

在服务器被认为已恢复之前收到的成功响应数 (1 - 3600)。

route

列表 / 元素=字典

要监控的子网。

subnet

字符串 / 必需

IP 地址和网络掩码 (x.x.x.x/y)。

security_mode

字符串

Twamp 控制器安全模式。

选项

  • "none"

  • "authentication"

server

列表 / 元素=字典

要监控的服务器的 IP 地址。

address

字符串 / 必需

服务器地址。

server_config

字符串

服务器配置模式。

选项

  • "default"

  • "individual"

server_list

列表 / 元素=字典

链路监控要监控的服务器。

dst

字符串

要监控的服务器的 IP 地址。

id

整数 / 必需

服务器 ID。参见 备注。

port

整数

用于监控服务器的流量的端口号。

protocol

列表 / 元素=字符串

用于监控服务器的协议。

选项

  • "ping"

  • "tcp-echo"

  • "udp-echo"

  • "http"

  • "https"

  • "twamp"

weight

整数

此目标的监控器的权重 (0 - 255)。

server_type

字符串

服务器类型 (静态或动态)。

选项

  • "static"

  • "dynamic"

service_detection

字符串

仅使用监控器读取质量值。如果启用,则不会更新静态路由和级联接口。

选项

  • "enable"

  • "disable"

source_ip

字符串

数据包中使用的源 IP 地址到服务器。

source_ip6

字符串

数据包中使用的源 IPv6 地址到服务器。

srcintf

字符串

接收要监控的流量的接口。来源 system.interface.name。

status

字符串

启用/禁用此链路监控器。

选项

  • "enable"

  • "disable"

update_cascade_interface

字符串

启用/禁用更新级联接口。

选项

  • "enable"

  • "disable"

update_policy_route

字符串

启用/禁用更新策略路由。

选项

  • "enable"

  • "disable"

update_static_route

字符串

启用/禁用更新静态路由。

选项

  • "enable"

  • "disable"

vdom

字符串

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

默认值: "root"

注释

注意

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

  • 此模块支持 check_mode。

示例

- name: Configure Link Health Monitor.
  fortinet.fortios.fortios_system_link_monitor:
      vdom: "{{ vdom }}"
      state: "present"
      access_token: "<your_own_value>"
      system_link_monitor:
          addr_mode: "ipv4"
          class_id: "0"
          diffservcode: "<your_own_value>"
          fail_weight: "0"
          failtime: "5"
          gateway_ip: "<your_own_value>"
          gateway_ip6: "<your_own_value>"
          ha_priority: "1"
          http_agent: "<your_own_value>"
          http_get: "<your_own_value>"
          http_match: "<your_own_value>"
          interval: "500"
          name: "default_name_15"
          packet_size: "124"
          password: "<your_own_value>"
          port: "0"
          probe_count: "30"
          probe_timeout: "500"
          protocol: "ping"
          recoverytime: "5"
          route:
              -
                  subnet: "<your_own_value>"
          security_mode: "none"
          server:
              -
                  address: "<your_own_value>"
          server_config: "default"
          server_list:
              -
                  dst: "<your_own_value>"
                  id: "31"
                  port: "0"
                  protocol: "ping"
                  weight: "0"
          server_type: "static"
          service_detection: "enable"
          source_ip: "84.230.14.43"
          source_ip6: "<your_own_value>"
          srcintf: "<your_own_value> (source system.interface.name)"
          status: "enable"
          update_cascade_interface: "enable"
          update_policy_route: "enable"
          update_static_route: "enable"

返回值

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

键

描述

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"

作者

  • Link Zheng (@chillancezen)

  • 薛杰 (@JieX19)

  • 卢宏斌 (@fgtdev-hblu)

  • 沈芳 (@frankshen01)

  • Miguel Angel Munoz (@mamunozgonzalez)

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

收藏链接

  • 问题跟踪器
  • 主页
  • 代码库 (源代码)
上一篇 下一篇

© 版权所有 Ansible 项目贡献者。 上次更新于 2024 年 12 月 19 日。