fmgd_system_accprofile – Configure access profiles for system administrators.

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
  • 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
  • device - The parameter in requested url type: str required: true
  • system_accprofile - Configure access profiles for system administrators. type: dict
    • admintimeout Administrator timeout for this access profile (0 - 480 min, default = 10, 0 means never timeout). type: int more...
    • admintimeout_override (Alias name: admintimeout-override) Enable/disable overriding the global administrator idle timeout. type: str choices: [disable, enable] more...
    • authgrp Administrator access to users and devices. type: str choices: [none, read, read-write] more...
    • cli_config (Alias name: cli-config) Enable/disable permission to run config commands. type: str choices: [disable, enable] more...
    • cli_diagnose (Alias name: cli-diagnose) Enable/disable permission to run diagnostic commands. type: str choices: [disable, enable] more...
    • cli_exec (Alias name: cli-exec) Enable/disable permission to run execute commands. type: str choices: [disable, enable] more...
    • cli_get (Alias name: cli-get) Enable/disable permission to run get commands. type: str choices: [disable, enable] more...
    • cli_show (Alias name: cli-show) Enable/disable permission to run show commands. type: str choices: [disable, enable] more...
    • comments Comment. type: str more...
    • ftviewgrp Fortiview. type: str choices: [none, read, read-write] more...
    • fwgrp Administrator access to the firewall configuration. type: str choices: [none, read, read-write, custom] more...
    • fwgrp_permission (Alias name: fwgrp-permission) Fwgrp permission. type: dict more...
      • address Address configuration. type: str choices: [none, read, read-write] more...
      • others Other firewall configuration. type: str choices: [none, read, read-write] more...
      • policy Policy configuration. type: str choices: [none, read, read-write] more...
      • schedule Schedule configuration. type: str choices: [none, read, read-write] more...
      • service Service configuration. type: str choices: [none, read, read-write] more...
      • packet_capture (Alias name: packet-capture) Packet capture configuration. type: str choices: [none, read, read-write] more...
    • loggrp Administrator access to logging and reporting including viewing log messages. type: str choices: [none, read, read-write, custom] more...
    • loggrp_permission (Alias name: loggrp-permission) Loggrp permission. type: dict more...
      • config Log & report configuration. type: str choices: [none, read, read-write] more...
      • data_access (Alias name: data-access) Log & report data access. type: str choices: [none, read, read-write] more...
      • report_access (Alias name: report-access) Log & report report access. type: str choices: [none, read, read-write] more...
      • threat_weight (Alias name: threat-weight) Log & report threat weight. type: str choices: [none, read, read-write] more...
    • name Profile name. type: str more...
    • netgrp Network configuration. type: str choices: [none, read, read-write, custom] more...
    • netgrp_permission (Alias name: netgrp-permission) Netgrp permission. type: dict more...
      • cfg Network configuration. type: str choices: [none, read, read-write] more...
      • packet_capture (Alias name: packet-capture) Packet capture configuration. type: str choices: [none, read, read-write] more...
      • route_cfg (Alias name: route-cfg) Router configuration. type: str choices: [none, read, read-write] more...
    • scope Scope of admin access: global or specific vdom(s). type: str choices: [vdom, global] more...
    • secfabgrp Security fabric. type: str choices: [none, read, read-write, custom] more...
    • sysgrp System configuration. type: str choices: [none, read, read-write, custom] more...
    • sysgrp_permission (Alias name: sysgrp-permission) Sysgrp permission. type: dict more...
      • admin Administrator users. type: str choices: [none, read, read-write] more...
      • cfg System configuration. type: str choices: [none, read, read-write] more...
      • mnt Maintenance. type: str choices: [none, read, read-write] more...
      • upd Fortiguard updates. type: str choices: [none, read, read-write] more...
    • system_diagnostics (Alias name: system-diagnostics) Enable/disable permission to run system diagnostic commands. type: str choices: [disable, enable] more...
    • system_execute_ssh (Alias name: system-execute-ssh) Enable/disable permission to execute ssh commands. type: str choices: [disable, enable] more...
    • system_execute_telnet (Alias name: system-execute-telnet) Enable/disable permission to execute telnet commands. type: str choices: [disable, enable] more...
    • utmgrp Administrator access to security profiles. type: str choices: [none, read, read-write, custom] more...
    • utmgrp_permission (Alias name: utmgrp-permission) Utmgrp permission. type: dict more...
      • antivirus Antivirus profiles and settings. type: str choices: [none, read, read-write] more...
      • application_control (Alias name: application-control) Application control profiles and settings. type: str choices: [none, read, read-write] more...
      • casb Inline casb filter profile and settings type: str choices: [none, read, read-write] more...
      • data_leak_prevention (Alias name: data-leak-prevention) Dlp profiles and settings. type: str choices: [none, read, read-write] more...
      • dlp Dlp profiles and settings. type: str choices: [none, read, read-write] more...
      • dnsfilter Dns filter profiles and settings. type: str choices: [none, read, read-write] more...
      • emailfilter Email filter and settings. type: str choices: [none, read, read-write] more...
      • endpoint_control (Alias name: endpoint-control) Forticlient profiles. type: str choices: [none, read, read-write] more...
      • file_filter (Alias name: file-filter) File-filter profiles and settings. type: str choices: [none, read, read-write] more...
      • icap Icap profiles and settings. type: str choices: [none, read, read-write] more...
      • ips Ips profiles and settings. type: str choices: [none, read, read-write] more...
      • mmsgtp Utm permission. type: str choices: [none, read, read-write] more...
      • videofilter Video filter profiles and settings. type: str choices: [none, read, read-write] more...
      • virtual_patch (Alias name: virtual-patch) Virtual patch profiles and settings. type: str choices: [none, read, read-write] more...
      • voip Voip profiles and settings. type: str choices: [none, read, read-write] more...
      • waf Web application firewall profiles and settings. type: str choices: [none, read, read-write] more...
      • webfilter Web filter profiles and settings. type: str choices: [none, read, read-write] more...
      • data_loss_prevention (Alias name: data-loss-prevention) Dlp profiles and settings. type: str choices: [none, read, read-write] more...
      • spamfilter Antispam filter and settings. type: str choices: [none, read, read-write] more...
      • telemetry Telemetry profile and settings. type: str choices: [none, read, read-write] more...
    • vpngrp Administrator access to ipsec, ssl, pptp, and l2tp vpn. type: str choices: [none, read, read-write] more...
    • wanoptgrp Administrator access to wan opt & cache. type: str choices: [none, read, read-write] more...
    • wifi Administrator access to the wifi controller and switch controller. type: str choices: [none, read, read-write] more...
    • admingrp Administrator access to add, remove, and edit admin accounts and access profiles. type: str choices: [none, read, read-write] more...
    • certgrp Administrator access to the certificate configuration. type: str choices: [none, read, read-write] more...
    • routegrp Administrator access to the routing configuration. type: str choices: [none, read, read-write] more...
    • mntgrp Administrator access to maintenance commands including reset to factory defaults, format log disk, reboot, restore, and shutdown. type: str choices: [none, read, read-write] more...
    • updategrp Administrator access to the fortiguard configuration and requesting fortiguard updates. type: str choices: [none, read, read-write] more...
    • secfabgrp_permission (Alias name: secfabgrp-permission) Secfabgrp permission. type: dict more...
      • csffoo Fabric overlay orchestrator profiles and settings. type: str choices: [none, read, read-write] more...
      • csfsys Security fabric system profiles and settings. type: str choices: [none, read, read-write] more...
      • mmsgtp Utm permission. type: str choices: [none, read, read-write] 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 access profiles for system administrators.
      fortinet.fmgdevice.fmgd_system_accprofile:
        # 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>
        state: present # <value in [present, absent]>
        system_accprofile:
          name: "your value" # Required variable, string
          # admintimeout: <integer>
          # admintimeout_override: <value in [disable, enable]>
          # authgrp: <value in [none, read, read-write]>
          # cli_config: <value in [disable, enable]>
          # cli_diagnose: <value in [disable, enable]>
          # cli_exec: <value in [disable, enable]>
          # cli_get: <value in [disable, enable]>
          # cli_show: <value in [disable, enable]>
          # comments: <string>
          # ftviewgrp: <value in [none, read, read-write]>
          # fwgrp: <value in [none, read, read-write, ...]>
          # fwgrp_permission:
          #   address: <value in [none, read, read-write]>
          #   others: <value in [none, read, read-write]>
          #   policy: <value in [none, read, read-write]>
          #   schedule: <value in [none, read, read-write]>
          #   service: <value in [none, read, read-write]>
          #   packet_capture: <value in [none, read, read-write]>
          # loggrp: <value in [none, read, read-write, ...]>
          # loggrp_permission:
          #   config: <value in [none, read, read-write]>
          #   data_access: <value in [none, read, read-write]>
          #   report_access: <value in [none, read, read-write]>
          #   threat_weight: <value in [none, read, read-write]>
          # netgrp: <value in [none, read, read-write, ...]>
          # netgrp_permission:
          #   cfg: <value in [none, read, read-write]>
          #   packet_capture: <value in [none, read, read-write]>
          #   route_cfg: <value in [none, read, read-write]>
          # scope: <value in [vdom, global]>
          # secfabgrp: <value in [none, read, read-write, ...]>
          # sysgrp: <value in [none, read, read-write, ...]>
          # sysgrp_permission:
          #   admin: <value in [none, read, read-write]>
          #   cfg: <value in [none, read, read-write]>
          #   mnt: <value in [none, read, read-write]>
          #   upd: <value in [none, read, read-write]>
          # system_diagnostics: <value in [disable, enable]>
          # system_execute_ssh: <value in [disable, enable]>
          # system_execute_telnet: <value in [disable, enable]>
          # utmgrp: <value in [none, read, read-write, ...]>
          # utmgrp_permission:
          #   antivirus: <value in [none, read, read-write]>
          #   application_control: <value in [none, read, read-write]>
          #   casb: <value in [none, read, read-write]>
          #   data_leak_prevention: <value in [none, read, read-write]>
          #   dlp: <value in [none, read, read-write]>
          #   dnsfilter: <value in [none, read, read-write]>
          #   emailfilter: <value in [none, read, read-write]>
          #   endpoint_control: <value in [none, read, read-write]>
          #   file_filter: <value in [none, read, read-write]>
          #   icap: <value in [none, read, read-write]>
          #   ips: <value in [none, read, read-write]>
          #   mmsgtp: <value in [none, read, read-write]>
          #   videofilter: <value in [none, read, read-write]>
          #   virtual_patch: <value in [none, read, read-write]>
          #   voip: <value in [none, read, read-write]>
          #   waf: <value in [none, read, read-write]>
          #   webfilter: <value in [none, read, read-write]>
          #   data_loss_prevention: <value in [none, read, read-write]>
          #   spamfilter: <value in [none, read, read-write]>
          #   telemetry: <value in [none, read, read-write]>
          # vpngrp: <value in [none, read, read-write]>
          # wanoptgrp: <value in [none, read, read-write]>
          # wifi: <value in [none, read, read-write]>
          # admingrp: <value in [none, read, read-write]>
          # certgrp: <value in [none, read, read-write]>
          # routegrp: <value in [none, read, read-write]>
          # mntgrp: <value in [none, read, read-write]>
          # updategrp: <value in [none, read, read-write]>
          # secfabgrp_permission:
          #   csffoo: <value in [none, read, read-write]>
          #   csfsys: <value in [none, read, read-write]>
          #   mmsgtp: <value in [none, read, read-write]>

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)