fortinet-ansible-dev / ansible-galaxy-fortios-collection

GNU General Public License v3.0
84 stars 48 forks source link

fortinet.fortios.fortios_monitor_fact formatters not working #256

Open Snickers1337 opened 1 year ago

Snickers1337 commented 1 year ago

Hi Together,

Today i tried to get some Monitor Fact Information from Fortigate (Forti OS 7.0.9). The retrieving of the facts works as expected, but it is not possible to format the Results with the formatters parameter.

In my Example you can see 3 Tasks, 2 of them for the Fortigate Monitoring Fact and one of them for the Configuration Fact Module. The Monitoring Fact Tasks would not be formatted.

Is there a Mistake in my Playbook or is this a Repository problem?

Here my example Playbook:

Playbook to Test Modules and Functions

Playbook Results:

TASK [Debug] ** ok: [FW00-AVA-Labor-root] => { "msg": [ "Model {'changed': False, 'meta': {'http_method': 'GET', 'results': {'model_name': 'FortiGate', 'model_number': '81E', 'model': 'FGT81E', 'hostname': 'FW00-AVA-Labor', 'log_disk_status': 'available'}, 'vdom': 'root', 'path': 'system', 'name': 'status', 'action': '', 'status': 'success', 'serial': 'FGT81ETK19004572', 'version': 'v7.0.9', 'build': 444}, 'failed': False}",

    "Platform {'changed': False, 'meta': {'http_method': 'GET', 'results': {'current': {'name': 'FortiOS', 'id': 'current', 'version': 'v7.0.9', 'major': 7, 'minor': 0, 'patch': 9, 'build': 444, 'branch-point': 444, 'release-type': 'GA', 'maturity': 'M', 'notes': 'https://docs.fortinet.com/document/fortigate/7.0.9/fortios-release-notes/', 'source': 'current', 'platform-id': 'FGT81E'}, 'available': []}, 'vdom': 'root', 'path': 'system', 'name': 'firmware', 'action': '', 'status': 'success', 'serial': 'FGT81ETK19004572', 'version': 'v7.0.9', 'build': 444}, 'failed': False}",

    "Hostname: {'changed': False, 'meta': {'http_method': 'GET', 'revision': '38242231970928cc135be2c59759c1f5', 'results': {'hostname': 'FW00-AVA-Labor'}, 'vdom': 'root', 'path': 'system', 'name': 'global', 'status': 'success', 'http_status': 200, 'serial': 'FGT81ETK19004572', 'version': 'v7.0.9', 'build': 444}, 'failed': False}"
]

}

Expected Playbook Results:

TASK [Debug] ** ok: [FW00-AVA-Labor-root] => { "msg": [ "Model {'changed': False, 'meta': {'http_method': 'GET', 'results': {'model_number': '81E'}, 'vdom': 'root', 'path': 'system', 'name': 'status', 'action': '', 'status': 'success', 'serial': 'FGT81ETK19004572', 'version': 'v7.0.9', 'build': 444}, 'failed': False}",

    "Platform {'changed': False, 'meta': {'http_method': 'GET', 'results': {'platform-id': 'FGT81E'}, 'vdom': 'root', 'path': 'system', 'name': 'firmware', 'action': '', 'status': 'success', 'serial': 'FGT81ETK19004572', 'version': 'v7.0.9', 'build': 444}, 'failed': False}",

    "Hostname: {'changed': False, 'meta': {'http_method': 'GET', 'revision': '38242231970928cc135be2c59759c1f5', 'results': {'hostname': 'FW00-AVA-Labor'}, 'vdom': 'root', 'path': 'system', 'name': 'global', 'status': 'success', 'http_status': 200, 'serial': 'FGT81ETK19004572', 'version': 'v7.0.9', 'build': 444}, 'failed': False}"
]

}

Galaxy Collection Versions:

ansible-galaxy collection list

/home/ms/avamation/.venv/lib/python3.10/site-packages/ansible_collections

Collection Version


