Fortigate

44 views
Skip to first unread message

Bahagia BAG

unread,
May 7, 2023, 7:24:09 AM5/7/23
to ansible...@googlegroups.com
Hello

I want to save fortigate  configuration  using the command show full-configuration.
I already installed fortinet.fortios:2.2.3
What module do I have to load in ansible playbook?

Best regards

Atul Nasir

unread,
Aug 20, 2023, 6:05:11 PM8/20/23
to Ansible Project
---
- name: Save FortiGate Configuration
  hosts: your_fortigate_host
  gather_facts: no

  tasks:
    - name: Run show full-configuration command
      fortinet.fortios.fortios_command:
        username: your_username
        password: your_password
        host: "{{ inventory_hostname }}"
        https: yes
        command: "show full-configuration"
      register: config_output

    - name: Save configuration to a file
      copy:
        content: "{{ config_output.stdout[0] }}"
        dest: /path/to/save/configuration.txt
Reply all
Reply to author
Forward
0 new messages