fmgd_system_modem – Configure MODEM.

Added in version 1.0.0.

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

Supported Version Ranges: v7.2.6 -> v7.2.12, v7.4.3 -> 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
  • 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
  • system_modem - Configure MODEM. type: dict
    • altmode Enable/disable altmode for installations using ppp in china. type: str choices: [disable, enable] more...
    • authtype1 Allowed authentication types for isp 1. type: list choices: [pap, chap, mschapv2, mschap] more...
    • authtype2 Allowed authentication types for isp 2. type: list choices: [pap, chap, mschapv2, mschap] more...
    • authtype3 Allowed authentication types for isp 3. type: list choices: [pap, chap, mschapv2, mschap] more...
    • auto_dial (Alias name: auto-dial) Enable/disable auto-dial after a reboot or disconnection. type: str choices: [disable, enable] more...
    • connect_timeout (Alias name: connect-timeout) Connection completion timeout (30 - 255 sec, default = 90). type: int more...
    • dial_cmd1 (Alias name: dial-cmd1) Dial command (this is often an atd or atdt command). type: str more...
    • dial_cmd2 (Alias name: dial-cmd2) Dial command (this is often an atd or atdt command). type: str more...
    • dial_cmd3 (Alias name: dial-cmd3) Dial command (this is often an atd or atdt command). type: str more...
    • dial_on_demand (Alias name: dial-on-demand) Enable/disable to dial the modem when packets are routed to the modem interface. type: str choices: [disable, enable] more...
    • distance Distance of learned routes (1 - 255, default = 1). type: int more...
    • dont_send_CR1 (Alias name: dont-send-CR1) Do not send cr when connected (isp1). type: str choices: [disable, enable] more...
    • dont_send_CR2 (Alias name: dont-send-CR2) Do not send cr when connected (isp2). type: str choices: [disable, enable] more...
    • dont_send_CR3 (Alias name: dont-send-CR3) Do not send cr when connected (isp3). type: str choices: [disable, enable] more...
    • extra_init1 (Alias name: extra-init1) Extra initialization string to isp 1. type: str more...
    • extra_init2 (Alias name: extra-init2) Extra initialization string to isp 2. type: str more...
    • extra_init3 (Alias name: extra-init3) Extra initialization string to isp 3. type: str more...
    • holddown_timer (Alias name: holddown-timer) Hold down timer in seconds (1 - 60 sec). type: int more...
    • idle_timer (Alias name: idle-timer) Modem connection idle time (1 - 9999 min, default = 5). type: int more...
    • interface Name of redundant interface. type: list more...
    • lockdown_lac (Alias name: lockdown-lac) Allow connection only to the specified location area code (lac). type: str more...
    • mode Set modem operation mode to redundant or standalone. type: str choices: [standalone, redundant] more...
    • network_init (Alias name: network-init) At command to set the network name/type (at+cops=,[,[,]]). type: str more...
    • passwd1 Password to access the specified dialup account. type: list more...
    • passwd2 Password to access the specified dialup account. type: list more...
    • passwd3 Password to access the specified dialup account. type: list more...
    • peer_modem1 (Alias name: peer-modem1) Specify peer modem type for phone1. type: str choices: [generic, actiontec, ascend_TNT] more...
    • peer_modem2 (Alias name: peer-modem2) Specify peer modem type for phone2. type: str choices: [generic, actiontec, ascend_TNT] more...
    • peer_modem3 (Alias name: peer-modem3) Specify peer modem type for phone3. type: str choices: [generic, actiontec, ascend_TNT] more...
    • phone1 Phone number to connect to the dialup account (must not contain spaces, and should include standard special characters). type: str more...
    • phone2 Phone number to connect to the dialup account (must not contain spaces, and should include standard special characters). type: str more...
    • phone3 Phone number to connect to the dialup account (must not contain spaces, and should include standard special characters). type: str more...
    • pin_init (Alias name: pin-init) At command to set the pin (at+pin=). type: str more...
    • ppp_echo_request1 (Alias name: ppp-echo-request1) Enable/disable ppp echo-request to isp 1. type: str choices: [disable, enable] more...
    • ppp_echo_request2 (Alias name: ppp-echo-request2) Enable/disable ppp echo-request to isp 2. type: str choices: [disable, enable] more...
    • ppp_echo_request3 (Alias name: ppp-echo-request3) Enable/disable ppp echo-request to isp 3. type: str choices: [disable, enable] more...
    • priority Priority of learned routes (1 - 65535, default = 1). type: int more...
    • redial Redial limit (1 - 10 attempts, none = redial forever). type: str choices: [none, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10] more...
    • reset Number of dial attempts before resetting modem (0 = never reset). type: int more...
    • status Enable/disable modem support (equivalent to bringing an interface up or down). type: str choices: [disable, enable] more...
    • username1 User name to access the specified dialup account. type: str more...
    • username2 User name to access the specified dialup account. type: str more...
    • username3 User name to access the specified dialup account. type: str more...
    • wireless_port (Alias name: wireless-port) Enter wireless port number: 0 for default, 1 for first port, and so on (0 - 4294967295). type: int 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
  gather_facts: false
  vars:
    ansible_httpapi_use_ssl: true
    ansible_httpapi_validate_certs: false
    ansible_httpapi_port: 443
  tasks:
    - name: Configure MODEM.
      fortinet.fmgdevice.fmgd_system_modem:
        # bypass_validation: false
        # workspace_locking_adom: <global or your adom name>
        # workspace_locking_timeout: 300
        # rc_succeeded: [0, -2, -3, ...]
        # rc_failed: [-2, -3, ...]
        device: <your own value>
        vdom: <your own value>
        system_modem:
          # altmode: <value in [disable, enable]>
          # authtype1:
          #   - "pap"
          #   - "chap"
          #   - "mschapv2"
          #   - "mschap"
          # authtype2:
          #   - "pap"
          #   - "chap"
          #   - "mschapv2"
          #   - "mschap"
          # authtype3:
          #   - "pap"
          #   - "chap"
          #   - "mschapv2"
          #   - "mschap"
          # auto_dial: <value in [disable, enable]>
          # connect_timeout: <integer>
          # dial_cmd1: <string>
          # dial_cmd2: <string>
          # dial_cmd3: <string>
          # dial_on_demand: <value in [disable, enable]>
          # distance: <integer>
          # dont_send_CR1: <value in [disable, enable]>
          # dont_send_CR2: <value in [disable, enable]>
          # dont_send_CR3: <value in [disable, enable]>
          # extra_init1: <string>
          # extra_init2: <string>
          # extra_init3: <string>
          # holddown_timer: <integer>
          # idle_timer: <integer>
          # interface: <list or string>
          # lockdown_lac: <string>
          # mode: <value in [standalone, redundant]>
          # network_init: <string>
          # passwd1: <list or string>
          # passwd2: <list or string>
          # passwd3: <list or string>
          # peer_modem1: <value in [generic, actiontec, ascend_TNT]>
          # peer_modem2: <value in [generic, actiontec, ascend_TNT]>
          # peer_modem3: <value in [generic, actiontec, ascend_TNT]>
          # phone1: <string>
          # phone2: <string>
          # phone3: <string>
          # pin_init: <string>
          # ppp_echo_request1: <value in [disable, enable]>
          # ppp_echo_request2: <value in [disable, enable]>
          # ppp_echo_request3: <value in [disable, enable]>
          # priority: <integer>
          # redial: <value in [none, 1, 2, ...]>
          # reset: <integer>
          # status: <value in [disable, enable]>
          # username1: <string>
          # username2: <string>
          # username3: <string>
          # wireless_port: <integer>

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)