ansible / ansible.builtin / v2.9.27 / module / fmgr_query Query FortiManager data objects for use in Ansible workflows. | "added in version" 2.8 of ansible.builtin" Authors: Luke Weighall (@lweighall) preview | supported by communityansible.builtin.fmgr_query (v2.9.27) — module
pip
Install with pip install ansible==2.9.27
Provides information on data objects within FortiManager so that playbooks can perform conditionals.
- name: QUERY FORTIGATE DEVICE BY IP fmgr_query: object: "device" adom: "ansible" device_ip: "10.7.220.41"
- name: QUERY FORTIGATE DEVICE BY SERIAL fmgr_query: adom: "ansible" object: "device" device_serial: "FGVM000000117992"
- name: QUERY FORTIGATE DEVICE BY FRIENDLY NAME fmgr_query: adom: "ansible" object: "device" device_unique_name: "ansible-fgt01"
- name: VERIFY CLUSTER MEMBERS AND STATUS fmgr_query: adom: "ansible" object: "cluster_nodes" device_unique_name: "fgt-cluster01" nodes: ["ansible-fgt01", "ansible-fgt02", "ansible-fgt03"]
- name: GET STATUS OF TASK ID fmgr_query: adom: "ansible" object: "task" task_id: "3"
- name: USE CUSTOM TYPE TO QUERY AVAILABLE SCRIPTS fmgr_query: adom: "ansible" object: "custom" custom_endpoint: "/dvmdb/adom/ansible/script" custom_dict: { "type": "cli" }
adom: default: root description: - The ADOM the configuration should belong to. required: false nodes: description: - A LIST of firewalls in the cluster you want to verify i.e. ["firewall_A","firewall_B"]. required: false object: choices: - device - cluster_nodes - task - custom description: - The data object we wish to query (device, package, rule, etc). Will expand choices as improves. required: true task_id: description: - The ID of the task you wish to query status on. If left blank and object = 'task' a list of tasks are returned. required: false device_ip: description: - The IP of the device you want to query. required: false custom_dict: description: - ADVANCED USERS ONLY! REQUIRES KNOWLEDGE OF FMGR JSON API! - DICTIONARY JSON FORMAT ONLY -- Custom dictionary/datagram to send to the endpoint. required: false device_serial: description: - The serial number of the device you want to query. required: false custom_endpoint: description: - ADVANCED USERS ONLY! REQUIRES KNOWLEDGE OF FMGR JSON API! - The HTTP Endpoint on FortiManager you wish to GET from. required: false device_unique_name: description: - The desired "friendly" name of the device you want to query. required: false
api_result: description: full API response, includes status code and message returned: always type: str