fortios_system_admin – Configure admin users 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 admin 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_admin 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
  • state - Indicates whether to create or remove the object. type: str required: true choices: present, absent
  • system_admin - Configure admin users. type: dict more...
    • accprofile - Access profile for this administrator. Access profiles control administrator access to FortiGate features. Source system.accprofile.name. type: str more...
    • accprofile_override - Enable to use the name of an access profile provided by the remote authentication server to control the FortiGate features that this administrator can access. type: str choices: enable, disable more...
    • allow_remove_admin_session - Enable/disable allow admin session to be removed by privileged admin users. type: str choices: enable, disable more...
    • comments - Comment. type: str more...
    • email_to - This administrator"s email address. type: str more...
    • force_password_change - Enable/disable force password change on next login. type: str choices: enable, disable more...
    • fortitoken - This administrator"s FortiToken serial number. type: str more...
    • guest_auth - Enable/disable guest authentication. type: str choices: disable, enable more...
    • guest_lang - Guest management portal language. Source system.custom-language.name. type: str more...
    • guest_usergroups - Select guest user groups. type: list member_path: guest_usergroups:name more...
      • name - Select guest user groups. type: str required: true more...
    • gui_dashboard - GUI dashboards. type: list member_path: gui_dashboard:id more...
      • columns - Number of columns. type: int more...
      • id - Dashboard ID. see Notes. type: int required: true more...
      • layout_type - Layout type. type: str choices: responsive, fixed more...
      • name - Dashboard name. type: str more...
      • permanent - Permanent dashboard (can"t be removed via the GUI). type: str choices: disable, enable more...
      • scope - Dashboard scope. type: str choices: global, vdom more...
      • vdom - Virtual domain. Source system.vdom.name. type: str more...
      • widget - Dashboard widgets. type: list member_path: gui_dashboard:id/widget:id more...
        • fabric_device - Fabric device to monitor. type: str more...
        • fabric_device_widget_name - Fabric device widget name. type: str more...
        • fabric_device_widget_visualization_type - Visualization type for fabric device widget. type: str more...
        • fortiview_device - FortiView device. type: str more...
        • fortiview_filters - FortiView filters. type: list member_path: gui_dashboard:id/widget:id/fortiview_filters:id more...
          • id - FortiView Filter ID. see Notes. type: int required: true more...
          • key - Filter key. type: str more...
          • value - Filter value. type: str more...
        • fortiview_sort_by - FortiView sort by. type: str more...
        • fortiview_timeframe - FortiView timeframe. type: str more...
        • fortiview_type - FortiView type. type: str more...
        • fortiview_visualization - FortiView visualization. type: str more...
        • height - Height. type: int more...
        • id - Widget ID. see Notes. type: int required: true more...
        • industry - Security Audit Rating industry. type: str choices: default, custom more...
        • interface - Interface to monitor. Source system.interface.name. type: str more...
        • region - Security Audit Rating region. type: str choices: default, custom more...
        • title - Widget title. type: str more...
        • type - Widget type. type: str choices: sysinfo, licinfo, forticloud, cpu-usage, memory-usage, disk-usage, log-rate, sessions, session-rate, tr-history, analytics, usb-modem, admins, security-fabric, security-fabric-ranking, sensor-info, ha-status, vulnerability-summary, host-scan-summary, fortiview, botnet-activity, fabric-device, fortimail more...
        • width - Width. type: int more...
        • x_pos - X position. type: int more...
        • y_pos - Y position. type: int more...
    • gui_global_menu_favorites - Favorite GUI menu IDs for the global VDOM. type: list member_path: gui_global_menu_favorites:id more...
      • id - Select menu ID. type: str required: true more...
    • gui_new_feature_acknowledge - Acknowledgement of new features. type: list member_path: gui_new_feature_acknowledge:id more...
      • id - Select menu ID. type: str required: true more...
    • gui_vdom_menu_favorites - Favorite GUI menu IDs for VDOMs. type: list member_path: gui_vdom_menu_favorites:id more...
      • id - Select menu ID. type: str required: true more...
    • hidden - Admin user hidden attribute. type: int more...
    • history0 - history0 type: str more...
    • history1 - history1 type: str more...
    • ip6_trusthost1 - Any IPv6 address from which the administrator can connect to the FortiGate unit. Default allows access from any IPv6 address. type: str more...
    • ip6_trusthost10 - Any IPv6 address from which the administrator can connect to the FortiGate unit. Default allows access from any IPv6 address. type: str more...
    • ip6_trusthost2 - Any IPv6 address from which the administrator can connect to the FortiGate unit. Default allows access from any IPv6 address. type: str more...
    • ip6_trusthost3 - Any IPv6 address from which the administrator can connect to the FortiGate unit. Default allows access from any IPv6 address. type: str more...
    • ip6_trusthost4 - Any IPv6 address from which the administrator can connect to the FortiGate unit. Default allows access from any IPv6 address. type: str more...
    • ip6_trusthost5 - Any IPv6 address from which the administrator can connect to the FortiGate unit. Default allows access from any IPv6 address. type: str more...
    • ip6_trusthost6 - Any IPv6 address from which the administrator can connect to the FortiGate unit. Default allows access from any IPv6 address. type: str more...
    • ip6_trusthost7 - Any IPv6 address from which the administrator can connect to the FortiGate unit. Default allows access from any IPv6 address. type: str more...
    • ip6_trusthost8 - Any IPv6 address from which the administrator can connect to the FortiGate unit. Default allows access from any IPv6 address. type: str more...
    • ip6_trusthost9 - Any IPv6 address from which the administrator can connect to the FortiGate unit. Default allows access from any IPv6 address. type: str more...
    • login_time - Record user login time. type: list member_path: login_time:usr_name more...
      • last_failed_login - Last failed login time. type: str more...
      • last_login - Last successful login time. type: str more...
      • usr_name - User name. type: str required: true more...
    • name - User name. type: str required: true more...
    • password - Admin user password. type: str more...
    • password_expire - Password expire time. type: str more...
    • peer_auth - Set to enable peer certificate authentication (for HTTPS admin access). type: str choices: enable, disable more...
    • peer_group - Name of peer group defined under config user group which has PKI members. Used for peer certificate authentication (for HTTPS admin access). type: str more...
    • radius_vdom_override - Enable to use the names of VDOMs provided by the remote authentication server to control the VDOMs that this administrator can access. type: str choices: enable, disable more...
    • remote_auth - Enable/disable authentication using a remote RADIUS, LDAP, or TACACS+ server. type: str choices: enable, disable more...
    • remote_group - User group name used for remote auth. type: str more...
    • schedule - Firewall schedule used to restrict when the administrator can log in. No schedule means no restrictions. type: str more...
    • sms_custom_server - Custom SMS server to send SMS messages to. Source system.sms-server.name. type: str more...
    • sms_phone - Phone number on which the administrator receives SMS messages. type: str more...
    • sms_server - Send SMS messages using the FortiGuard SMS server or a custom server. type: str choices: fortiguard, custom more...
    • ssh_certificate - Select the certificate to be used by the FortiGate for authentication with an SSH client. Source certificate.remote.name. type: str more...
    • ssh_public_key1 - Public key of an SSH client. The client is authenticated without being asked for credentials. Create the public-private key pair in the SSH client application. type: str more...
    • ssh_public_key2 - Public key of an SSH client. The client is authenticated without being asked for credentials. Create the public-private key pair in the SSH client application. type: str more...
    • ssh_public_key3 - Public key of an SSH client. The client is authenticated without being asked for credentials. Create the public-private key pair in the SSH client application. type: str more...
    • trusthost1 - Any IPv4 address or subnet address and netmask from which the administrator can connect to the FortiGate unit. Default allows access from any IPv4 address. type: str more...
    • trusthost10 - Any IPv4 address or subnet address and netmask from which the administrator can connect to the FortiGate unit. Default allows access from any IPv4 address. type: str more...
    • trusthost2 - Any IPv4 address or subnet address and netmask from which the administrator can connect to the FortiGate unit. Default allows access from any IPv4 address. type: str more...
    • trusthost3 - Any IPv4 address or subnet address and netmask from which the administrator can connect to the FortiGate unit. Default allows access from any IPv4 address. type: str more...
    • trusthost4 - Any IPv4 address or subnet address and netmask from which the administrator can connect to the FortiGate unit. Default allows access from any IPv4 address. type: str more...
    • trusthost5 - Any IPv4 address or subnet address and netmask from which the administrator can connect to the FortiGate unit. Default allows access from any IPv4 address. type: str more...
    • trusthost6 - Any IPv4 address or subnet address and netmask from which the administrator can connect to the FortiGate unit. Default allows access from any IPv4 address. type: str more...
    • trusthost7 - Any IPv4 address or subnet address and netmask from which the administrator can connect to the FortiGate unit. Default allows access from any IPv4 address. type: str more...
    • trusthost8 - Any IPv4 address or subnet address and netmask from which the administrator can connect to the FortiGate unit. Default allows access from any IPv4 address. type: str more...
    • trusthost9 - Any IPv4 address or subnet address and netmask from which the administrator can connect to the FortiGate unit. Default allows access from any IPv4 address. type: str more...
    • two_factor - Enable/disable two-factor authentication. type: str choices: disable, fortitoken, fortitoken-cloud, email, sms more...
    • two_factor_authentication - Authentication method by FortiToken Cloud. type: str choices: fortitoken, email, sms more...
    • two_factor_notification - Notification method for user activation by FortiToken Cloud. type: str choices: email, sms more...
    • vdom - Virtual domain(s) that the administrator can access. type: list member_path: vdom:name more...
      • name - Virtual domain name. Source system.vdom.name. type: str required: true more...
    • vdom_override - Enable to use the names of VDOMs provided by the remote authentication server to control the VDOMs that this administrator can access. type: str choices: enable, disable more...
    • wildcard - Enable/disable wildcard RADIUS authentication. type: str choices: enable, disable more...

Notes

Note

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

Examples

- name: Configure admin users.
  fortinet.fortios.fortios_system_admin:
      vdom: "{{ vdom }}"
      state: "present"
      access_token: "<your_own_value>"
      system_admin:
          accprofile: "<your_own_value> (source system.accprofile.name)"
          accprofile_override: "enable"
          allow_remove_admin_session: "enable"
          comments: "<your_own_value>"
          email_to: "<your_own_value>"
          force_password_change: "enable"
          fortitoken: "<your_own_value>"
          guest_auth: "disable"
          guest_lang: "<your_own_value> (source system.custom-language.name)"
          guest_usergroups:
              -
                  name: "default_name_13"
          gui_dashboard:
              -
                  columns: "10"
                  id: "16"
                  layout_type: "responsive"
                  name: "default_name_18"
                  permanent: "disable"
                  scope: "global"
                  vdom: "<your_own_value> (source system.vdom.name)"
                  widget:
                      -
                          fabric_device: "<your_own_value>"
                          fabric_device_widget_name: "<your_own_value>"
                          fabric_device_widget_visualization_type: "<your_own_value>"
                          fortiview_device: "<your_own_value>"
                          fortiview_filters:
                              -
                                  id: "28"
                                  key: "<your_own_value>"
                                  value: "<your_own_value>"
                          fortiview_sort_by: "<your_own_value>"
                          fortiview_timeframe: "<your_own_value>"
                          fortiview_type: "<your_own_value>"
                          fortiview_visualization: "<your_own_value>"
                          height: "25"
                          id: "36"
                          industry: "default"
                          interface: "<your_own_value> (source system.interface.name)"
                          region: "default"
                          title: "<your_own_value>"
                          type: "sysinfo"
                          width: "25"
                          x_pos: "500"
                          y_pos: "500"
          gui_global_menu_favorites:
              -
                  id: "46"
          gui_new_feature_acknowledge:
              -
                  id: "48"
          gui_vdom_menu_favorites:
              -
                  id: "50"
          hidden: "127"
          history0: "<your_own_value>"
          history1: "<your_own_value>"
          ip6_trusthost1: "myhostname"
          ip6_trusthost10: "myhostname"
          ip6_trusthost2: "myhostname"
          ip6_trusthost3: "myhostname"
          ip6_trusthost4: "myhostname"
          ip6_trusthost5: "myhostname"
          ip6_trusthost6: "myhostname"
          ip6_trusthost7: "myhostname"
          ip6_trusthost8: "myhostname"
          ip6_trusthost9: "myhostname"
          login_time:
              -
                  last_failed_login: "<your_own_value>"
                  last_login: "<your_own_value>"
                  usr_name: "<your_own_value>"
          name: "default_name_68"
          password: "<your_own_value>"
          password_expire: "<your_own_value>"
          peer_auth: "enable"
          peer_group: "<your_own_value>"
          radius_vdom_override: "enable"
          remote_auth: "enable"
          remote_group: "<your_own_value>"
          schedule: "<your_own_value>"
          sms_custom_server: "<your_own_value> (source system.sms-server.name)"
          sms_phone: "<your_own_value>"
          sms_server: "fortiguard"
          ssh_certificate: "<your_own_value> (source certificate.remote.name)"
          ssh_public_key1: "<your_own_value>"
          ssh_public_key2: "<your_own_value>"
          ssh_public_key3: "<your_own_value>"
          trusthost1: "myhostname"
          trusthost10: "myhostname"
          trusthost2: "myhostname"
          trusthost3: "myhostname"
          trusthost4: "myhostname"
          trusthost5: "myhostname"
          trusthost6: "myhostname"
          trusthost7: "myhostname"
          trusthost8: "myhostname"
          trusthost9: "myhostname"
          two_factor: "disable"
          two_factor_authentication: "fortitoken"
          two_factor_notification: "email"
          vdom:
              -
                  name: "default_name_98 (source system.vdom.name)"
          vdom_override: "enable"
          wildcard: "enable"

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.