fmgr_router_routemap – Configure route maps.

Added in version 2.1.0.

Warning

Starting in version 3.0.0, all input arguments will be named using the underscore naming convention (snake_case).

  • Argument name before 3.0.0: var-name, var name, var.name

  • New argument name starting in 3.0.0: var_name

FortiManager Ansible v2.4+ supports both previous argument name and new underscore name. You will receive deprecation warnings if you keep using the previous argument name. You can ignore the warning by setting deprecation_warnings=False in ansible.cfg.

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 v6.x and v7.x.

Requirements

The below requirements are needed on the host that executes this module.

  • ansible>=2.15.0

FortiManager Version Compatibility

Supported Version Ranges: v7.0.2 -> latest

Parameters

  • 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
  • adom - The parameter in requested url type: str required: true
  • router_routemap - Configure route maps. type: dict
    • comments Optional comments. type: str more...
    • name Name. type: str more...
    • rule type: list more...
      • action Action. type: str choices: [permit, deny] more...
      • id Rule id. type: int more...
      • match_as_path (Alias name: match-as-path) Match bgp as path list. type: str more...
      • match_community (Alias name: match-community) Match bgp community list. type: str more...
      • match_community_exact (Alias name: match-community-exact) Enable/disable exact matching of communities. type: str choices: [disable, enable] more...
      • match_flags (Alias name: match-flags) type: int more...
      • match_interface (Alias name: match-interface) Match interface configuration. type: str more...
      • match_ip_address (Alias name: match-ip-address) Match ip address permitted by access-list or prefix-list. type: str more...
      • match_ip_nexthop (Alias name: match-ip-nexthop) Match next hop ip address passed by access-list or prefix-list. type: str more...
      • match_ip6_address (Alias name: match-ip6-address) Match ipv6 address permitted by access-list6 or prefix-list6. type: str more...
      • match_ip6_nexthop (Alias name: match-ip6-nexthop) Match next hop ipv6 address passed by access-list6 or prefix-list6. type: str more...
      • match_metric (Alias name: match-metric) Match metric for redistribute routes. type: str more...
      • match_origin (Alias name: match-origin) Match bgp origin code. type: str choices: [none, egp, igp, incomplete] more...
      • match_route_type (Alias name: match-route-type) Match route type. type: str choices: [1, 2, none, external-type1, external-type2] more...
      • match_tag (Alias name: match-tag) Match tag. type: str more...
      • match_vrf (Alias name: match-vrf) Match vrf id. type: int more...
      • set_aggregator_as (Alias name: set-aggregator-as) Bgp aggregator as. type: int more...
      • set_aggregator_ip (Alias name: set-aggregator-ip) Bgp aggregator ip. type: str more...
      • set_aspath (Alias name: set-aspath) type: list more...
      • set_aspath_action (Alias name: set-aspath-action) Specify preferred action of set-aspath. type: str choices: [prepend, replace] more...
      • set_atomic_aggregate (Alias name: set-atomic-aggregate) Enable/disable bgp atomic aggregate attribute. type: str choices: [disable, enable] more...
      • set_community (Alias name: set-community) type: list more...
      • set_community_additive (Alias name: set-community-additive) Enable/disable adding set-community to existing community. type: str choices: [disable, enable] more...
      • set_community_delete (Alias name: set-community-delete) Delete communities matching community list. type: str more...
      • set_dampening_max_suppress (Alias name: set-dampening-max-suppress) Maximum duration to suppress a route (1 - 255 min, 0 = unset). type: int more...
      • 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...
      • set_dampening_reuse (Alias name: set-dampening-reuse) Value to start reusing a route (1 - 20000, 0 = unset). type: int more...
      • set_dampening_suppress (Alias name: set-dampening-suppress) Value to start suppressing a route (1 - 20000, 0 = unset). type: int more...
      • 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...
      • set_extcommunity_rt (Alias name: set-extcommunity-rt) type: list more...
      • set_extcommunity_soo (Alias name: set-extcommunity-soo) type: list more...
      • set_flags (Alias name: set-flags) type: int more...
      • set_ip_nexthop (Alias name: set-ip-nexthop) Ip address of next hop. type: str more...
      • set_ip6_nexthop (Alias name: set-ip6-nexthop) Ipv6 global address of next hop. type: str more...
      • set_ip6_nexthop_local (Alias name: set-ip6-nexthop-local) Ipv6 local address of next hop. type: str more...
      • set_local_preference (Alias name: set-local-preference) Bgp local preference path attribute. type: str more...
      • set_metric (Alias name: set-metric) Metric value. type: str more...
      • set_metric_type (Alias name: set-metric-type) Metric type. type: str choices: [1, 2, none, external-type1, external-type2] more...
      • set_origin (Alias name: set-origin) Bgp origin code. type: str choices: [none, egp, igp, incomplete] more...
      • set_originator_id (Alias name: set-originator-id) Bgp originator id attribute. type: str more...
      • set_priority (Alias name: set-priority) Priority for routing table. type: int more...
      • set_route_tag (Alias name: set-route-tag) Route tag for routing table. type: str more...
      • set_tag (Alias name: set-tag) Tag value. type: str more...
      • set_weight (Alias name: set-weight) Bgp weight for routing table. type: str more...
      • match_extcommunity (Alias name: match-extcommunity) Match bgp extended community list. type: str more...
      • match_extcommunity_exact (Alias name: match-extcommunity-exact) Enable/disable exact matching of extended communities. type: str choices: [disable, enable] more...
      • set_ip_prefsrc (Alias name: set-ip-prefsrc) Ip address of preferred source. type: str more...
      • set_vpnv4_nexthop (Alias name: set-vpnv4-nexthop) Ip address of vpnv4 next-hop. type: str more...
      • set_vpnv6_nexthop (Alias name: set-vpnv6-nexthop) Ipv6 global address of vpnv6 next-hop. type: str more...
      • set_vpnv6_nexthop_local (Alias name: set-vpnv6-nexthop-local) Ipv6 link-local address of vpnv6 next-hop. type: str more...

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

- 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: Configure route maps.
      fortinet.fortimanager.fmgr_router_routemap:
        # 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>
        state: present # <value in [present, absent]>
        router_routemap:
          comments: <string>
          name: <string>
          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>

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:

  • 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)