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

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

member_path fortinet.fortios.fortios_router_prefix_list usage? #209

Closed dancarltonigt closed 1 year ago

dancarltonigt commented 1 year ago

Is it possible to get a usage example of member_path under the fortinet.fortios.fortios_router_prefix_list module?

I have tried the following:

/rule/id /rule/ /rule rule/id /id

I get the same general error each time:

"msg": "Attribute <what I put in member_path>not as part of module schema"
MaxxLiu22 commented 1 year ago

Hi @dancarltonigt ,

Thank you for raising this issue, you can try to edit a specific rule by using the following example code. Hope that is helpful, if you still have issues, feel free to let me know.

- hosts: fortigates
  collections:
    - fortinet.fortios
  connection: httpapi
  vars:
    vdom: root
    ansible_httpapi_use_ssl: true
    ansible_httpapi_validate_certs: false
    ansible_httpapi_port: 443
  tasks:
    - name: Configure IPv4 prefix lists.
      fortios_router_prefix_list:
        vdom: "{{ vdom }}"
        member_path: rule:id
        member_state: present
        state: present
        access_token: 18q7nxtN9yzfghdr8yfzyyfr4HnrN4
        router_prefix_list:
          comments: test
          name: default_name_4
          rule:
            - action: permit
              flags: "7"
              ge: "9"
              id: "5"
              le: "10"
              prefix: test

Thanks, Maxx

dancarltonigt commented 1 year ago

@MaxxLiu22 thanks for that pointer.