Closed ebenitezj closed 1 year ago
Hi @ebenitezj ,
Thank you for raising this issue. From the error msg, there would be some inappropriate format around. From the configuration you provide, there would be an extra space before the arguments 'selector' and 'vdom', since they are sub-arguments of fortios_configuraton_fact,
- hosts: fortigates
connection: httpapi
collections:
- fortinet.fortios
vars:
ansible_httpapi_use_ssl: yes
ansible_httpapi_validate_certs: no
ansible_httpapi_port: 443
vdom: "root"
tasks:
- name: Extracción de configuración
fortios_configuration_fact:
access_token: "token"
enable_log: "yes"
vdom: "global"
selector: 'system_global'
if that not fix the problem, you can try to upgrade fortinet.fortios to latest version by run ansible-galaxy collection install fortinet.fortios:2.1.7
Thanks, Maxx
Hi @ebenitezj ,
Thank you for raising this issue. From the error msg, there would be some inappropriate format around. From the configuration you provide, there would be an extra space before the arguments 'selector' and 'vdom', since they are sub-arguments of fortios_configuraton_fact,
- hosts: fortigates connection: httpapi collections: - fortinet.fortios vars: ansible_httpapi_use_ssl: yes ansible_httpapi_validate_certs: no ansible_httpapi_port: 443 vdom: "root" tasks: - name: Extracción de configuración fortios_configuration_fact: access_token: "token" enable_log: "yes" vdom: "global" selector: 'system_global'
if that not fix the problem, you can try to upgrade fortinet.fortios to latest version by run
ansible-galaxy collection install fortinet.fortios:2.1.7
Thanks, Maxx
Hi @MaxxLiu22 ,
Sorry for late reply.
When I run the fortigate playbook without roles it works correctly:
hosts: "{{inventario}}" gather_facts: true collections:
tasks:
name: get all fortios_configuration_fact: selector: system_global register: system_info
name: Backup a virtual domain. fortios_monitor_fact: selector: 'system_config_backup' vdom: 'root' params: scope: 'vdom' register: backupinfo
When I run the fortigate playbook with roles doesn't work properly:
It shows the following output when I run the template:
I have the following fortigate collection:
What could be the problem?
Thank you very much
I am also experiencing the same issue when attempting to utilise either the "fortios_system_virtual_switch" or "fortios_configuration_fact" in a task as part of a role (working fine within a standard playbook).
ERROR! couldn't resolve module/action 'fortios_configuration_fact'. This often indicates a misspelling, missing collection, or incorrect module path.
ERROR! couldn't resolve module/action 'fortios_system_virtual_switch'.
Software versions: ansible [core 2.13.7rc1] Fortios 7.0.9 fortinet.fortios 2.2.2
Thanks Mark
Hi @ebenitezj @markus2066 ,
I can reproduce this issue when using roles method, have reported it to the development team. I will let you know if there is any update.
Thanks, Maxx
Thanks Maxx
Hello,
When using roles, you may need to add collection dependencies in the meta/main.yml file. At the end , add the following:
collections:
- fortinet.fortios
Hope it helps. Best Regards Vincent
Hi all,
When I run AWX:
FAILED! => {"reason": "couldn't resolve module/action 'fortios_configuration_fact'. This often indicates a misspelling, missing collection, or incorrect module path.
My Fortigate have 6.4.5 version and galaxy collection is 2.1.5
In AWX I have a Template that calls comms/backup_config_prueba.yml
backup_config_prueba.yaml:
name: Extracción de configuración hosts: "{{inventario}}" gather_facts: "{{gather_facts_local}}" connection: httpapi collections:
roles:
role backup_config
I dont know why my playbook doesn't work