- source
fortios_facts.py
- orphan
2.9
- Collects facts from network devices running the fortios operating system. This module places the facts gathered in the fact tree keyed by the respective resource name. This facts module will only collect those facts which user specified in playbook.
The below requirements are needed on the host that executes this module.
- galaxy collection fortinet.fortios
- host - FortiOS or FortiGate IP address. type: str required: False
- username - FortiOS or FortiGate username. type: str required: False
- password - FortiOS or FortiGate password. type: str required: False default:
- vdom - Virtual domain, among those defined previously. A vdom is a virtual instance of the FortiGate that can be configured and used as a different unit. type: str required: False default: root
- https - Indicates if the requests towards FortiGate must use HTTPS protocol. type: bool required: False default: True
- ssl_verify - Ensures FortiGate certificate must be verified by a proper CA. type: bool required: False default: False
- gather_subset - When supplied, this argument will restrict the facts collected to a given subset. Possible values for this argument include system_current-admins_select, system_firmware_select, system_fortimanager_status, system_ha-checksums_select, system_interface_select, system_status_select and system_time_select type: list
- fact - Name of the facts to gather type: str required: True
- filters - Filters apply when gathering facts type: list
Note
- httpapi mode is the new recommended way for any network modules
- the module is going to be deprecated in next major release.
- hosts: localhost
vars:
host: "192.168.122.40"
username: "admin"
password: ""
vdom: "root"
ssl_verify: "False"
tasks:
- name: gather basic system status facts
fortios_facts:
host: "{{ host }}"
username: "{{ username }}"
password: "{{ password }}"
vdom: "{{ vdom }}"
gather_subset:
- fact: 'system_status_select'
- name: gather all physical interfaces status facts
fortios_facts:
host: "{{ host }}"
username: "{{ username }}"
password: "{{ password }}"
vdom: "{{ vdom }}"
gather_subset:
- fact: 'system_interface_select'
- name: gather gather all physical and vlan interfaces status facts
fortios_facts:
host: "{{ host }}"
username: "{{ username }}"
password: "{{ password }}"
vdom: "{{ vdom }}"
gather_subset:
- fact: 'system_interface_select'
filters:
- include_vlan: true
- name: gather basic system info and physical interface port3 status facts
fortios_facts:
host: "{{ host }}"
username: "{{ username }}"
password: "{{ password }}"
vdom: "{{ vdom }}"
gather_subset:
- fact: 'system_status_select'
- fact: 'system_interface_select'
filters:
- interface_name: 'port3'
Common return values are documented: https://docs.ansible.com/ansible/latest/reference_appendices/common_return_values.html#common-return-values, the following are the fields unique to this module:
- build - Build number of the fortigate image returned: always type: str sample: 1547
- http_method - Last method used to provision the content into FortiGate returned: always type: str sample: GET
- name - Name of the table used to fulfill the request returned: always type: str sample: firmware
- path - Path of the table used to fulfill the request returned: always type: str sample: system
- revision - Internal revision number returned: always type: str sample: 17.0.2.10658
- serial - Serial number of the unit returned: always type: str sample: FGVMEVYYQT3AB5352
- status - Indication of the operation's result returned: always type: str sample: success
- vdom - Virtual domain used returned: always type: str sample: root
- version - Version of the FortiGate returned: always type: str sample: v5.6.3
- ansible_facts - The list of fact subsets collected from the device returned: always type: dict
- This module is not guaranteed to have a backwards compatible interface.
- Don Yao (@fortinetps)
- Miguel Angel Munoz (@mamunozgonzalez)
- Nicolas Thomas (@thomnico)
Hint
If you notice any issues in this documentation, you can create a pull request to improve it.