fortinet.fortimanager.fmgr_router_routemap_rule 模块 – 规则。
注意
此模块是 fortinet.fortimanager 集合 (版本 2.8.2) 的一部分。
如果您使用的是 ansible 包,则可能已安装此集合。它不包含在 ansible-core 中。要检查它是否已安装,请运行 ansible-galaxy collection list。
要安装它,请使用: ansible-galaxy collection install fortinet.fortimanager。
要在剧本中使用它,请指定: fortinet.fortimanager.fmgr_router_routemap_rule。
fortinet.fortimanager 2.1.0 中的新增功能
概要
- 此模块能够配置 FortiManager 设备。 
- 示例包含所有需要在使用前根据数据源调整的参数和值。 
参数
| 参数 | 注释 | 
|---|---|
| 无需用户名和密码即可访问 FortiManager 的令牌。 | |
| 请求 URL 中的参数 (adom)。 | |
| 仅当模块模式与 FortiManager API 结构不同时设置为 True,模块将继续执行而无需验证参数。 选项 
 | |
| 启用/禁用任务的日志记录。 选项 
 | |
| 使用 FortiCloud API 访问令牌验证 Ansible 客户端。 | |
| 底层 Json RPC 请求的覆盖方法。 选项 
 | |
| 将覆盖失败条件的 rc 代码列表。 | |
| 将覆盖成功条件的 rc 代码列表。 | |
| 已弃用,请使用“route_map” | |
| 请求 URL 中的参数 (route-map)。 | |
| 设置的顶级参数。 | |
| 动作。 选项 
 | |
| 规则 ID。 | |
| 匹配 BGP AS 路径列表。 | |
| 匹配 BGP 社区列表。 | |
| 启用/禁用社区的精确匹配。 选项 
 | |
| 匹配 BGP 扩展社区列表。 | |
| 启用/禁用扩展社区的精确匹配。 选项 
 | |
| 匹配标志。 | |
| 匹配接口配置。 | |
| 匹配 access-list6 或 prefix-list6 允许的 IPv6 地址。 | |
| 匹配 access-list6 或 prefix-list6 传递的下一跳 IPv6 地址。 | |
| 匹配 access-list 或 prefix-list 允许的 IP 地址。 | |
| 匹配 access-list 或 prefix-list 传递的下一跳 IP 地址。 | |
| 匹配重新分配路由的度量。 | |
| 匹配 BGP 源代码。 选项 
 | |
| 匹配路由类型。 选项 
 | |
| 匹配标签。 | |
| 匹配 VRF ID。 | |
| BGP 聚合器 AS。 | |
| BGP 聚合器 IP。 | |
| (列表) 预先添加 BGP AS 路径属性。 | |
| 指定 set-aspath 的首选操作。 选项 
 | |
| 启用/禁用 BGP 原子聚合属性。 选项 
 | |
| (列表) BGP 社区属性。 | |
| 启用/禁用将 set-community 添加到现有社区。 选项 
 | |
| 删除与社区列表匹配的社区。 | |
| 抑制路由的最大持续时间 | |
| 惩罚的可达性半衰期时间 | |
| 开始重用路由的值 | |
| 开始抑制路由的值 | |
| 惩罚的不可达性半衰期时间 | |
| (列表) 路由目标扩展社区。 | |
| (列表) 源站点扩展社区。 | |
| 设置标志。 | |
| 下一跳的IPv6全局地址。 | |
| 下一跳的IPv6本地地址。 | |
| 下一跳的IP地址。 | |
| 首选源的IP地址。 | |
| BGP本地首选路径属性。 | |
| 度量值。 | |
| 度量类型。 选项 
 | |
| BGP源代码。 选项 
 | |
| BGP发起者ID属性。 | |
| 路由表的优先级。 | |
| 路由表的路由标签。 | |
| 标签值。 | |
| VPNv4下一跳的IP地址。 | |
| VPNv6下一跳的IPv6全局地址。 | |
| VPNv6下一跳的IPv6链路本地地址。 | |
| 路由表的BGP权重。 | |
| 创建、更新或删除对象的指令。 选项 
 | |
| 在工作区模式下运行FortiManager时要锁定的ADOM,值可以是全局和其他值,包括root。 | |
| 等待其他用户释放工作区锁的最大时间(秒)。 默认值:  | 
备注
注意
- 从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: Rule.
      fortinet.fortimanager.fmgr_router_routemap_rule:
        # 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>
        route_map: <your own value>
        state: present # <value in [present, absent]>
        router_routemap_rule:
          action: <value in [permit, deny]>
          id: <integer>
          match_as_path: <string>
          match_community: <string>
          match_community_exact: <value in [disable, enable]>
          match_flags: <integer>
          match_interface: <string>
          match_ip_address: <string>
          match_ip_nexthop: <string>
          match_ip6_address: <string>
          match_ip6_nexthop: <string>
          match_metric: <string>
          match_origin: <value in [none, egp, igp, ...]>
          match_route_type: <value in [1, 2, none, ...]>
          match_tag: <string>
          match_vrf: <integer>
          set_aggregator_as: <integer>
          set_aggregator_ip: <string>
          set_aspath: <list or string>
          set_aspath_action: <value in [prepend, replace]>
          set_atomic_aggregate: <value in [disable, enable]>
          set_community: <list or string>
          set_community_additive: <value in [disable, enable]>
          set_community_delete: <string>
          set_dampening_max_suppress: <integer>
          set_dampening_reachability_half_life: <integer>
          set_dampening_reuse: <integer>
          set_dampening_suppress: <integer>
          set_dampening_unreachability_half_life: <integer>
          set_extcommunity_rt: <list or string>
          set_extcommunity_soo: <list or string>
          set_flags: <integer>
          set_ip_nexthop: <string>
          set_ip6_nexthop: <string>
          set_ip6_nexthop_local: <string>
          set_local_preference: <string>
          set_metric: <string>
          set_metric_type: <value in [1, 2, none, ...]>
          set_origin: <value in [none, egp, igp, ...]>
          set_originator_id: <string>
          set_priority: <integer>
          set_route_tag: <string>
          set_tag: <string>
          set_weight: <string>
          match_extcommunity: <string>
          match_extcommunity_exact: <value in [disable, enable]>
          set_ip_prefsrc: <string>
          set_vpnv4_nexthop: <string>
          set_vpnv6_nexthop: <string>
          set_vpnv6_nexthop_local: <string>
返回值
常用的返回值已记录在此处,以下是此模块特有的字段
| 键 | 描述 | 
|---|---|
| 请求的结果。 返回:始终 | |
| 请求的完整URL。 返回:始终 示例:  | |
| API请求的状态。 返回:始终 示例:  | |
| API响应。 返回:始终 | |
| API响应的描述性消息。 返回:始终 示例:  | |
| 目标系统的信息。 返回:始终 | |
| 请求的状态。 返回:始终 示例:  | |
| 如果剧本中使用的参数不受当前FortiManager版本支持,则会发出警告。 返回:复杂类型 | 
