fortiswitch_router_ospf – OSPF configuration in Fortinet’s FortiSwitch

New in version 1.0.0.

Synopsis

  • This module is able to configure a FortiSwitch device by allowing the user to set and modify router feature and ospf category. Examples include all parameters and values need to be adjusted to datasources before usage. Tested with FOS v7.0.0

Requirements

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

  • ansible>=2.14

FortiSW Version Compatibility


Supported Version Ranges
fortiswitch_router_ospf v7.0.0 -> latest

Parameters

  • enable_log - Enable/Disable logging for task. type: bool required: false default: False
  • member_path - Member attribute path to operate on. type: str
  • member_state - Add or delete a member under specified attribute path. type: str choices: present, absent
  • router_ospf - OSPF configuration. type: dict
    • abr_type - Area border router type. type: str choices: cisco, ibm, shortcut, standard
    • area - OSPF area configuration. type: list
      • default_cost - Summary default cost of stub or NSSA area. type: int
      • filter_list - OSPF area filter-list configuration. type: list
        • direction - Direction. type: str choices: in, out
        • id - Filter list entry ID. type: int
        • list - Access-list or prefix-list name. type: str
      • id - Area entry IP address. type: str
      • nssa_translator_role - NSSA translator role type. type: str choices: candidate, never, always
      • range - OSPF area range configuration. type: list
        • advertise - Enable/disable advertise status. type: str choices: disable, enable
        • id - Range entry ID. type: int
        • prefix - Prefix. type: str
        • substitute - Substitute prefix. type: str
        • substitute_status - Enable/disable substitute status. type: str choices: enable, disable
      • shortcut - Enable/disable shortcut option. type: str choices: disable, enable, default
      • stub_type - Stub summary setting. type: str choices: no-summary, summary
      • type - Area type setting. type: str choices: regular, nssa, stub
      • virtual_link - OSPF virtual link configuration. type: list
        • authentication - Authentication type. type: str choices: none, text, md5
        • authentication_key - Authentication key. type: str
        • dead_interval - Dead interval. type: int
        • hello_interval - Hello interval. type: int
        • md5_keys - OSPF md5 key configuration. Applicable only when authentication field is set to md5. type: list
          • id - key-id (1-255). type: int
          • key - md5-key. type: str
        • name - Virtual link entry name. type: str
        • peer - Peer IP. type: str
        • retransmit_interval - Time between retransmitting lost link state advertisements. type: int
        • transmit_delay - Link state transmit delay. type: int
    • database_overflow - Enable/disable database overflow. type: str choices: enable, disable
    • database_overflow_max_external_lsa - Database overflow maximum External LSAs. type: int
    • database_overflow_time_to_recover - Database overflow time to recover (sec). type: int
    • default_information_metric - Default information metric. type: int
    • default_information_metric_type - Default information metric type. type: str choices: 1, 2
    • default_information_originate - Enable/disable generation of default route. type: str choices: enable, always, disable
    • distance - Administrative distance. type: int
    • distance_external - Administrative external route distance. type: int
    • distance_inter_area - Administrative inter-area route distance. type: int
    • distance_intra_area - Administrative intra-area route distance. type: int
    • distribute_list - Redistribute routes filter. type: list
      • access_list - Access list name. type: str
      • id - Distribute list entry ID. type: int
      • protocol - Protocol type. type: str choices: connected, static, rip, bgp, isis
    • interface - OSPF interface configuration. type: list
      • authentication - Authentication type. type: str choices: none, text, md5
      • authentication_key - Authentication key. type: str
      • bfd - Bidirectional Forwarding Detection (BFD). type: str choices: enable, disable
      • cost - Cost of the interface. type: int
      • dead_interval - Dead interval. For fast-hello assign value 1. type: int
      • hello_interval - Hello interval. type: int
      • hello_multiplier - Number of hello packets within dead interval.Valid only for fast-hello. type: int
      • md5_keys - OSPF md5 key configuration. Applicable only when authentication field is set to md5. type: list
        • id - key-id (1-255). type: int
        • key - md5-key. type: str
      • mtu - Interface MTU. type: int
      • mtu_ignore - Disable MTU mismatch detection on this interface. type: str choices: enable, disable
      • name - Interface entry name. type: str
      • priority - Router priority. type: int
      • retransmit_interval - Time between retransmitting lost link state advertisements. type: int
      • transmit_delay - Link state transmit delay. type: int
      • ttl - TTL. type: int
      • ucast_ttl - Unicast TTL. type: int
    • log_neighbour_changes - Enable logging of OSPF neighbour"s changes type: str choices: enable, disable
    • name - Vrf name. type: str
    • network - Enable OSPF on an IP network. type: list
      • area - Attach the network to area. type: str
      • id - Network entry ID. type: int
      • prefix - Prefix. type: str
    • passive_interface - Passive interface configuration. type: list
      • name - Passive interface name. type: str
    • redistribute - Redistribute configuration. type: list
      • metric - Redistribute metric setting. type: int
      • metric_type - Metric type. type: str choices: 1, 2
      • name - Redistribute name. type: str
      • routemap - Route map name. type: str
      • status - status type: str choices: enable, disable
      • tag - Tag value. type: int
    • rfc1583_compatible - Enable/disable RFC1583 compatibility. type: str choices: enable, disable
    • router_id - Router ID. type: str
    • spf_timers - SPF calculation frequency. type: str
    • summary_address - Aggregate address for redistributed routes. type: list
      • id - Summary address entry ID. type: int
      • prefix - Prefix. type: str
      • tag - Tag value. type: int
    • vrf - Enable OSPF on VRF. type: list
      • abr_type - Area border router type. type: str choices: cisco, ibm, shortcut, standard
      • area - OSPF area configuration. type: list
        • default_cost - Summary default cost of stub or NSSA area. type: int
        • filter_list - OSPF area filter-list configuration. type: list
          • direction - Direction. type: str choices: in, out
          • id - Filter list entry ID. type: int
          • list - Access-list or prefix-list name. type: str
        • id - Area entry IP address. type: str
        • nssa_translator_role - NSSA translator role type. type: str choices: candidate, never, always
        • range - OSPF area range configuration. type: list
          • advertise - Enable/disable advertise status. type: str choices: disable, enable
          • id - Range entry ID. type: int
          • prefix - Prefix. type: str
          • substitute - Substitute prefix. type: str
          • substitute_status - Enable/disable substitute status. type: str choices: enable, disable
        • shortcut - Enable/disable shortcut option. type: str choices: disable, enable, default
        • stub_type - Stub summary setting. type: str choices: no-summary, summary
        • type - Area type setting. type: str choices: regular, nssa, stub
        • virtual_link - OSPF virtual link configuration. type: list
          • authentication - Authentication type. type: str choices: none, text
          • authentication_key - Authentication key. type: str
          • dead_interval - Dead interval. type: int
          • hello_interval - Hello interval. type: int
          • name - Virtual link entry name. type: str
          • peer - Peer IP. type: str
          • retransmit_interval - Time between retransmitting lost link state advertisements. type: int
          • transmit_delay - Link state transmit delay. type: int
      • database_overflow - Enable/disable database overflow. type: str choices: enable, disable
      • database_overflow_max_external_lsa - Database overflow maximum External LSAs. type: int
      • database_overflow_time_to_recover - Database overflow time to recover (sec). type: int
      • default_information_metric - Default information metric. type: int
      • default_information_metric_type - Default information metric type. type: str choices: 1, 2
      • default_information_originate - Enable/disable generation of default route. type: str choices: enable, always, disable
      • distance - Administrative distance. type: int
      • distance_external - Administrative external route distance. type: int
      • distance_inter_area - Administrative inter-area route distance. type: int
      • distance_intra_area - Administrative intra-area route distance. type: int
      • distribute_list - Redistribute routes filter. type: list
        • access_list - Access list name. type: str
        • id - Distribute list entry ID. type: int
        • protocol - Protocol type. type: str choices: connected, static, rip, bgp, isis
      • interface - OSPF interface configuration. type: list
        • authentication - Authentication type. type: str choices: none, text, md5
        • authentication_key - Authentication key. type: str
        • cost - Cost of the interface. type: int
        • dead_interval - Dead interval. For fast-hello assign value 1. type: int
        • hello_interval - Hello interval. type: int
        • hello_multiplier - Number of hello packets within dead interval.Valid only for fast-hello. type: int
        • md5_keys - OSPF md5 key configuration. Applicable only when authentication field is set to md5. type: list
          • id - key-id (1-255). type: int
          • key - md5-key. type: str
        • mtu - Interface MTU. type: int
        • mtu_ignore - Disable MTU mismatch detection on this interface. type: str choices: enable, disable
        • name - Interface entry name. type: str
        • priority - Router priority. type: int
        • retransmit_interval - Time between retransmitting lost link state advertisements. type: int
        • transmit_delay - Link state transmit delay. type: int
        • ttl - TTL. type: int
        • ucast_ttl - Unicast TTL. type: int
      • log_neighbour_changes - Enable logging of OSPF neighbour"s changes type: str choices: enable, disable
      • name - Vrf name. type: str
      • network - Enable OSPF on an IP network. type: list
        • area - Attach the network to area. type: str
        • id - Network entry ID. type: int
        • prefix - Prefix. type: str
      • passive_interface - Passive interface configuration. type: list
        • name - Passive interface name. type: str
      • redistribute - Redistribute configuration. type: list
        • metric - Redistribute metric setting. type: int
        • metric_type - Metric type. type: str choices: 1, 2
        • name - Redistribute name. type: str
        • routemap - Route map name. type: str
        • status - status type: str choices: enable, disable
        • tag - Tag value. type: int
      • rfc1583_compatible - Enable/disable RFC1583 compatibility. type: str choices: enable, disable
      • router_id - Router ID. type: str
      • spf_timers - SPF calculation frequency. type: str
      • summary_address - Aggregate address for redistributed routes. type: list
        • id - Summary address entry ID. type: int
        • prefix - Prefix. type: str
        • tag - Tag value. type: int

