Note
This plugin is part of the fortinet.fortimanager collection (version 2.1.3).
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 version 2.10: of fortinet.fortimanager
Parameter | Choices/Defaults | Comments |
---|---|---|
enable_log boolean |
| Enable/Disable logging for task |
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 string | the parameter collection. |
Note
- hosts: fortimanager01 connection: httpapi vars: adom: "root" ansible_httpapi_use_ssl: True ansible_httpapi_validate_certs: False ansible_httpapi_port: 443 tasks: - name: 'login a user' fmgr_generic: method: 'exec' params: - url: 'sys/login/user' data: - user: 'APIUser' passwd: 'Fortinet1!e' - name: 'login another user' 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 | Returned | Description |
---|---|---|
api_result string | always | full API response, includes status code and message |
© 2012–2018 Michael DeHaan
© 2018–2021 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