drmofu.fortimanager.fmgr_user_group (2.2.2) — module

Configure user groups.

| "added in version" 2.0.0 of drmofu.fortimanager"

Authors: Xinwei Du (@dux-fortinet), Xing Li (@lix-fortinet), Jie Xue (@JieX19), Link Zheng (@chillancezen), Frank Shen (@fshen01), Hongbin Lu (@fgtdev-hblu)

preview | supported by community

Install collection

Install with ansible-galaxy collection install drmofu.fortimanager:==2.2.2


Add to requirements.yml

  collections:
    - name: drmofu.fortimanager
      version: 2.2.2

Description

This module is able to configure a FortiManager device.

Examples include all parameters and values which need to be adjusted to data sources before usage.

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
 - name: gathering fortimanager facts
   hosts: fortimanager00
   gather_facts: no
   connection: httpapi
   collections:
     - fortinet.fortimanager
   vars:
     ansible_httpapi_use_ssl: True
     ansible_httpapi_validate_certs: False
     ansible_httpapi_port: 443
   tasks:
    - name: retrieve all the user groups
      fmgr_fact:
        facts:
            selector: 'user_group'
            params:
                adom: 'ansible'
                group: 'your_value'
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
 - hosts: fortimanager00
   collections:
     - fortinet.fortimanager
   connection: httpapi
   vars:
      ansible_httpapi_use_ssl: True
      ansible_httpapi_validate_certs: False
      ansible_httpapi_port: 443
   tasks:
    - name: Configure user groups.
      fmgr_user_group:
         bypass_validation: False
         adom: FortiCarrier
         state: present
         user_group:
            id: 1
            name: ansible-test-group
            password: specify #<value in [auto-generate, specify, disable]>
            user-id: email #<value in [email, auto-generate, specify]>

Inputs

    
adom:
    description: the parameter (adom) in requested url
    required: true
    type: str

state:
    choices:
    - present
    - absent
    description: The directive to create, update or delete an object.
    required: true
    type: str

rc_failed:
    description: The rc codes list with which the conditions to fail will be overriden.
    elements: int
    required: false
    type: list

enable_log:
    default: false
    description: Enable/Disable logging for task.
    required: false
    type: bool

