Closed danieldeno closed 3 years ago
hi @danieldeno ,
in role, the task module must be full one:fortinet.fortios.fortios_system_global
, otherwise it will seek legacy module path.
hi @chillancezen
thanks for the quick update, i can confirm this solved the issue regarding access_token use within a ansible role.
The one thing i don't understand is why this needs to be done ... cause if i'm including the task file the task works like a charm without the need to specify the full module path
Hi @danieldeno,
For the question you mentioned "The one thing i don't understand is why this needs to be done."
it's a mandatory requirement by Ansible though. From my point of view, because 'Role' is a complex domain and can be shared among different users, you got to specify the exact module to run the playbook when using 'Role'. This is how Ansible design the 'Role'.
Hi there,
My issue is that when i'm including a role in a playbook i can't get the access_token to work properly
Setup
I have the following playbook.
The role defined in this playbook consist of a main.yml which includes a task system.yml
main.yml
system.yml
I have a couple of group_vars and host_vars defined in there respective locations
group_vars:
host_vars:
Error
Whenever i run this playbook i get the following error message:
As you can see every variable is being passed to the respective field correctly
But when i uncomment the ansible_user & ansible_password variables defined in the group_vars and delete the access_token from the task therefor using username/password combination to log onto the fortigate the role just works.
When i change remove the role from the playbook and instead use an include_task to point to the role's main.yml task file the play just works.
playbook with include_tasks instead of role:
output from using include_task to point to role's main.yml