fortios_system_config_backup_restore – Backup/restore fortigate configuration

New in version 2.10.

Synopsis

  • This module is able to backup or restore the global or particial settings of the fortigate Examples include all parameters and values need to be adjusted to datasources before usage. Tested with FOS v6.0.0

Requirements

The below requirements are needed on the host that executes this module.

  • ansible>=2.9.0

Parameters

  • host - host of fortigate type: str required: False
  • password - password of fortigate type: str required: False
  • username - username of fortigate type: str required: False
  • description - descriptive text type: str required: False
  • vdom - vdom to operate on type: str required: False default: root
  • config - configuration to restore type: str required: False
  • mkey - primary key type: str required: False
  • https - use https or not type: bool required: False default: True
  • ssl_verify - enable ssl verification or not type: bool required: False default: True
  • backup - content to backup type: str required: False
  • scope - scope to operation on type: str required: True
  • filename - the file name type: str required: True
  • commands - the command type: str required: False

Notes

Note

  • Legacy fortiosapi has been deprecated, httpapi is the preferred way to run playbooks
  • But this module relies on fortiosapi, please make sure fortiosapi is installed before using it

Examples

- hosts: localhost
  connection: httpapi
  collections:
    - fortinet.fortios
  vars:
    vdom: "root"
    host: "192.168.122.60"
    username: "admin"
    password: ""
  tasks:
  - name: backup global or a_specific_vdom settings
    fortios_system_config_backup_restore:
     config: "system config backup"
     host:  "{{ host }}"
     username: "{{ username }}"
     password: "{{ password }}"
     vdom: "{{ vdom }}"
     backup: "yes"
     https: True
     ssl_verify: False
     scope: "global or vdom"
     filename: "/tmp/backup_test"
  - name: Restore global or a_specific_vdom settings
    fortios_system_config_backup_restore:
     config: "system config restore"
     host:  "{{ host }}"
     username: "{{ username }}"
     password: "{{ password }}"
     vdom:  "{{ vdom }}"
     https: True
     ssl_verify: False
     scope: "global or vdom"
     filename: "/tmp/backup_test"

Return Values

Common return values are documented: https://docs.ansible.com/ansible/latest/reference_appendices/common_return_values.html#common-return-values, the following are the fields unique to this module:

  • build - Build number of the fortigate image returned: always type: str sample: 1547
  • http_method - Last method used to provision the content into FortiGate returned: always type: str sample: PUT
  • http_status - Last result given by FortiGate on last operation applied returned: always type: str sample: 200
  • mkey - Master key (id) used in the last call to FortiGate returned: success type: str sample: id
  • name - Name of the table used to fulfill the request returned: always type: str sample: urlfilter
  • path - Path of the table used to fulfill the request returned: always type: str sample: webfilter
  • revision - Internal revision number returned: always type: str sample: 17.0.2.10658
  • serial - Serial number of the unit returned: always type: str sample: FGVMEVYYQT3AB5352
  • status - Indication of the operation's result returned: always type: str sample: success
  • vdom - Virtual domain used returned: always type: str sample: root
  • version - Version of the FortiGate returned: always type: str sample: v5.6.3

Status

  • This module is not guaranteed to have a backwards compatible interface.

Authors

  • Link Zheng (@chillancezen)
  • Hongbin Lu (@fgtdev-hblu)
  • Frank Shen (@frankshen01)
  • Jie Xue (@JieX19)
  • Miguel Angel Munoz (@mamunozgonzalez)
  • Nicolas Thomas (@thomnico)

Hint

If you notice any issues in this documentation, you can create a pull request to improve it.