user_group:
    description: the top level parameters set
    required: false
    suboptions:
      auth-concurrent-override:
        choices:
        - disable
        - enable
        description: Enable/disable overriding the global number of concurrent authentication
          sessions for this user group.
        type: str
      auth-concurrent-value:
        description: Maximum number of concurrent authenticated connections per user
        type: int
      authtimeout:
        description: Authentication timeout in minutes for this user group.
        type: int
      company:
        choices:
        - optional
        - mandatory
        - disabled
        description: Set the action for the company guest user field.
        type: str
      dynamic_mapping:
        description: description
        elements: dict
        suboptions:
          _scope:
            description: description
            elements: dict
            suboptions:
              name:
                description: no description
                type: str
              vdom:
                description: no description
                type: str
            type: list
          auth-concurrent-override:
            choices:
            - disable
            - enable
            description: Enable/disable overriding the global number of concurrent authentication
              sessions for this user group.
            type: str
          auth-concurrent-value:
            description: Maximum number of concurrent authenticated connections per user
            type: int
          authtimeout:
            description: Authentication timeout in minutes for this user group.
            type: int
          company:
            choices:
            - optional
            - mandatory
            - disabled
            description: Set the action for the company guest user field.
            type: str
          email:
            choices:
            - disable
            - enable
            description: Enable/disable the guest user email address field.
            type: str
          expire:
            description: Time in seconds before guest user accounts expire
            type: int
          expire-type:
            choices:
            - immediately
            - first-successful-login
            description: Determine when the expiration countdown begins.
            type: str
          group-type:
            choices:
            - firewall
            - directory-service
            - fsso-service
            - guest
            - rsso
            description: Set the group to be for firewall authentication, FSSO, RSSO,
              or guest users.
            type: str
          guest:
            description: description
            elements: dict
            suboptions:
              comment:
                description: Comment.
                type: str
              company:
                description: Set the action for the company guest user field.
                type: str
              email:
                description: Email.
                type: str
              expiration:
                description: Expire time.
                type: str
              group:
                description: no description
                type: str
              id:
                description: Guest ID.
                type: int
              mobile-phone:
                description: Mobile phone.
                type: str
              name:
                description: Guest name.
                type: str
              password:
                description: description
                type: str
              sponsor:
                description: Set the action for the sponsor guest user field.
                type: str
              user-id:
                description: Guest ID.
                type: str
            type: list
          http-digest-realm:
            description: Realm attribute for MD5-digest authentication.
            type: str
          id:
            description: Group ID.
            type: int
          ldap-memberof:
            description: no description
            type: str
          logic-type:
            choices:
            - or
            - and
            description: no description
            type: str
          match:
            description: description
            elements: dict
            suboptions:
              _gui_meta:
                description: no description
                type: str
              group-name:
                description: Name of matching user or group on remote authentication server.
                type: str
              id:
                description: ID.
                type: int
              server-name:
                description: Name of remote auth server.
                type: str
            type: list
          max-accounts:
            description: Maximum number of guest accounts that can be created for this
              group
            type: int
          member:
            description: description
            type: str
          mobile-phone:
            choices:
            - disable
            - enable
            description: Enable/disable the guest user mobile phone number field.
            type: str
          multiple-guest-add:
            choices:
            - disable
            - enable
            description: Enable/disable addition of multiple guests.
            type: str
          password:
            choices:
            - auto-generate
            - specify
            - disable
            description: Guest user password type.
            type: str
          redir-url:
            description: no description
            type: str
          sms-custom-server:
            description: SMS server.
            type: str
          sms-server:
            choices:
            - fortiguard
            - custom
            description: Send SMS through FortiGuard or other external server.
            type: str
          sponsor:
            choices:
            - optional
            - mandatory
            - disabled
            description: Set the action for the sponsor guest user field.
            type: str
          sslvpn-bookmarks-group:
            description: description
            type: str
          sslvpn-cache-cleaner:
            choices:
            - disable
            - enable
            description: no description
            type: str
          sslvpn-client-check:
            choices:
            - forticlient
            - forticlient-av
            - forticlient-fw
            - 3rdAV
            - 3rdFW
            description: description
            elements: str
            type: list
          sslvpn-ftp:
            choices:
            - disable
            - enable
            description: no description
            type: str
          sslvpn-http:
            choices:
            - disable
            - enable
            description: no description
            type: str
          sslvpn-os-check:
            choices:
            - disable
            - enable
            description: no description
            type: str
          sslvpn-os-check-list:
            description: no description
            required: false
            suboptions:
              action:
                choices:
                - allow
                - check-up-to-date
                - deny
                description: no description
                type: str
              latest-patch-level:
                description: no description
                type: str
              name:
                description: no description
                type: str
              tolerance:
                description: no description
                type: int
            type: dict
          sslvpn-portal:
            description: description
            type: str
          sslvpn-portal-heading:
            description: no description
            type: str
          sslvpn-rdp:
            choices:
            - disable
            - enable
            description: no description
            type: str
          sslvpn-samba:
            choices:
            - disable
            - enable
            description: no description
            type: str
          sslvpn-split-tunneling:
            choices:
            - disable
            - enable
            description: no description
            type: str
          sslvpn-ssh:
            choices:
            - disable
            - enable
            description: no description
            type: str
          sslvpn-telnet:
            choices:
            - disable
            - enable
            description: no description
            type: str
          sslvpn-tunnel:
            choices:
            - disable
            - enable
            description: no description
            type: str
          sslvpn-tunnel-endip:
            description: no description
            type: str
          sslvpn-tunnel-ip-mode:
            choices:
            - range
            - usrgrp
            description: no description
            type: str
          sslvpn-tunnel-startip:
            description: no description
            type: str
          sslvpn-virtual-desktop:
            choices:
            - disable
            - enable
            description: no description
            type: str
          sslvpn-vnc:
            choices:
            - disable
            - enable
            description: no description
            type: str
          sslvpn-webapp:
            choices:
            - disable
            - enable
            description: no description
            type: str
          sso-attribute-value:
            description: Name of the RADIUS user group that this local user group represents.
            type: str
          user-id:
            choices:
            - email
            - auto-generate
            - specify
            description: Guest user ID type.
            type: str
          user-name:
            choices:
            - disable
            - enable
            description: Enable/disable the guest user name entry.
            type: str
        type: list
      email:
        choices:
        - disable
        - enable
        description: Enable/disable the guest user email address field.
        type: str
      expire:
        description: Time in seconds before guest user accounts expire.
        type: int
      expire-type:
        choices:
        - immediately
        - first-successful-login
        description: Determine when the expiration countdown begins.
        type: str
      group-type:
        choices:
        - firewall
        - directory-service
        - fsso-service
        - guest
        - rsso
        description: Set the group to be for firewall authentication, FSSO, RSSO, or guest
          users.
        type: str
      guest:
        description: Guest.
        elements: dict
        suboptions:
          comment:
            description: Comment.
            type: str
          company:
            description: Set the action for the company guest user field.
            type: str
          email:
            description: Email.
            type: str
          expiration:
            description: Expire time.
            type: str
          group:
            description: Guest name.
            type: str
          id:
            description: Guest ID.
            type: int
          mobile-phone:
            description: Mobile phone.
            type: str
          name:
            description: Guest name.
            type: str
          password:
            description: Guest password.
            type: str
          sponsor:
            description: Set the action for the sponsor guest user field.
            type: str
          user-id:
            description: Guest ID.
            type: str
        type: list
      http-digest-realm:
        description: Realm attribute for MD5-digest authentication.
        type: str
      id:
        description: Group ID.
        type: int
      match:
        description: Match.
        elements: dict
        suboptions:
          _gui_meta:
            description: _Gui_Meta.
            type: str
          group-name:
            description: Name of matching group on remote authentication server.
            type: str
          id:
            description: ID.
            type: int
          server-name:
            description: Name of remote auth server.
            type: str
        type: list
      max-accounts:
        description: Maximum number of guest accounts that can be created for this group
        type: int
      member:
        description: Names of users, peers, LDAP severs, or RADIUS servers to add to the
          user group.
        elements: str
        type: list
      mobile-phone:
        choices:
        - disable
        - enable
        description: Enable/disable the guest user mobile phone number field.
        type: str
      multiple-guest-add:
        choices:
        - disable
        - enable
        description: Enable/disable addition of multiple guests.
        type: str
      name:
        description: Group name.
        type: str
      password:
        choices:
        - auto-generate
        - specify
        - disable
        description: Guest user password type.
        type: str
      sms-custom-server:
        description: SMS server.
        type: str
      sms-server:
        choices:
        - fortiguard
        - custom
        description: Send SMS through FortiGuard or other external server.
        type: str
      sponsor:
        choices:
        - optional
        - mandatory
        - disabled
        description: Set the action for the sponsor guest user field.
        type: str
      sso-attribute-value:
        description: Name of the RADIUS user group that this local user group represents.
        type: str
      user-id:
        choices:
        - email
        - auto-generate
        - specify
        description: Guest user ID type.
        type: str
      user-name:
        choices:
        - disable
        - enable
        description: Enable/disable the guest user name entry.
        type: str
    type: dict

