fortios_system_ha – Configure HA in Fortinet’s FortiOS and FortiGate.

New in version 2.0.0.

Synopsis

  • This module is able to configure a FortiGate or FortiOS (FOS) device by allowing the user to set and modify system feature and ha category. Examples include all parameters and values need to be adjusted to datasources before usage. Tested with FOS v6.0.0

Requirements

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

  • ansible>=2.14

Tips

Using member operation to add an element to an existing object.

FortiOS Version Compatibility


Supported Version Ranges
fortios_system_ha v6.0.0 -> latest

Parameters

  • access_token - Token-based authentication. Generated from GUI of Fortigate. type: str required: false
  • enable_log - Enable/Disable logging for task. type: bool required: false default: False
  • vdom - Virtual domain, among those defined previously. A vdom is a virtual instance of the FortiGate that can be configured and used as a different unit. type: str default: root
  • 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
  • system_ha - Configure HA. type: dict more...
    • arps - Number of gratuitous ARPs (1 - 60). Lower to reduce traffic. Higher to reduce failover time. type: int more...
    • arps_interval - Time between gratuitous ARPs (1 - 20 sec). Lower to reduce failover time. Higher to reduce traffic. type: int more...
    • authentication - Enable/disable heartbeat message authentication. type: str choices: enable, disable more...
    • cpu_threshold - Dynamic weighted load balancing CPU usage weight and high and low thresholds. type: str more...
    • encryption - Enable/disable heartbeat message encryption. type: str choices: enable, disable more...
    • evpn_ttl - HA EVPN FDB TTL on primary box (5 - 3600 sec). type: int more...
    • failover_hold_time - Time to wait before failover (0 - 300 sec), to avoid flip. type: int more...
    • ftp_proxy_threshold - Dynamic weighted load balancing weight and high and low number of FTP proxy sessions. type: str more...
    • gratuitous_arps - Enable/disable gratuitous ARPs. Disable if link-failed-signal enabled. type: str choices: enable, disable more...
    • group_id - HA group ID (0 - 1023; or 0 - 7 when there are more than 2 vclusters). Must be the same for all members. type: int more...
    • group_name - Cluster group name. Must be the same for all members. type: str more...
    • ha_direct - Enable/disable using ha-mgmt interface for syslog, remote authentication (RADIUS), FortiAnalyzer, FortiSandbox, sFlow, and Netflow. type: str choices: enable, disable more...
    • ha_eth_type - HA heartbeat packet Ethertype (4-digit hex). type: str more...
    • ha_mgmt_interfaces - Reserve interfaces to manage individual cluster units. type: list member_path: ha_mgmt_interfaces:id more...
      • dst - Default route destination for reserved HA management interface. type: str more...
      • gateway - Default route gateway for reserved HA management interface. type: str more...
      • gateway6 - Default IPv6 gateway for reserved HA management interface. type: str more...
      • id - Table ID. see Notes. type: int required: true more...
      • interface - Interface to reserve for HA management. Source system.interface.name. type: str more...
    • ha_mgmt_status - Enable to reserve interfaces to manage individual cluster units. type: str choices: enable, disable more...
    • ha_uptime_diff_margin - Normally you would only reduce this value for failover testing. type: int more...
    • hb_interval - Time between sending heartbeat packets (1 - 20). Increase to reduce false positives. type: int more...
    • hb_interval_in_milliseconds - Units of heartbeat interval time between sending heartbeat packets. Default is 100ms. type: str choices: 100ms, 10ms more...
    • hb_lost_threshold - Number of lost heartbeats to signal a failure (1 - 60). Increase to reduce false positives. type: int more...
    • hbdev - Heartbeat interfaces. Must be the same for all members. type: list
    • hc_eth_type - Transparent mode HA heartbeat packet Ethertype (4-digit hex). type: str more...
    • hello_holddown - Time to wait before changing from hello to work state (5 - 300 sec). type: int more...
    • http_proxy_threshold - Dynamic weighted load balancing weight and high and low number of HTTP proxy sessions. type: str more...
    • imap_proxy_threshold - Dynamic weighted load balancing weight and high and low number of IMAP proxy sessions. type: str more...
    • inter_cluster_session_sync - Enable/disable synchronization of sessions among HA clusters. type: str choices: enable, disable more...
    • key - Key. type: str more...
    • l2ep_eth_type - Telnet session HA heartbeat packet Ethertype (4-digit hex). type: str more...
    • link_failed_signal - Enable to shut down all interfaces for 1 sec after a failover. Use if gratuitous ARPs do not update network. type: str choices: enable, disable more...
    • load_balance_all - Enable to load balance TCP sessions. Disable to load balance proxy sessions only. type: str choices: enable, disable more...
    • logical_sn - Enable/disable usage of the logical serial number. type: str choices: enable, disable more...
    • memory_based_failover - Enable/disable memory based failover. type: str choices: enable, disable more...
    • memory_compatible_mode - Enable/disable memory compatible mode. type: str choices: enable, disable more...
    • memory_failover_flip_timeout - Time to wait between subsequent memory based failovers in minutes (6 - 2147483647). type: int more...
    • memory_failover_monitor_period - Duration of high memory usage before memory based failover is triggered in seconds (1 - 300). type: int more...
    • memory_failover_sample_rate - Rate at which memory usage is sampled in order to measure memory usage in seconds (1 - 60). type: int more...
    • memory_failover_threshold - Memory usage threshold to trigger memory based failover (0 means using conserve mode threshold in system.global). type: int more...
    • memory_threshold - Dynamic weighted load balancing memory usage weight and high and low thresholds. type: str more...
    • mode - HA mode. Must be the same for all members. FGSP requires standalone. type: str choices: standalone, a-a, a-p more...
    • monitor - Interfaces to check for port monitoring (or link failure). Source system.interface.name. type: list
    • multicast_ttl - HA multicast TTL on primary (5 - 3600 sec). type: int more...
    • nntp_proxy_threshold - Dynamic weighted load balancing weight and high and low number of NNTP proxy sessions. type: str more...
    • override - Enable and increase the priority of the unit that should always be primary (master). type: str choices: enable, disable more...
    • override_wait_time - Delay negotiating if override is enabled (0 - 3600 sec). Reduces how often the cluster negotiates. type: int more...
    • password - Cluster password. Must be the same for all members. type: str more...
    • pingserver_failover_threshold - Remote IP monitoring failover threshold (0 - 50). type: int more...
    • pingserver_flip_timeout - Time to wait in minutes before renegotiating after a remote IP monitoring failover. type: int more...
    • pingserver_monitor_interface - Interfaces to check for remote IP monitoring. Source system.interface.name. type: list
    • pingserver_secondary_force_reset - Enable to force the cluster to negotiate after a remote IP monitoring failover. type: str choices: enable, disable more...
    • pingserver_slave_force_reset - Enable to force the cluster to negotiate after a remote IP monitoring failover. type: str choices: enable, disable more...
    • pop3_proxy_threshold - Dynamic weighted load balancing weight and high and low number of POP3 proxy sessions. type: str more...
    • priority - Increase the priority to select the primary unit (0 - 255). type: int more...
    • route_hold - Time to wait between routing table updates to the cluster (0 - 3600 sec). type: int more...
    • route_ttl - TTL for primary unit routes (5 - 3600 sec). Increase to maintain active routes during failover. type: int more...
    • route_wait - Time to wait before sending new routes to the cluster (0 - 3600 sec). type: int more...
    • schedule - Type of A-A load balancing. Use none if you have external load balancers. type: str choices: none, leastconnection, round-robin, weight-round-robin, random, ip, ipport, hub more...
    • secondary_vcluster - Configure virtual cluster 2. type: dict more...
      • monitor - Interfaces to check for port monitoring (or link failure). Source system.interface.name. type: list
      • override - Enable and increase the priority of the unit that should always be primary. type: str choices: enable, disable more...
      • override_wait_time - Delay negotiating if override is enabled (0 - 3600 sec). Reduces how often the cluster negotiates. type: int more...
      • pingserver_failover_threshold - Remote IP monitoring failover threshold (0 - 50). type: int more...
      • pingserver_monitor_interface - Interfaces to check for remote IP monitoring. Source system.interface.name. type: list
      • pingserver_secondary_force_reset - Enable to force the cluster to negotiate after a remote IP monitoring failover. type: str choices: enable, disable more...
      • pingserver_slave_force_reset - Enable to force the cluster to negotiate after a remote IP monitoring failover. type: str choices: enable, disable more...
      • priority - Increase the priority to select the primary unit (0 - 255). type: int more...
      • vcluster_id - Cluster ID. type: int more...
      • vdom - VDOMs in virtual cluster 2. type: str more...
    • session_pickup - Enable/disable session pickup. Enabling it can reduce session down time when fail over happens. type: str choices: enable, disable more...
    • session_pickup_connectionless - Enable/disable UDP and ICMP session sync. type: str choices: enable, disable more...
    • session_pickup_delay - Enable to sync sessions longer than 30 sec. Only longer lived sessions need to be synced. type: str choices: enable, disable more...
    • session_pickup_expectation - Enable/disable session helper expectation session sync for FGSP. type: str choices: enable, disable more...
    • session_pickup_nat - Enable/disable NAT session sync for FGSP. type: str choices: enable, disable more...
    • session_sync_dev - Offload session-sync process to kernel and sync sessions using connected interface(s) directly. Source system.interface.name. type: list
    • smtp_proxy_threshold - Dynamic weighted load balancing weight and high and low number of SMTP proxy sessions. type: str more...
    • ssd_failover - Enable/disable automatic HA failover on SSD disk failure. type: str choices: enable, disable more...
    • standalone_config_sync - Enable/disable FGSP configuration synchronization. type: str choices: enable, disable more...
    • standalone_mgmt_vdom - Enable/disable standalone management VDOM. type: str choices: enable, disable more...
    • sync_config - Enable/disable configuration synchronization. type: str choices: enable, disable more...
    • sync_packet_balance - Enable/disable HA packet distribution to multiple CPUs. type: str choices: enable, disable more...
    • unicast_gateway - Default route gateway for unicast interface. type: str more...
    • unicast_hb - Enable/disable unicast heartbeat. type: str choices: enable, disable more...
    • unicast_hb_netmask - Unicast heartbeat netmask. type: str more...
    • unicast_hb_peerip - Unicast heartbeat peer IP. type: str more...
    • unicast_peers - Number of unicast peers. type: list member_path: unicast_peers:id more...
      • id - Table ID. see Notes. type: int required: true more...
      • peer_ip - Unicast peer IP. type: str more...
    • unicast_status - Enable/disable unicast connection. type: str choices: enable, disable more...
    • uninterruptible_primary_wait - Number of minutes the primary HA unit waits before the secondary HA unit is considered upgraded and the system is started before starting its own upgrade (15 - 300). type: int more...
    • uninterruptible_upgrade - Enable to upgrade a cluster without blocking network traffic. type: str choices: enable, disable more...
    • upgrade_mode - The mode to upgrade a cluster. type: str choices: simultaneous, uninterruptible, local-only, secondary-only more...
    • vcluster - Virtual cluster table. type: list member_path: vcluster:vcluster_id more...
      • monitor - Interfaces to check for port monitoring (or link failure). Source system.interface.name. type: list
      • override - Enable and increase the priority of the unit that should always be primary (master). type: str choices: enable, disable more...
      • override_wait_time - Delay negotiating if override is enabled (0 - 3600 sec). Reduces how often the cluster negotiates. type: int more...
      • pingserver_failover_threshold - Remote IP monitoring failover threshold (0 - 50). type: int more...
      • pingserver_monitor_interface - Interfaces to check for remote IP monitoring. Source system.interface.name. type: list
      • pingserver_secondary_force_reset - Enable to force the cluster to negotiate after a remote IP monitoring failover. type: str choices: enable, disable more...
      • pingserver_slave_force_reset - Enable to force the cluster to negotiate after a remote IP monitoring failover. type: str choices: enable, disable more...
      • priority - Increase the priority to select the primary unit (0 - 255). type: int more...
      • vcluster_id - ID. see Notes. type: int required: true more...
      • vdom - Virtual domain(s) in the virtual cluster. type: list member_path: vcluster:vcluster_id/vdom:name more...
        • name - Virtual domain name. Source system.vdom.name. type: str required: true more...
    • vcluster_id - Cluster ID. type: int more...
    • vcluster_status - Enable/disable virtual cluster for virtual clustering. type: str choices: enable, disable more...
    • vcluster2 - Enable/disable virtual cluster 2 for virtual clustering. type: str choices: enable, disable more...
    • vdom - VDOMs in virtual cluster 1. type: str more...
    • weight - Weight-round-robin weight for each cluster unit. Syntax . type: str more...

