fortinet-ansible-dev / ansible-galaxy-fortimanager-collection

GNU General Public License v3.0
16 stars 15 forks source link

Documentation Request: Add FortiAnalyzer to FortiManager #19

Closed JonTheNiceGuy closed 3 years ago

JonTheNiceGuy commented 3 years ago

It would be useful if you've got something similar to this page: https://raw.githubusercontent.com/fortinet-ansible-dev/fortimanager-playbook-example/2.0.0/output/fmgr_dvm_cmd_add_device.yml

I've tried the following, but I'm getting error -24 when

    - name: Add FortiAnalyzer devices to FortiManager
      delegate_to: FortiManager
      fmgr_dvm_cmd_add_device:
        bypass_validation: False
        dvm_cmd_add_device:
          adom: root
          device:
            adm_pass: "{{ ansible_password }}"
            adm_usr: "{{ ansible_user }}"
            ip: "{{ ansible_host }}"
            mgmt_mode: faz
            name: "{{ inventory_hostname }}"
          flags:
            - none
            - create_task
            - nonblocking
            - log_dev
      register: task

    - name: Inspect the Task Status
      fmgr_fact:
        facts:
          selector: "task_task"
          params:
            task: "{{ task.meta.response_data.task }}"
      register: taskinfo
      until: taskinfo.meta.response_data.percent == 100
      retries: 30
      delay: 3
      failed_when: taskinfo.meta.response_data.state == 'error'
chillancezen commented 3 years ago

eta: Apr 25

chillancezen commented 3 years ago

@JonTheNiceGuy , Jon,

I waited days to get a FAZ license, however, when I adding a FortiAnalyzer device to FortiManager, it always says probe failed.

is this your case when adding the FAZ device?

even did you get the same error when adding FAZ device from web GUI page?

thanks, Link

JonTheNiceGuy commented 3 years ago

I couldn't find where I'd found the fmgr_fact element of the above playbook. Turns out, it's here:

https://raw.githubusercontent.com/fortinet-ansible-dev/fortimanager-playbook-example/2.0.0/output/discover_and_add_device.yml

Running that playbook without trying to be more clever worked just fine. Bah.

chillancezen commented 3 years ago

Great to hear, Jon. my FMG &FAZ doesn't match so that the probing always fails.