access_token:
    description: The token to access FortiManager without using username and password.
    required: false
    type: str

rc_succeeded:
    description: The rc codes list with which the conditions to succeed will be overriden.
    elements: int
    required: false
    type: list

proposed_method:
    choices:
    - update
    - set
    - add
    description: The overridden method for the underlying Json RPC request.
    required: false
    type: str

bypass_validation:
    default: false
    description: Only set to True when module schema diffs with FortiManager API structure,
      module continues to execute without validating parameters.
    required: false
    type: bool

workspace_locking_adom:
    description: The adom to lock for FortiManager running in workspace mode, the value
      can be global and others including root.
    required: false
    type: str

forticloud_access_token:
    description: Authenticate Ansible client with forticloud API access token.
    required: false
    type: str

workspace_locking_timeout:
    default: 300
    description: The maximum time in seconds to wait for other user to release the workspace
      lock.
    required: false
    type: int

Outputs

meta:
  contains:
    request_url:
      description: The full url requested.
      returned: always
      sample: /sys/login/user
      type: str
    response_code:
      description: The status of api request.
      returned: always
      sample: 0
      type: int
    response_data:
      description: The api response.
      returned: always
      type: list
    response_message:
      description: The descriptive message of the api response.
      returned: always
      sample: OK.
      type: str
    system_information:
      description: The information of the target system.
      returned: always
      type: dict
  description: The result of the request.
  returned: always
  type: dict
rc:
  description: The status the request.
  returned: always
  sample: 0
  type: int
version_check_warning:
  description: Warning if the parameters used in the playbook are not supported by
    the current FortiManager version.
  returned: complex
  type: list