Open AndreiSucu opened 3 weeks ago
Hi @AndreiSucu ,
Thank you for your valuable suggestion. I have communicated your needs to our development team for further improvement. At present, the Ansible logic allows you to provide the access_token
only in the first task, with no need to provide it for the following tasks in the same playbook. However, your suggestion is still under consideration.
tasks:
- name: Interface port2
fortinet.fortios.fortios_system_interface:
state: "present"
access_token: "7Qmrjtng910sQzm0bbckfwNy4GQQ9n"
system_interface:
name: port2
status: up
- name: Interface port3
fortinet.fortios.fortios_system_interface:
state: "present"
system_interface:
name: port3
status: down
Thanks, Maxx
Hello,
I've stumbled upon the need to sometimes use access_token within my tasks. After doing some research I've found out that I can use the "access_token" parameter with module defaults like this:
But as you can see, this is really inconvenient, so I would suggest a feature request to create a module defaults group as described here:
https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_module_defaults.html#module-defaults-groups
This implementation would consist of defining "fortios" group as "action_groups" in:
/site-packages/ansible_collections/fortinet/fortios/meta/runtime.yml
So the playbook would look like this:
Pull request 'added "fortios" action_group with all fortios modules #321' opened.
Thank you.