:source: fmgd_router_routemap_rule.py
:orphan:
.. _fmgd_router_routemap_rule:
fmgd_router_routemap_rule -- Rule.
++++++++++++++++++++++++++++++++++
.. versionadded:: 1.1.0
.. contents::
:local:
:depth: 1
Synopsis
--------
- This module is able to configure a FortiManager device.
- Examples include all parameters and values need to be adjusted to data sources before usage.
- Tested with FortiManager v7.x.
Requirements
------------
The below requirements are needed on the host that executes this module.
- ansible-core>=2.16.0
FortiManager Version Compatibility
----------------------------------
.. raw:: html
Supported Version Ranges: v7.4.8 -> v7.4.10, v7.6.4 -> latest
Parameters
----------
.. raw:: html
- access_token -The token to access FortiManager without using username and password. type: str required: false
- bypass_validation - Only set to True when module schema diffs with FortiManager API structure, module continues to execute without validating parameters. type: bool required: false default: False
- enable_log - Enable/Disable logging for task. type: bool required: false default: False
- forticloud_access_token - Access token of forticloud managed API users, this option is available with FortiManager later than 6.4.0. type: str required: false
- proposed_method - The overridden method for the underlying Json RPC request. type: str required: false choices: set, update, add
- rc_succeeded - The rc codes list with which the conditions to succeed will be overriden. type: list required: false
- rc_failed - The rc codes list with which the conditions to fail will be overriden. type: list required: false
- state - The directive to create, update or delete an object type: str required: true choices: present, absent
- workspace_locking_adom - Acquire the workspace lock if FortiManager is running in workspace mode. type: str required: false choices: global, custom adom including root
- workspace_locking_timeout - The maximum time in seconds to wait for other users to release workspace lock. type: integer required: false default: 300
- device - The parameter in requested url type: str required: true
- vdom - The parameter in requested url type: str required: true
- route_map - The parameter in requested url type: str required: true
- router_routemap_rule - Rule. type: dict
- action Action. type: str choices: [permit, deny]
more...
Supported Version Ranges: v7.4.8 -> v7.4.10, v7.6.4 -> latest
- id Rule id. type: int
more...
Supported Version Ranges: v7.4.8 -> v7.4.10, v7.6.4 -> latest
- match_as_path (Alias name: match-as-path) Match bgp as path list. type: list
more...
Supported Version Ranges: v7.4.8 -> v7.4.10, v7.6.4 -> latest
- match_community (Alias name: match-community) Match bgp community list. type: list
more...
Supported Version Ranges: v7.4.8 -> v7.4.10, v7.6.4 -> latest
- match_community_exact (Alias name: match-community-exact) Enable/disable exact matching of communities. type: str choices: [disable, enable]
more...
Supported Version Ranges: v7.4.8 -> v7.4.10, v7.6.4 -> latest
- match_extcommunity (Alias name: match-extcommunity) Match bgp extended community list. type: list
more...
Supported Version Ranges: v7.4.8 -> v7.4.10, v7.6.4 -> latest
- match_extcommunity_exact (Alias name: match-extcommunity-exact) Enable/disable exact matching of extended communities. type: str choices: [disable, enable]
more...
Supported Version Ranges: v7.4.8 -> v7.4.10, v7.6.4 -> latest
- match_flags (Alias name: match-flags) Match flags. type: int
more...
Supported Version Ranges: v7.4.8 -> v7.4.10, v7.6.4 -> latest
- match_interface (Alias name: match-interface) Support meta variable type: list
more...
Supported Version Ranges: v7.4.8 -> v7.4.10, v7.6.4 -> latest
- match_ip_address (Alias name: match-ip-address) Match ip address permitted by access-list or prefix-list. type: list
more...
Supported Version Ranges: v7.4.8 -> v7.4.10, v7.6.4 -> latest
- match_ip_nexthop (Alias name: match-ip-nexthop) Match next hop ip address passed by access-list or prefix-list. type: list
more...
Supported Version Ranges: v7.4.8 -> v7.4.10, v7.6.4 -> latest
- match_ip6_address (Alias name: match-ip6-address) Match ipv6 address permitted by access-list6 or prefix-list6. type: list
more...
Supported Version Ranges: v7.4.8 -> v7.4.10, v7.6.4 -> latest
- match_ip6_nexthop (Alias name: match-ip6-nexthop) Match next hop ipv6 address passed by access-list6 or prefix-list6. type: list
more...
Supported Version Ranges: v7.4.8 -> v7.4.10, v7.6.4 -> latest
- match_metric (Alias name: match-metric) Match metric for redistribute routes. type: str
more...
Supported Version Ranges: v7.4.8 -> v7.4.10, v7.6.4 -> latest
- match_origin (Alias name: match-origin) Match bgp origin code. type: str choices: [none, egp, igp, incomplete]
more...
Supported Version Ranges: v7.4.8 -> v7.4.10, v7.6.4 -> latest
- match_route_type (Alias name: match-route-type) Match route type. type: str choices: [none, external-type1, external-type2, 2, 1]
more...
Supported Version Ranges: v7.4.8 -> v7.4.10, v7.6.4 -> latest
- match_tag (Alias name: match-tag) Match tag. type: str
more...
Supported Version Ranges: v7.4.8 -> v7.4.10, v7.6.4 -> latest
- match_vrf (Alias name: match-vrf) Match vrf id. type: int
more...
Supported Version Ranges: v7.4.8 -> v7.4.10, v7.6.4 -> latest
- set_aggregator_as (Alias name: set-aggregator-as) Bgp aggregator as. type: int
more...
Supported Version Ranges: v7.4.8 -> v7.4.10, v7.6.4 -> latest
- set_aggregator_ip (Alias name: set-aggregator-ip) Bgp aggregator ip. type: str
more...
Supported Version Ranges: v7.4.8 -> v7.4.10, v7.6.4 -> latest
- set_aspath (Alias name: set-aspath) Prepend bgp as path attribute. type: list
more...
Supported Version Ranges: v7.4.8 -> v7.4.10, v7.6.4 -> latest
- set_aspath_action (Alias name: set-aspath-action) Specify preferred action of set-aspath. type: str choices: [prepend, replace]
more...
Supported Version Ranges: v7.4.8 -> v7.4.10, v7.6.4 -> latest
- set_atomic_aggregate (Alias name: set-atomic-aggregate) Enable/disable bgp atomic aggregate attribute. type: str choices: [disable, enable]
more...
Supported Version Ranges: v7.4.8 -> v7.4.10, v7.6.4 -> latest
- set_community (Alias name: set-community) Bgp community attribute. type: list
more...
Supported Version Ranges: v7.4.8 -> v7.4.10, v7.6.4 -> latest
- set_community_additive (Alias name: set-community-additive) Enable/disable adding set-community to existing community. type: str choices: [disable, enable]
more...
Supported Version Ranges: v7.4.8 -> v7.4.10, v7.6.4 -> latest
- set_community_delete (Alias name: set-community-delete) Delete communities matching community list. type: list
more...
Supported Version Ranges: v7.4.8 -> v7.4.10, v7.6.4 -> latest
- set_dampening_max_suppress (Alias name: set-dampening-max-suppress) Maximum duration to suppress a route (1 - 255 min, 0 = unset). type: int
more...
Supported Version Ranges: v7.4.8 -> v7.4.10, v7.6.4 -> latest
- set_dampening_reachability_half_life (Alias name: set-dampening-reachability-half-life) Reachability half-life time for the penalty (1 - 45 min, 0 = unset). type: int
more...
Supported Version Ranges: v7.4.8 -> v7.4.10, v7.6.4 -> latest
- set_dampening_reuse (Alias name: set-dampening-reuse) Value to start reusing a route (1 - 20000, 0 = unset). type: int
more...
Supported Version Ranges: v7.4.8 -> v7.4.10, v7.6.4 -> latest
- set_dampening_suppress (Alias name: set-dampening-suppress) Value to start suppressing a route (1 - 20000, 0 = unset). type: int
more...
Supported Version Ranges: v7.4.8 -> v7.4.10, v7.6.4 -> latest
- set_dampening_unreachability_half_life (Alias name: set-dampening-unreachability-half-life) Unreachability half-life time for the penalty (1 - 45 min, 0 = unset). type: int
more...
Supported Version Ranges: v7.4.8 -> v7.4.10, v7.6.4 -> latest
- set_extcommunity_rt (Alias name: set-extcommunity-rt) Route target extended community. type: list
more...
Supported Version Ranges: v7.4.8 -> v7.4.10, v7.6.4 -> latest
- set_extcommunity_soo (Alias name: set-extcommunity-soo) Site-of-origin extended community. type: list
more...
Supported Version Ranges: v7.4.8 -> v7.4.10, v7.6.4 -> latest
- set_flags (Alias name: set-flags) Set flags. type: int
more...
Supported Version Ranges: v7.4.8 -> v7.4.10, v7.6.4 -> latest
- set_ip_nexthop (Alias name: set-ip-nexthop) Ip address of next hop. type: str
more...
Supported Version Ranges: v7.4.8 -> v7.4.10, v7.6.4 -> latest
- set_ip_prefsrc (Alias name: set-ip-prefsrc) Ip address of preferred source. type: str
more...
Supported Version Ranges: v7.4.8 -> v7.4.10, v7.6.4 -> latest
- set_ip6_nexthop (Alias name: set-ip6-nexthop) Ipv6 global address of next hop. type: str
more...
Supported Version Ranges: v7.4.8 -> v7.4.10, v7.6.4 -> latest
- set_ip6_nexthop_local (Alias name: set-ip6-nexthop-local) Ipv6 local address of next hop. type: str
more...
Supported Version Ranges: v7.4.8 -> v7.4.10, v7.6.4 -> latest
- set_local_preference (Alias name: set-local-preference) Bgp local preference path attribute. type: str
more...
Supported Version Ranges: v7.4.8 -> v7.4.10, v7.6.4 -> latest
- set_metric (Alias name: set-metric) Metric value. type: int
more...
Supported Version Ranges: v7.4.8 -> v7.4.10, v7.6.4 -> latest
- set_metric_type (Alias name: set-metric-type) Metric type. type: str choices: [none, external-type1, external-type2, 2, 1]
more...
Supported Version Ranges: v7.4.8 -> v7.4.10, v7.6.4 -> latest
- set_origin (Alias name: set-origin) Bgp origin code. type: str choices: [none, egp, igp, incomplete]
more...
Supported Version Ranges: v7.4.8 -> v7.4.10, v7.6.4 -> latest
- set_originator_id (Alias name: set-originator-id) Bgp originator id attribute. type: str
more...
Supported Version Ranges: v7.4.8 -> v7.4.10, v7.6.4 -> latest
- set_priority (Alias name: set-priority) Priority for routing table. type: int
more...
Supported Version Ranges: v7.4.8 -> v7.4.10, v7.6.4 -> latest
- set_route_tag (Alias name: set-route-tag) Route tag for routing table. type: str
more...
Supported Version Ranges: v7.4.8 -> v7.4.10, v7.6.4 -> latest
- set_tag (Alias name: set-tag) Tag value. type: int
more...
Supported Version Ranges: v7.4.8 -> v7.4.10, v7.6.4 -> latest
- set_vpnv4_nexthop (Alias name: set-vpnv4-nexthop) Ip address of vpnv4 next-hop. type: str
more...
Supported Version Ranges: v7.4.8 -> v7.4.10, v7.6.4 -> latest
- set_vpnv6_nexthop (Alias name: set-vpnv6-nexthop) Ipv6 global address of vpnv6 next-hop. type: str
more...
Supported Version Ranges: v7.4.8 -> v7.4.10, v7.6.4 -> latest
- set_vpnv6_nexthop_local (Alias name: set-vpnv6-nexthop-local) Ipv6 link-local address of vpnv6 next-hop. type: str
more...
Supported Version Ranges: v7.4.8 -> v7.4.10, v7.6.4 -> latest
- set_weight (Alias name: set-weight) Bgp weight for routing table. type: str
more...
Supported Version Ranges: v7.4.8 -> v7.4.10, v7.6.4 -> latest
- match_suppress (Alias name: match-suppress) Enable/disable matching of suppressed original neighbor. type: str choices: [disable, enable]
more...
Supported Version Ranges: v7.6.5 -> latest
Notes
-----
.. note::
- Running in workspace locking mode is supported in this FortiManager module, the top level parameters workspace_locking_adom and workspace_locking_timeout help do the work.
- To create or update an object, use state: present directive.
- To delete an object, use state: absent directive
- Normally, running one module can fail when a non-zero rc is returned. you can also override the conditions to fail or succeed with parameters rc_failed and rc_succeeded
Examples
--------
.. code-block:: yaml+jinja
- name: Example playbook (generated based on argument schema)
hosts: fortimanagers
connection: httpapi
gather_facts: false
vars:
ansible_httpapi_use_ssl: true
ansible_httpapi_validate_certs: false
ansible_httpapi_port: 443
tasks:
- name: Rule.
fortinet.fmgdevice.fmgd_router_routemap_rule:
# bypass_validation: false
# workspace_locking_adom:
# workspace_locking_timeout: 300
# rc_succeeded: [0, -2, -3, ...]
# rc_failed: [-2, -3, ...]
device:
vdom:
route_map:
state: present #
router_routemap_rule:
id: 0 # Required variable, integer
# action:
# match_as_path:
# match_community:
# match_community_exact:
# match_extcommunity:
# match_extcommunity_exact:
# match_flags:
# match_interface:
# match_ip_address:
# match_ip_nexthop:
# match_ip6_address:
# match_ip6_nexthop:
# match_metric:
# match_origin:
# match_route_type:
# match_tag:
# match_vrf:
# set_aggregator_as:
# set_aggregator_ip:
# set_aspath:
# set_aspath_action:
# set_atomic_aggregate:
# set_community:
# set_community_additive:
# set_community_delete:
# set_dampening_max_suppress:
# set_dampening_reachability_half_life:
# set_dampening_reuse:
# set_dampening_suppress:
# set_dampening_unreachability_half_life:
# set_extcommunity_rt:
# set_extcommunity_soo:
# set_flags:
# set_ip_nexthop:
# set_ip_prefsrc:
# set_ip6_nexthop:
# set_ip6_nexthop_local:
# set_local_preference:
# set_metric:
# set_metric_type:
# set_origin:
# set_originator_id:
# set_priority:
# set_route_tag:
# set_tag:
# set_vpnv4_nexthop:
# set_vpnv6_nexthop:
# set_vpnv6_nexthop_local:
# set_weight:
# match_suppress:
Return Values
-------------
Common return values are documented: https://docs.ansible.com/ansible/latest/reference_appendices/common_return_values.html#common-return-values, the following are the fields unique to this module:
.. raw:: html
- meta - The result of the request.returned: always type: dict
- request_url - The full url requested. returned: always type: str sample: /sys/login/user
- response_code - The status of api request. returned: always type: int sample: 0
- response_data - The data body of the api response. returned: optional type: list or dict
- response_message - The descriptive message of the api response. returned: always type: str sample: OK
- system_information - The information of the target system. returned: always type: dict
- rc - The status the request. returned: always type: int sample: 0
- version_check_warning - Warning if the parameters used in the playbook are not supported by the current FortiManager version. returned: if at least one parameter not supported by the current FortiManager version type: list
Status
------
- This module is not guaranteed to have a backwards compatible interface.
Authors
-------
- Xinwei Du (@dux-fortinet)
- Xing Li (@lix-fortinet)
- Jie Xue (@JieX19)
- Link Zheng (@chillancezen)
- Frank Shen (@fshen01)
- Hongbin Lu (@fgtdev-hblu)