Hello all, I’m trying to write a playbook to query all Fortinet’s and give me a list of all Access points managed by that device.
I’ve been going off: fortinet.fortios.fortios_monitor_fact module – Retrieve Facts of FortiOS Monitor Objects. — Ansible Documentation
But I’m not having to much look. I’ve tried several iterations of the following playbook. The result it does give is listing (1) AP, but I know for a fact that the current host I’m testing off has several APs. My preferred output would show AP model as well as firmware version. Below is my test playbook and below that will be some debug output
- my code!
- hosts: all
connection: httpapi
gather_facts: no
vars:
vdom: “root”
ansible_httpapi_use_ssl: yes
ansible_httpapi_validate_certs: no
ansible_httpapi_port: 443
ansible_network_os: fortinet.fortios.fortios
tasks:- name: Gather FortiAPs firmware list
fortinet.fortios.fortios_monitor_fact:
vdom: “root”
selector: wifi_managed_ap - debug:
var: fortinet.fortios.fortios_monitor_fact
- name: Gather FortiAPs firmware list
Debug output:
ok: [10.1.1.27] => {
“changed”: false,
“invocation”: {
“module_args”: {
“access_token”: null,
“enable_log”: false,
“filters”: null,
“formatters”: null,
“params”: null,
“selector”: “wifi_managed_ap”,
“selectors”: null,
“sorters”: null,
“vdom”: “root”
}
},
“meta”: {
“action”: “”,
“build”: 1575,
“http_method”: “GET”,
“name”: “managed_ap”,
“path”: “wifi”,
“results”: [
{
“ap_profile”: “FAP222C New”,
“ble_profile”: “”,
“board_mac”: “90:6c:ac:39:04:4c”,
Any help would be greatly appreciated