fortinet.fortios.fortios_firewall_address6 模块 – 在 Fortinet 的 FortiOS 和 FortiGate 中配置 IPv6 防火墙地址。

注意

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

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

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

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

fortinet.fortios 2.0.0 中的新增功能

概要

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

要求

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

  • ansible>=2.15

参数

参数

注释

access_token

字符串

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

enable_log

布尔值

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

选项

  • false ← (默认)

  • true

firewall_address6

字典

配置 IPv6 防火墙地址。

cache_ttl

整数

FQDN 缓存中单个 IPv6 地址的最小 TTL。

color

整数

确定 GUI 中图标颜色的整数值 (范围 1 到 32)。

comment

字符串

注释。

country

字符串

与特定国家/地区关联的 IPv6 地址。

end_ip

字符串

地址范围内最后一个 IP 地址(包含)(格式:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx)。

end_mac

字符串

范围内最后一个 MAC 地址。

epg_name

字符串

端点组名称。

fabric_object

字符串

安全结构全局对象设置。

选项

  • "enable"

  • "disable"

fqdn

字符串

完全限定域名。

host

字符串

主机地址。

host_type

字符串

主机类型。

选项

  • "any"

  • "specific"

ip6

字符串

IPv6 地址前缀(格式:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx/xxx)。

list

列表 / 元素=字典

IP 地址列表。

ip

字符串 / 必需

IP。

net_id

字符串

网络 ID。

obj_id

字符串

对象 ID。

macaddr

列表 / 元素=字典

多个 MAC 地址范围。

macaddr

字符串 / 必需

MAC 地址范围 <start>[-<end>] 用空格分隔。

name

字符串 / 必需

地址名称。

obj_id

字符串

NSX 的对象 ID。

route_tag

整数

路由标签地址。

sdn

字符串

SDN。源系统.sdn-connector.name。

选项

  • "nsx"

sdn_tag

字符串

SDN 标签。

start_ip

字符串

地址范围内第一个 IP 地址(包含)(格式:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx)。

start_mac

字符串

范围内第一个 MAC 地址。

subnet_segment

列表 / 元素=字典

IPv6 子网段。

name

字符串 / 必需

名称。

type

字符串

子网段类型。

选项

  • "any"

  • "specific"

value

字符串

子网段值。

tagging

列表 / 元素=字典

配置对象标记。

category

字符串

标签类别。源系统.object-tagging.category。

name

字符串 / 必需

标签条目名称。

tags

列表 / 元素=字典

标签。

name

字符串 / 必需

标签名称。源系统.object-tagging.tags.name。

template

字符串

IPv6 地址模板。源 firewall.address6-template.name。

tenant

字符串

租户。

type

字符串

IPv6 地址对象的类型。

选项

  • "ipprefix"

  • "iprange"

  • "fqdn"

  • "geography"

  • "dynamic"

  • "template"

  • "mac"

  • "route-tag"

uuid

字符串

通用唯一标识符 (UUID;自动分配,但可以手动重置)。

visibility

字符串

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

选项

  • "enable"

  • "disable"

member_path

字符串

要操作的成员属性路径。

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

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

member_state

字符串

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

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

选项

  • "present"

  • "absent"

state

字符串 / 必需

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

选项

  • "present"

  • "absent"

vdom

字符串

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

默认值: "root"

备注

注意

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

  • 此模块支持 check_mode。

示例

- name: Configure IPv6 firewall addresses.
  fortinet.fortios.fortios_firewall_address6:
      vdom: "{{ vdom }}"
      state: "present"
      access_token: "<your_own_value>"
      firewall_address6:
          cache_ttl: "0"
          color: "0"
          comment: "Comment."
          country: "<your_own_value>"
          end_ip: "<your_own_value>"
          end_mac: "<your_own_value>"
          epg_name: "<your_own_value>"
          fabric_object: "enable"
          fqdn: "<your_own_value>"
          host: "myhostname"
          host_type: "any"
          ip6: "<your_own_value>"
          list:
              -
                  ip: "<your_own_value>"
                  net_id: "<your_own_value>"
                  obj_id: "<your_own_value>"
          macaddr:
              -
                  macaddr: "<your_own_value>"
          name: "default_name_21"
          obj_id: "<your_own_value>"
          route_tag: "0"
          sdn: "nsx"
          sdn_tag: "<your_own_value>"
          start_ip: "<your_own_value>"
          start_mac: "<your_own_value>"
          subnet_segment:
              -
                  name: "default_name_29"
                  type: "any"
                  value: "<your_own_value>"
          tagging:
              -
                  category: "<your_own_value> (source system.object-tagging.category)"
                  name: "default_name_34"
                  tags:
                      -
                          name: "default_name_36 (source system.object-tagging.tags.name)"
          template: "<your_own_value> (source firewall.address6-template.name)"
          tenant: "<your_own_value>"
          type: "ipprefix"
          uuid: "<your_own_value>"
          visibility: "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"

作者

  • 郑连 (@chillancezen)

  • 薛洁 (@JieX19)

  • 陆洪斌 (@fgtdev-hblu)

  • 沈方 (@frankshen01)

  • Miguel Angel Munoz (@mamunozgonzalez)

  • Nicolas Thomas (@thomnico)