Open shokrymohamedshokry opened 1 year ago
Hi @shokrymohamedshokry ,
Thank you for your question, if you would like to get NIC information, you can try to use fortios_monitor_fact
module and use system_available-interfaces
as selector to get, Let me know if you still have questions.
- hosts: fortigates
connection: httpapi
collections:
- fortinet.fortios
vars:
vdom: "root"
ansible_httpapi_use_ssl: yes
ansible_httpapi_validate_certs: no
ansible_httpapi_port: 443
tasks:
- name: fact gathering
fortios_monitor_fact:
vdom: "root"
access_token: "{{token}}"
selector: 'system_available-interfaces'
register: info
- name: display vars
debug: msg="{{info}}"
Thanks, Maxx
i get the same error in repo msg trying to do a basic backup
- hosts: dc_fortigate
connection: httpapi
collections:
- fortinet.fortios
vars:
vdom: "root"
ansible_httpapi_use_ssl: yes
ansible_httpapi_validate_certs: no
ansible_httpapi_port: 8080
ansible_httpapi_timeout: 60
tasks:
- name: Backup a virtual domain.
fortios_monitor:
access_token: "{{ fortios_access_token }}"
selector: 'backup.system.config'
vdom: 'root'
params:
scope: 'global'
register: backupinfo
- name: Save the backup information.
copy:
content: '{{ backupinfo.meta.raw }}'
dest: './local.backup'
"msg": "Error in repo"}
When I run any playbook using fortios collection i got this error
( "vdom": "root", "version": "v6.4.11"}, "msg": "Error in repo"})
at the end of task and return with failed status.example of the playbook
fortios version 2.2.2 ansible version [core 2.13.3] python version 3.9.13