amazon.aws 5.2.0
ansible.netcommon 5.1.1
ansible.posix 1.5.1
ansible.utils 2.10.2 ansible.windows 1.13.0 arista.eos 6.0.0
awx.awx 21.11.0 azure.azcollection 1.14.0 check_point.mgmt 4.0.0
chocolatey.chocolatey 1.4.0
cisco.aci 2.3.0
cisco.asa 4.0.0
cisco.dnac 6.6.3
cisco.intersight 1.0.23 cisco.ios 4.3.1
cisco.iosxr 4.1.0
cisco.ise 2.5.12 cisco.meraki 2.15.0 cisco.mso 2.2.1
cisco.nso 1.0.3
cisco.nxos 4.0.1
cisco.ucs 1.8.0
cloud.common 2.1.2
cloudscale_ch.cloud 2.2.4
community.aws 5.2.0
community.azure 2.0.0
community.ciscosmb 1.0.5
community.crypto 2.10.0 community.digitalocean 1.23.0 community.dns 2.5.0
community.docker 3.4.0
community.fortios 1.0.0
community.general 6.3.0
community.google 1.0.0
community.grafana 1.5.3
community.hashi_vault 4.1.0
community.hrobot 1.7.0
community.libvirt 1.2.0
community.mongodb 1.4.2
community.mysql 3.5.1
community.network 5.0.0
community.okd 2.2.0
community.postgresql 2.3.2
community.proxysql 1.5.1
community.rabbitmq 1.2.3
community.routeros 2.7.0
community.sap 1.0.0
community.sap_libs 1.4.0
community.skydive 1.0.0
community.sops 1.6.0
community.vmware 3.3.0
community.windows 1.12.0 community.zabbix 1.9.1
containers.podman 1.10.1 cyberark.conjur 1.2.0
cyberark.pas 1.0.17 dellemc.enterprise_sonic 2.0.0
dellemc.openmanage 6.3.0
dellemc.os10 1.1.1
dellemc.os6 1.0.7
dellemc.os9 1.0.4
dellemc.powerflex 1.5.0
dellemc.unity 1.5.0
f5networks.f5_modules 1.22.0 fortinet.fortimanager 2.1.7
fortinet.fortios 2.2.3
frr.frr 2.0.0
gluster.gluster 1.0.2
google.cloud 1.1.2
grafana.grafana 1.1.0
hetzner.hcloud 1.9.1
hpe.nimble 1.1.4
ibm.qradar 2.1.0
ibm.spectrum_virtualize 1.11.0 infinidat.infinibox 1.3.12 infoblox.nios_modules 1.4.1
inspur.ispim 1.2.0
inspur.sm 2.3.0
junipernetworks.junos 4.1.0
kubernetes.core 2.3.2
lowlydba.sqlserver 1.3.1
mellanox.onyx 1.0.0
netapp.aws 21.7.0 netapp.azure 21.10.0 netapp.cloudmanager 21.22.0 netapp.elementsw 21.7.0 netapp.ontap 22.2.0 netapp.storagegrid 21.11.1 netapp.um_info 21.8.0 netapp_eseries.santricity 1.4.0
netbox.netbox 3.10.0 ngine_io.cloudstack 2.3.0
ngine_io.exoscale 1.0.0
ngine_io.vultr 1.1.3
openstack.cloud 1.10.0 openvswitch.openvswitch 2.1.0
ovirt.ovirt 2.4.1
purestorage.flasharray 1.16.2 purestorage.flashblade 1.10.0 purestorage.fusion 1.3.0
sensu.sensu_go 1.13.2 splunk.es 2.1.0
t_systems_mms.icinga_director 1.32.0 theforeman.foreman 3.8.0
vmware.vmware_rest 2.2.0
vultr.cloud 1.7.0
vyos.vyos 4.0.0
wti.remote 1.0.4

PIP versions

pip list Package Version


ansible 7.2.0 ansible-core 2.14.2 ansible-lint 6.14.4 anyio 3.6.2 attrs 22.2.0 black 23.3.0 bracex 2.3.post1 certifi 2022.12.7 cffi 1.15.1 charset-normalizer 3.0.1 click 8.1.3 cryptography 39.0.0 fastapi 0.88.0 filelock 3.11.0 flake8 6.0.0 greenlet 2.0.2 h11 0.14.0 idna 3.4 Jinja2 3.1.2 jsonschema 4.17.3 markdown-it-py 2.2.0 MarkupSafe 2.1.2 mccabe 0.7.0 mdurl 0.1.2 mypy-extensions 1.0.0 netaddr 0.8.0 packaging 23.0 passlib 1.7.4 pathspec 0.11.1 pip 23.1.2 platformdirs 3.2.0 pycodestyle 2.10.0 pycparser 2.21 pydantic 1.10.4 pyflakes 3.0.1 Pygments 2.15.0 pyrsistent 0.19.3 pyvmomi 7.0.3 PyYAML 6.0 requests 2.28.2 resolvelib 0.8.1 rich 13.3.3 ruamel.yaml 0.17.21 ruamel.yaml.clib 0.2.7 setuptools 67.1.0 six 1.16.0 sniffio 1.3.0 SQLAlchemy 1.4.46 starlette 0.22.0 subprocess-tee 0.4.1 tomli 2.0.1 typing_extensions 4.4.0 urllib3 1.26.14 uvicorn 0.20.0 wcmatch 8.4.1 yamllint 1.30.0

Best Regards Snickers

MaxxLiu22 commented 1 year ago

Hi @Snickers1337 ,

Thank you for raising this issue, I can reproduce it and have reported it to the development team for a solution.

Thanks, Maxx

Snickers1337 commented 1 year ago

Hi @MaxxLiu22,

Thanks for your Reply and Reporting.

BR Snickers