Home

Awesome

FortiManager Ansible

Ansible Modules to manage Fortinet FortiManager

Introduction

This repository includes a number of Ansible modules to automate Fortinet FortiManager devices using the JSON-RPC API.

Modules

Here is a brief overview of all modules included in this repository.

Installation

You need to perform two steps to start using these modules.

  1. Ensure this repository is in your Ansible module search path.
  2. Install Dependencies.

Locate your search path

Here is how you can locate your search path:

$ ansible --version
ansible 2.1.1.0
  config file = /etc/ansible/ansible.cfg
  configured module search path = ???

If you already have a search path configured, clone the repo (see options below) while you are in your search path.

If you have a "default" or No search path shown, open the config file that is shown in the output above, here that is /etc/ansible/ansible.cfg. In that file, you'll see these first few lines:

[defaults]

# some basic default values...

inventory      = /etc/ansible/hosts
library        = /home/ntc/projects/

Add a path for library that exists in this repository - this will become your search path. Validate it with ansible --version after you make the change.

Clone the repo in your search path

$ git clone https://github.com/networktocode/fortimanager-ansible

As a quick test and sanity use ansible-doc on one of the modules before trying to use them in a playbook. For example, try this:

$ ansible-doc fortimgr_facts

If that works, Ansible can find the modules and you can proceed to installing the dependencies below.

Install Dependencies

$ cd fortimgr-ansible
$ pip install -r requirements.txt

Full Module Documentation

The following docs are the same type of docs you'd find on docs.ansible.com for modules that are found in Ansible core:

See Module Documentation

Examples

See Examples