Coder Social home page Coder Social logo

Comments (5)

chillancezen avatar chillancezen commented on July 21, 2024

hi @l0renzor ,

thanks for the issue.
I reproduced your issue with the following playbook:

#cat test.yml
- hosts: fortigates
  collections:
  - fortinet.fortios
  connection: httpapi
  vars:
   vdom: "root"
   ansible_httpapi_use_ssl: yes
   ansible_httpapi_validate_certs: no
   ansible_httpapi_port: 443
   router_prefix_list_one: 'prefix_lst_obj0'
   router_map_one: 'router_map_obj0'

  tasks:
  - name: Configure router prefix list
    fortios_router_prefix_list:
      vdom:  "{{ vdom }}"
      https: True
      state: present
      router_prefix_list:
        name: "{{ router_prefix_list_one }}"
        comments: 'router prefix list object created via ansible'
        rule:
           - action: 'permit'
             id: 1
             prefix: '22.33.44.55/32'
  - name: Configure router-map object
    fortios_router_route_map:
      vdom:  "{{ vdom }}"
      https: True
      state: present
      router_route_map:
        name: "{{ router_map_one }}"
        comments: 'router map object created via ansible'
        rule:
         - action: permit
           id: 1
           match_ip_address: "{{ router_prefix_list_one }}"
           match_metric: 1
           match_tag: 1
           set_metric: 2
           set_tag: 50
           set_weight: 100
           set_route_tag: 12
           set_local_preference: 44

from api server, I found the rule doesn't take effect at all:

0: config router route-map
0: edit "router_map_obj0"
0: config rule
0: edit 1
0: unset match-metric
0: unset match-tag
0: unset set-aspath
0: unset set-community
0: unset set-extcommunity-rt
0: unset set-extcommunity-soo
0: unset set-local-preference
0: unset set-metric
0: unset set-tag
0: unset set-weight
0: unset set-route-tag
0: end
0: end

so, the parameter is not filled right, I will take some to figure out the right parameters.

thanks,
Link

from ansible-galaxy-fortios-collection.

chillancezen avatar chillancezen commented on July 21, 2024
[httpsd 3502 - 1586702747     info] api_set_cmdb_attr[1624] -- 'name': 'router_map_obj0'
[httpsd 3502 - 1586702747     info] api_set_cmdb_attr[1624] -- 'comments': 'router map object created via ansible'
[httpsd 3502 - 1586702747     info] api_set_cmdb_attr[1624] -- 'id': '1'
[httpsd 3502 - 1586702747     info] api_set_cmdb_attr[1624] -- 'action': 'permit'
[httpsd 3502 - 1586702747     info] api_set_cmdb_attr[1624] -- 'match-ip-address': 'prefix_lst_obj0'
[httpsd 3502 - 1586702747     info] api_set_cmdb_attr[1624] -- 'match-metric': '1'
[httpsd 3502 - 1586702747     info] api_set_cmdb_attr[1624] -- 'match-tag': '1'
[httpsd 3502 - 1586702747     info] api_set_cmdb_attr[1624] -- 'set-local-preference': '44'
[httpsd 3502 - 1586702747     info] api_set_cmdb_attr[1624] -- 'set-metric': '2'
[httpsd 3502 - 1586702747     info] api_set_cmdb_attr[1624] -- 'set-tag': '50'
[httpsd 3502 - 1586702747     info] api_set_cmdb_attr[1624] -- 'set-weight': '100'
[httpsd 3502 - 1586702747     info] api_set_cmdb_attr[1624] -- 'set-route-tag': '12'
0: config router route-map
0: edit "router_map_obj0"
0: end
[httpsd 3502 - 1586702747     info] cmdb_save_with_children[269] -- appended main node (nret=0, is_new=0)
0: config router route-map
0: edit "router_map_obj0"
0: config rule
0: edit 1
0: set match-ip-address ''
0: unset match-metric
0: unset match-tag
0: unset set-local-preference
0: unset set-metric
0: unset set-tag
0: unset set-weight
0: unset set-route-tag
0: end
0: end

I found match-ip-address is resolved to null string here, it seems that it could not find the prefix-list object. though we created one:

FGVM04TM19006963 # show  router prefix-list
path=router, objname=prefix-list, tablename=(null), size=176
config router prefix-list
    edit "prefix_lst_obj0"
        set comments "router prefix list object created via ansible"
        config rule
            edit 1
                set prefix 22.33.44.55 255.255.255.255
                unset ge
                unset le
            next
        end
    next
end

thanks to Jie's help, we found this one, but no fix yet.
https://fndn.fortinet.net/index.php?/forums/topic/1995-fortios-rest-api-config-router-prefix-list-issuebug

I will continue to find a workaround.

from ansible-galaxy-fortios-collection.

diLLec avatar diLLec commented on July 21, 2024

Hey @chillancezen - I've been running in the same issue here. I think that this is a bug in the API. Did you already create a case to the fortinet support?

from ansible-galaxy-fortios-collection.

chillancezen avatar chillancezen commented on July 21, 2024

depends on mantis #0667114

from ansible-galaxy-fortios-collection.

JieX19 avatar JieX19 commented on July 21, 2024

Hi @l0renzor @diLLec,

The bug has been fixed in our latest version, can you please upgrade your device to Fortios v7.0.0 or later to make sure the module works as expected.

Also, please try our latest ansible galaxy collection ansible-galaxy collection install fortinet.fortios:2.1.2

Thanks!

from ansible-galaxy-fortios-collection.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.