To use ansible with the fortiosapi module you need to install the module and ensure that you have it installed;
pip install fortiosapi
pip list | grep forti
Your install output should look like the following;
example
Now you can write your 1st playbook. Here's a simple playbook that was defined to check status
And the output when it ran;
Here's a simple group creation;
If you have problem executing use the ANSIBLE_DEBUG=1 while execution of the playbook
example;
ANSIBLE_DEBUG=1 ansible-playbook fortios1.yml
you can also step thru the play using the switch --step when playing the playbook
Reference my earlier posts on fortios API and examples
https://socpuppet.blogspot.com/2018/07/howto-use-fortios-api-to-add-delete.html
https://socpuppet.blogspot.com/2019/09/howto-use-fortios-apiuser.html
Ken Felix
NSE ( network security expert) and Route/Switching Engineer
kfelix -----a----t---- socpuppets ---dot---com
^ ^
=( @ @ )=
o
/ \
No comments:
Post a Comment