Support Forum
The Forums are a place to find answers on a range of Fortinet products from peers and product experts.
walter_steadman
New Contributor

Fortigate and Ansible

Folks,

  Does any one have an example of how to log in to a fortigate with Ansible and do something simple like getting the system status.

 

I am just trying to get a start on using ansible but none of the thousands of docs I have searched just show a basic configuration.  I have a hosts file with the management IPs of 4 fortigates and I just want to have ansible log in to the devices and run a get system status.  

 

1 REPLY 1
davefig
New Contributor

- hosts: localhost   gather_facts: no   vars:     host: "1.2.3.4"     username: "admin"     password: "password"     vdom: "root"   tasks:   - name: "Configure Global Attributes"     fortios_system_global:       host: "{{ host }}"       username: "{{ username }}"       password: "{{ password }}"       vdom: "{{ vdom }}"       system_global:         hostname: "some_name"         timezone: "12"

 

This is a very basic YML that sets the device name and timezone. I've not gotten very far configuring a Fortigate using Ansible. The module documentation seems to be severely lacking. (There are tons of unlisted python dependencies on many of the other modules.)

 

I don't know why FortiNet is so far behind on cloud integrations. I have clients who would prefer to use FortiGates because of familiarity, but modules/plugins for provisioning them via Ansible and/or Terraform are nowhere near where they should be. I'd love to find out if anyone is successfully provisioning FortiGates using such tools, or if I should be looking for other vendors.

Announcements

Select Forum Responses to become Knowledge Articles!

Select the “Nominate to Knowledge Base” button to recommend a forum post to become a knowledge article.

Labels
Top Kudoed Authors