fortinet-ansible-dev / ansible-galaxy-fortios-collection

GNU General Public License v3.0
84 stars 48 forks source link

Error creating SDN connector address object #273

Closed asameli closed 4 months ago

asameli commented 10 months ago

Hi Team,

We have currently noticed that it is not possible to reference to an SDN connector with another name than "azure". Module affected: fortinet.fortios.fortios_firewall_address When trying to reference to an SDN connector names "AzureSDN" there will be an error in the Ansible module.

 name: Configure dynamic backend address object
    fortios_firewall_address:
      vdom:  "{{ vdom }}"
      state: "present"
      firewall_address:
        name: "Backend"
        type: "dynamic"
        sdn: "AzureSDN"
        sdn_addr_type: "private"
        filter: "Tag.type=websrv"

The SDN connector is named AzureSDN:

AS-GithubActions-Dem~-VM # config system sdn-connector
AS-GithubActions-Dem~-VM (sdn-connector) # show 
config system sdn-connector
    edit "AzureSDN"
        set type azure
    next
end

It gives the following error:

redirecting (type: connection) ansible.builtin.httpapi to ansible.netcommon.httpapi
redirecting (type: httpapi) ansible.builtin.fortios to fortinet.fortios.fortios
fatal: [AS-GithubActions-Demo1-FGT-VM]: FAILED! => {"changed": false, "meta": {"build": 2463, "cli_error": "node_check_object fail! for sdn is empty.\n\nvalue parse error before 'azure'\nCommand fail. Return code -56\n", "error": -56, "http_method": "POST", "http_status": 500, "name": "address", "path": "firewall", "revision": "4f0536199a8eb0a40e547df3940c71a6", "revision_changed": false, "serial": "FGVMELTM2300xxxx", "status": "error", "vdom": "root", "version": "v7.4.1"}, "msg": "Error in repo"}

If I rename the SDN connector to "azure":

AS-GithubActions-Dem~-VM # config system sdn-connector
AS-GithubActions-Dem~-VM (sdn-connector) # show 
config system sdn-connector
    edit "azure"
        set type azure
    next
end

And fill "azure" into the sdn field, it is working.

 - name: Configure dynamic backend address object
    fortios_firewall_address:
      vdom:  "{{ vdom }}"
      state: "present"
      firewall_address:
        name: "Backend"
        type: "dynamic"
        sdn: "azure"
        sdn_addr_type: "private"
        filter: "Tag.type=websrv"

This means the field SDN connector should allow other values than "azure" (the effective SDN connector name). This has also been discussed earlier in mantis: https://mantis.fortinet.com/bug_view_page.php?bug_id=0690570

JieX19 commented 10 months ago

Hi @asameli

Thanks for bringing us the question! I am looking into the case and will update you here once there's a fix.

Thanks, Jie

alagoutte commented 8 months ago

i get the same issue with VMware (ESXi) SDN connector...

JieX19 commented 5 months ago

Hi @asameli @alagoutte

Thank you very much for your patience! The issue has been fixed in the coming release, will update you in this thread once it's released.

JieX19 commented 4 months ago

Hi @alagoutte @asameli

Please install the latest version 2.3.6 and try this module again. I'll close this ticket at the moment because the issue is fixed in this version already. Feel free to reopen it if you still experience the same issue.

Thanks, Jie

alagoutte commented 3 months ago

Hi @alagoutte @asameli

Please install the latest version 2.3.6 and try this module again. I'll close this ticket at the moment because the issue is fixed in this version already. Feel free to reopen it if you still experience the same issue.

Thanks, Jie

with somedelay ;) thanks it work !