ansible / ansible.builtin / v2.9.27 / module / fmgr_script Add/Edit/Delete and execute scripts | "added in version" 2.5 of ansible.builtin" Authors: Andrew Welsh (@Ghilli3) preview | supported by communityansible.builtin.fmgr_script (v2.9.27) — module
pip
Install with pip install ansible==2.9.27
Create/edit/delete scripts and execute the scripts on the FortiManager using jsonrpc API
- name: CREATE SCRIPT fmgr_script: adom: "root" script_name: "TestScript" script_type: "cli" script_target: "remote_device" script_description: "Create by Ansible" script_content: "get system status"
- name: EXECUTE SCRIPT fmgr_script: adom: "root" script_name: "TestScript" mode: "execute" script_scope: "FGT1,FGT2"
- name: DELETE SCRIPT fmgr_script: adom: "root" script_name: "TestScript" mode: "delete"
adom: description: - The administrative domain (admon) the configuration belongs to required: true mode: choices: - add - delete - execute - set default: add description: - The desired mode of the specified object. Execute will run the script. required: false version_added: '2.8' version_added_collection: ansible.builtin vdom: description: - The virtual domain (vdom) the configuration belongs to script_name: description: - The name of the script. required: true script_type: description: - The type of script (CLI or TCL). required: false script_scope: description: - (datasource) The devices that the script will run on, can have both device member and device group member. required: false script_target: description: - The target of the script to be run. required: false script_content: description: - The script content that will be executed. required: false script_package: description: - (datasource) Policy package object to run the script against required: false script_description: description: - The description of the script. required: false
api_result: description: full API response, includes status code and message returned: always type: str