Documentation

fortios_config - Manage config on Fortinet FortiOS firewall devices

New in version 2.3.

Synopsis

  • This module provides management of FortiOS Devices configuration.

Options

parameter required default choices comments
backup
no
  • yes
  • no
This argument will cause the module to create a backup of the current running-config from the remote device before any changes are made. The backup file is written to the i(backup) folder.
backup_filename
no
Specifies the backup filename. If omitted filename will be formated like HOST_config.YYYY-MM-DD@HH:MM:SS
backup_path
no
Specifies where to store backup files. Required if backup=yes.
filter
no
Only for partial backup, you can restrict by giving expected configuration path (ex. firewall address).
host
yes
Specifies the DNS hostname or IP address for connecting to the remote fortios device.
password
yes
Specifies the password used to authenticate to the remote device.
src
no
The src argument provides a path to the configuration file to load into the remote device.
timeout
no 60
Timeout in seconds for connecting to the remote device.
username
yes
Configures the username used to authenticate to the remote device.
vdom
no
Specifies on which vdom to apply configuration

Examples

- name: Backup current config
  fortios_config:
    host: 192.168.0.254
    username: admin
    password: password
    backup: yes

- name: Backup only address objects
  fortios_config:
    host: 192.168.0.254
    username: admin
    password: password
    backup: yes
    backup_path: /tmp/forti_backup/
    filter: "firewall address"

- name: Update configuration from file
  fortios_config:
    host: 192.168.0.254
    username: admin
    password: password
    src: new_configuration.conf

Return Values

Common return values are documented here Return Values, the following are the fields unique to this module:

name description returned type sample
running_config full config string always string
change_string The commands really executed by the module only if config changed string


Notes

Note

  • This module requires pyFG python library

Status

This module is flagged as preview which means that it is not guaranteed to have a backwards compatible interface.

Support

This module is community maintained without core committer oversight.

For more information on what this means please read Module Support

For help in developing on modules, should you be so inclined, please read Community Information & Contributing, Helping Testing PRs and Developing Modules.