Examples

- name: OSPF configuration.
  fortinet.fortiswitch.fortiswitch_router_ospf:
      router_ospf:
          abr_type: "cisco"
          area:
              -
                  default_cost: "5"
                  filter_list:
                      -
                          direction: "in"
                          id: "8"
                          list: "<your_own_value> (source router.access-list.name router.prefix-list.name)"
                  id: "10"
                  nssa_translator_role: "candidate"
                  range:
                      -
                          advertise: "disable"
                          id: "14"
                          prefix: "<your_own_value>"
                          substitute: "<your_own_value>"
                          substitute_status: "enable"
                  shortcut: "disable"
                  stub_type: "no-summary"
                  type: "regular"
                  virtual_link:
                      -
                          authentication: "none"
                          authentication_key: "<your_own_value>"
                          dead_interval: "24"
                          hello_interval: "25"
                          md5_keys:
                              -
                                  id: "27"
                                  key: "<your_own_value>"
                          name: "default_name_29"
                          peer: "<your_own_value>"
                          retransmit_interval: "31"
                          transmit_delay: "32"
          database_overflow: "enable"
          database_overflow_max_external_lsa: "34"
          database_overflow_time_to_recover: "35"
          default_information_metric: "36"
          default_information_metric_type: "1"
          default_information_originate: "enable"
          distance: "39"
          distance_external: "40"
          distance_inter_area: "41"
          distance_intra_area: "42"
          distribute_list:
              -
                  access_list: "<your_own_value> (source router.access-list.name)"
                  id: "45"
                  protocol: "connected"
          interface:
              -
                  authentication: "none"
                  authentication_key: "<your_own_value>"
                  bfd: "enable"
                  cost: "51"
                  dead_interval: "52"
                  hello_interval: "53"
                  hello_multiplier: "54"
                  md5_keys:
                      -
                          id: "56"
                          key: "<your_own_value>"
                  mtu: "58"
                  mtu_ignore: "enable"
                  name: "default_name_60 (source system.interface.name)"
                  priority: "61"
                  retransmit_interval: "62"
                  transmit_delay: "63"
                  ttl: "64"
                  ucast_ttl: "65"
          log_neighbour_changes: "enable"
          name: "default_name_67"
          network:
              -
                  area: "<your_own_value>"
                  id: "70"
                  prefix: "<your_own_value>"
          passive_interface:
              -
                  name: "default_name_73 (source system.interface.name)"
          redistribute:
              -
                  metric: "75"
                  metric_type: "1"
                  name: "default_name_77"
                  routemap: "<your_own_value> (source router.route-map.name)"
                  status: "enable"
                  tag: "80"
          rfc1583_compatible: "enable"
          router_id: "<your_own_value>"
          spf_timers: "<your_own_value>"
          summary_address:
              -
                  id: "85"
                  prefix: "<your_own_value>"
                  tag: "87"
          vrf:
              -
                  abr_type: "cisco"
                  area:
                      -
                          default_cost: "91"
                          filter_list:
                              -
                                  direction: "in"
                                  id: "94"
                                  list: "<your_own_value> (source router.access-list.name router.prefix-list.name)"
                          id: "96"
                          nssa_translator_role: "candidate"
                          range:
                              -
                                  advertise: "disable"
                                  id: "100"
                                  prefix: "<your_own_value>"
                                  substitute: "<your_own_value>"
                                  substitute_status: "enable"
                          shortcut: "disable"
                          stub_type: "no-summary"
                          type: "regular"
                          virtual_link:
                              -
                                  authentication: "none"
                                  authentication_key: "<your_own_value>"
                                  dead_interval: "110"
                                  hello_interval: "111"
                                  name: "default_name_112"
                                  peer: "<your_own_value>"
                                  retransmit_interval: "114"
                                  transmit_delay: "115"
                  database_overflow: "enable"
                  database_overflow_max_external_lsa: "117"
                  database_overflow_time_to_recover: "118"
                  default_information_metric: "119"
                  default_information_metric_type: "1"
                  default_information_originate: "enable"
                  distance: "122"
                  distance_external: "123"
                  distance_inter_area: "124"
                  distance_intra_area: "125"
                  distribute_list:
                      -
                          access_list: "<your_own_value> (source router.access-list.name)"
                          id: "128"
                          protocol: "connected"
                  interface:
                      -
                          authentication: "none"
                          authentication_key: "<your_own_value>"
                          cost: "133"
                          dead_interval: "134"
                          hello_interval: "135"
                          hello_multiplier: "136"
                          md5_keys:
                              -
                                  id: "138"
                                  key: "<your_own_value>"
                          mtu: "140"
                          mtu_ignore: "enable"
                          name: "default_name_142 (source system.interface.name)"
                          priority: "143"
                          retransmit_interval: "144"
                          transmit_delay: "145"
                          ttl: "146"
                          ucast_ttl: "147"
                  log_neighbour_changes: "enable"
                  name: "default_name_149 (source router.vrf.name)"
                  network:
                      -
                          area: "<your_own_value>"
                          id: "152"
                          prefix: "<your_own_value>"
                  passive_interface:
                      -
                          name: "default_name_155 (source system.interface.name)"
                  redistribute:
                      -
                          metric: "157"
                          metric_type: "1"
                          name: "default_name_159"
                          routemap: "<your_own_value> (source router.route-map.name)"
                          status: "enable"
                          tag: "162"
                  rfc1583_compatible: "enable"
                  router_id: "<your_own_value>"
                  spf_timers: "<your_own_value>"
                  summary_address:
                      -
                          id: "167"
                          prefix: "<your_own_value>"
                          tag: "169"

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:

  • build - Build number of the fortiSwitch image returned: always type: str sample: 1547
  • http_method - Last method used to provision the content into FortiSwitch returned: always type: str sample: PUT
  • http_status - Last result given by FortiSwitch on last operation applied returned: always type: str sample: 200
  • mkey - Master key (id) used in the last call to FortiSwitch returned: success type: str sample: id
  • name - Name of the table used to fulfill the request returned: always type: str sample: urlfilter
  • path - Path of the table used to fulfill the request returned: always type: str sample: webfilter
  • serial - Serial number of the unit returned: always type: str sample: FS1D243Z13000122
  • status - Indication of the operation's result returned: always type: str sample: success
  • version - Version of the FortiSwitch returned: always type: str sample: v7.0.0

Status

  • This module is not guaranteed to have a backwards compatible interface.

Authors

  • Link Zheng (@chillancezen)

  • Jie Xue (@JieX19)

  • Hongbin Lu (@fgtdev-hblu)

  • Frank Shen (@frankshen01)

  • Miguel Angel Munoz (@mamunozgonzalez)

Hint

If you notice any issues in this documentation, you can create a pull request to improve it.