Note
This module is part of the fortinet.fortimanager collection (version 2.10.0).
You might already have this collection installed if you are using the ansible package. It is not included in ansible-core. To check whether it is installed, run ansible-galaxy collection list.
To install it, use: ansible-galaxy collection install fortinet.fortimanager.
To use it in a playbook, specify: fortinet.fortimanager.fmgr_generic.
New in fortinet.fortimanager 2.0.0
Parameter | Comments |
|---|---|
access_token string | The token to access FortiManager without using username and password. |
enable_log boolean | Enable/Disable logging for task Choices:
|
forticloud_access_token string | authenticate Ansible client with forticloud API access token |
json string | the raw json-formatted payload to send to fortimanager |
method string | the method of the json-rpc it must be in [get, add, set, update, delete, move, clone, exec] |
params list / elements=dictionary | the parameter collection. |
rc_failed list / elements=integer | the rc codes list with which the conditions to fail will be overriden |
rc_succeeded list / elements=integer | the rc codes list with which the conditions to succeed will be overriden |
workspace_locking_adom string | no description |
workspace_locking_timeout integer | no description Default: |
Note
- name: Generic module
hosts: fortimanagers
connection: httpapi
vars:
adom: "root"
ansible_httpapi_use_ssl: true
ansible_httpapi_validate_certs: false
ansible_httpapi_port: 443
tasks:
- name: Login a user
fortinet.fortimanager.fmgr_generic:
method: "exec"
params:
- url: "sys/login/user"
data:
- user: "APIUser"
passwd: "Fortinet1!e"
- name: Login another user
fortinet.fortimanager.fmgr_generic:
json: |
{
"method":"exec",
"params":[
{
"url":"sys/login/user",
"data":[
{
"user":"APIUser",
"passwd":"Fortinet1!"
}
]
}
]
}
Common return values are documented here, the following are the fields unique to this module:
Key | Description |
|---|---|
api_result string | full API response, includes status code and message Returned: always |
© 2012–2018 Michael DeHaan
© 2018–2025 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/latest/collections/fortinet/fortimanager/fmgr_generic_module.html