Hot!Ansible and FortiGates - module that lets you pull entire running-configuration?

Author
ergotherego
Gold Member
  • Total Posts : 139
  • Scores: 14
  • Reward points: 0
  • Status: offline
2021/09/24 15:41:00 (permalink)
0

Ansible and FortiGates - module that lets you pull entire running-configuration?

Is there an Ansible module that lets you pull down the entire running configuration, versus just certain facts?
 
Previously there was such a module called "fortios_config_module" but it appears to be missing from the current collection.
 
https://docs.ansible.com/...ios_config_module.html
#1
ergotherego
Gold Member
  • Total Posts : 139
  • Scores: 14
  • Reward points: 0
  • Status: offline
Re: Ansible and FortiGates - module that lets you pull entire running-configuration? 2021/09/28 09:21:56 (permalink)
0
I was able to solve this using the NTC modules, which use netmiko for SSH connections, which have a handler for FortiGates.
 
Instructions to install the NTC modules:
 
https://github.com/networktocode/ntc-ansible
 
Below is sample playbook that shows how to grab the running-config from a FortiGate. Replace the values for host, username, and password. This play does not require an inventory file.
 
---
- hosts: localhost
  connection: local
  gather_facts: no
  become: no

  tasks:

   - name: "Gather show-run from FortiGate"
     ntc_show_command:
       connection=ssh
       platform=fortinet
       command='show'
       host=firewall_device_name
       username=first.last
       password=password

#2
emnoc
Expert Member
  • Total Posts : 6225
  • Scores: 435
  • Reward points: 0
  • Joined: 2008/03/20 13:30:33
  • Location: AUSTIN TX AREA
  • Status: offline
Re: Ansible and FortiGates - module that lets you pull entire running-configuration? 2021/09/28 12:05:51 (permalink)
0
We-ve used Ansible and Napalm 
 
http://socpuppet.blogspot.com/2021/04/ansible-and-napalm-to-get-fortios.html
 
Playbook example is in the above link
 
 
Ken Felix

PCNSE 
NSE 
StrongSwan  
#3
Jump to:
© 2021 APG vNext Commercial Version 5.5