Notes

Note

  • Legacy fortiosapi has been deprecated, httpapi is the preferred way to run playbooks

Examples

- name: Configure HA.
  fortinet.fortios.fortios_system_ha:
      vdom: "{{ vdom }}"
      system_ha:
          arps: "5"
          arps_interval: "8"
          authentication: "enable"
          cpu_threshold: "<your_own_value>"
          encryption: "enable"
          evpn_ttl: "60"
          failover_hold_time: "0"
          ftp_proxy_threshold: "<your_own_value>"
          gratuitous_arps: "enable"
          group_id: "0"
          group_name: "<your_own_value>"
          ha_direct: "enable"
          ha_eth_type: "<your_own_value>"
          ha_mgmt_interfaces:
              -
                  dst: "<your_own_value>"
                  gateway: "<your_own_value>"
                  gateway6: "<your_own_value>"
                  id: "20"
                  interface: "<your_own_value> (source system.interface.name)"
          ha_mgmt_status: "enable"
          ha_uptime_diff_margin: "300"
          hb_interval: "2"
          hb_interval_in_milliseconds: "100ms"
          hb_lost_threshold: "20"
          hbdev: "<your_own_value>"
          hc_eth_type: "<your_own_value>"
          hello_holddown: "20"
          http_proxy_threshold: "<your_own_value>"
          imap_proxy_threshold: "<your_own_value>"
          inter_cluster_session_sync: "enable"
          key: "<your_own_value>"
          l2ep_eth_type: "<your_own_value>"
          link_failed_signal: "enable"
          load_balance_all: "enable"
          logical_sn: "enable"
          memory_based_failover: "enable"
          memory_compatible_mode: "enable"
          memory_failover_flip_timeout: "6"
          memory_failover_monitor_period: "60"
          memory_failover_sample_rate: "1"
          memory_failover_threshold: "0"
          memory_threshold: "<your_own_value>"
          mode: "standalone"
          monitor: "<your_own_value> (source system.interface.name)"
          multicast_ttl: "600"
          nntp_proxy_threshold: "<your_own_value>"
          override: "enable"
          override_wait_time: "0"
          password: "<your_own_value>"
          pingserver_failover_threshold: "0"
          pingserver_flip_timeout: "60"
          pingserver_monitor_interface: "<your_own_value> (source system.interface.name)"
          pingserver_secondary_force_reset: "enable"
          pingserver_slave_force_reset: "enable"
          pop3_proxy_threshold: "<your_own_value>"
          priority: "128"
          route_hold: "10"
          route_ttl: "10"
          route_wait: "0"
          schedule: "none"
          secondary_vcluster:
              monitor: "<your_own_value> (source system.interface.name)"
              override: "enable"
              override_wait_time: "0"
              pingserver_failover_threshold: "0"
              pingserver_monitor_interface: "<your_own_value> (source system.interface.name)"
              pingserver_secondary_force_reset: "enable"
              pingserver_slave_force_reset: "enable"
              priority: "128"
              vcluster_id: "1"
              vdom: "<your_own_value>"
          session_pickup: "enable"
          session_pickup_connectionless: "enable"
          session_pickup_delay: "enable"
          session_pickup_expectation: "enable"
          session_pickup_nat: "enable"
          session_sync_dev: "<your_own_value> (source system.interface.name)"
          smtp_proxy_threshold: "<your_own_value>"
          ssd_failover: "enable"
          standalone_config_sync: "enable"
          standalone_mgmt_vdom: "enable"
          sync_config: "enable"
          sync_packet_balance: "enable"
          unicast_gateway: "<your_own_value>"
          unicast_hb: "enable"
          unicast_hb_netmask: "<your_own_value>"
          unicast_hb_peerip: "<your_own_value>"
          unicast_peers:
              -
                  id: "91"
                  peer_ip: "<your_own_value>"
          unicast_status: "enable"
          uninterruptible_primary_wait: "30"
          uninterruptible_upgrade: "enable"
          upgrade_mode: "simultaneous"
          vcluster:
              -
                  monitor: "<your_own_value> (source system.interface.name)"
                  override: "enable"
                  override_wait_time: "0"
                  pingserver_failover_threshold: "0"
                  pingserver_monitor_interface: "<your_own_value> (source system.interface.name)"
                  pingserver_secondary_force_reset: "enable"
                  pingserver_slave_force_reset: "enable"
                  priority: "128"
                  vcluster_id: "<you_own_value>"
                  vdom:
                      -
                          name: "default_name_108 (source system.vdom.name)"
          vcluster_id: "0"
          vcluster_status: "enable"
          vcluster2: "enable"
          vdom: "<your_own_value>"
          weight: "<your_own_value>"

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 fortigate image returned: always type: str sample: 1547
  • http_method - Last method used to provision the content into FortiGate returned: always type: str sample: PUT
  • http_status - Last result given by FortiGate on last operation applied returned: always type: str sample: 200
  • mkey - Master key (id) used in the last call to FortiGate 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
  • revision - Internal revision number returned: always type: str sample: 17.0.2.10658
  • serial - Serial number of the unit returned: always type: str sample: FGVMEVYYQT3AB5352
  • status - Indication of the operation's result returned: always type: str sample: success
  • vdom - Virtual domain used returned: always type: str sample: root
  • version - Version of the FortiGate returned: always type: str sample: v5.6.3

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)

  • Nicolas Thomas (@thomnico)

Hint

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