fortios_system_modem – Configure MODEM in Fortinet’s FortiOS and FortiGate.

New in version 2.10.

Synopsis

  • This module is able to configure a FortiGate or FortiOS (FOS) device by allowing the user to set and modify system feature and modem 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.9.0

Parameters

  • access_token - Token-based authentication. Generated from GUI of Fortigate. type: str required: 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
  • system_modem - Configure MODEM. type: dict
    • action - Dial up/stop MODEM. type: str choices: dial, stop, none
    • altmode - Enable/disable altmode for installations using PPP in China. type: str choices: enable, disable
    • authtype1 - Allowed authentication types for ISP 1. type: str choices: pap, chap, mschap, mschapv2
    • authtype2 - Allowed authentication types for ISP 2. type: str choices: pap, chap, mschap, mschapv2
    • authtype3 - Allowed authentication types for ISP 3. type: str choices: pap, chap, mschap, mschapv2
    • auto_dial - Enable/disable auto-dial after a reboot or disconnection. type: str choices: enable, disable
    • connect_timeout - Connection completion timeout (30 - 255 sec). type: int
    • dial_cmd1 - Dial command (this is often an ATD or ATDT command). type: str
    • dial_cmd2 - Dial command (this is often an ATD or ATDT command). type: str
    • dial_cmd3 - Dial command (this is often an ATD or ATDT command). type: str
    • dial_on_demand - Enable/disable to dial the modem when packets are routed to the modem interface. type: str choices: enable, disable
    • distance - Distance of learned routes (1 - 255). type: int
    • dont_send_CR1 - Do not send CR when connected (ISP1). type: str choices: enable, disable
    • dont_send_CR2 - Do not send CR when connected (ISP2). type: str choices: enable, disable
    • dont_send_CR3 - Do not send CR when connected (ISP3). type: str choices: enable, disable
    • extra_init1 - Extra initialization string to ISP 1. type: str
    • extra_init2 - Extra initialization string to ISP 2. type: str
    • extra_init3 - Extra initialization string to ISP 3. type: str
    • holddown_timer - Hold down timer in seconds (1 - 60 sec). type: int
    • idle_timer - MODEM connection idle time (1 - 9999 min). type: int
    • interface - Name of redundant interface. Source system.interface.name. type: str
    • lockdown_lac - Allow connection only to the specified Location Area Code (LAC). type: str
    • mode - Set MODEM operation mode to redundant or standalone. type: str choices: standalone, redundant
    • network_init - AT command to set the Network name/type (AT+COPS=,[,[,]]). type: str
    • passwd1 - Password to access the specified dialup account. type: str
    • passwd2 - Password to access the specified dialup account. type: str
    • passwd3 - Password to access the specified dialup account. type: str
    • peer_modem1 - Specify peer MODEM type for phone1. type: str choices: generic, actiontec, ascend_TNT
    • peer_modem2 - Specify peer MODEM type for phone2. type: str choices: generic, actiontec, ascend_TNT
    • peer_modem3 - Specify peer MODEM type for phone3. type: str choices: generic, actiontec, ascend_TNT
    • phone1 - Phone number to connect to the dialup account (must not contain spaces, and should include standard special characters). type: str
    • phone2 - Phone number to connect to the dialup account (must not contain spaces, and should include standard special characters). type: str
    • phone3 - Phone number to connect to the dialup account (must not contain spaces, and should include standard special characters). type: str
    • pin_init - AT command to set the PIN (AT+PIN=). type: str
    • ppp_echo_request1 - Enable/disable PPP echo-request to ISP 1. type: str choices: enable, disable
    • ppp_echo_request2 - Enable/disable PPP echo-request to ISP 2. type: str choices: enable, disable
    • ppp_echo_request3 - Enable/disable PPP echo-request to ISP 3. type: str choices: enable, disable
    • priority - Priority of learned routes (0 - 4294967295). type: int
    • redial - Redial limit (1 - 10 attempts, none = redial forever). type: str choices: none, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10
    • reset - Number of dial attempts before resetting modem (0 = never reset). type: int
    • status - Enable/disable Modem support (equivalent to bringing an interface up or down). type: str choices: enable, disable
    • traffic_check - Enable/disable traffic-check. type: str choices: enable, disable
    • username1 - User name to access the specified dialup account. type: str
    • username2 - User name to access the specified dialup account. type: str
    • username3 - User name to access the specified dialup account. type: str
    • wireless_port - Enter wireless port number, 0 for default, 1 for first port, ... (0 - 4294967295) type: int

Notes

Note

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

Examples

- hosts: fortigates
  collections:
    - fortinet.fortios
  connection: httpapi
  vars:
   vdom: "root"
   ansible_httpapi_use_ssl: yes
   ansible_httpapi_validate_certs: no
   ansible_httpapi_port: 443
  tasks:
  - name: Configure MODEM.
    fortios_system_modem:
      vdom:  "{{ vdom }}"
      system_modem:
        action: "dial"
        altmode: "enable"
        authtype1: "pap"
        authtype2: "pap"
        authtype3: "pap"
        auto_dial: "enable"
        connect_timeout: "9"
        dial_cmd1: "<your_own_value>"
        dial_cmd2: "<your_own_value>"
        dial_cmd3: "<your_own_value>"
        dial_on_demand: "enable"
        distance: "14"
        dont_send_CR1: "enable"
        dont_send_CR2: "enable"
        dont_send_CR3: "enable"
        extra_init1: "<your_own_value>"
        extra_init2: "<your_own_value>"
        extra_init3: "<your_own_value>"
        holddown_timer: "21"
        idle_timer: "22"
        interface: "<your_own_value> (source system.interface.name)"
        lockdown_lac: "<your_own_value>"
        mode: "standalone"
        network_init: "<your_own_value>"
        passwd1: "<your_own_value>"
        passwd2: "<your_own_value>"
        passwd3: "<your_own_value>"
        peer_modem1: "generic"
        peer_modem2: "generic"
        peer_modem3: "generic"
        phone1: "<your_own_value>"
        phone2: "<your_own_value>"
        phone3: "<your_own_value>"
        pin_init: "<your_own_value>"
        ppp_echo_request1: "enable"
        ppp_echo_request2: "enable"
        ppp_echo_request3: "enable"
        priority: "40"
        redial: "none"
        reset: "42"
        status: "enable"
        traffic_check: "enable"
        username1: "<your_own_value>"
        username2: "<your_own_value>"
        username3: "<your_own_value>"
        wireless_port: "48"

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.