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

GNU General Public License v3.0
85 stars 49 forks source link

fortios_monitor_fact system_interface not returning interfaces if ipv6 filter is used #268

Open ciberp opened 1 year ago

ciberp commented 1 year ago

If no filter is used, I get all interfaces, but I only want interfaces with IPv6 VRRP6 enabled, but it seems that filter is not working in any way?

```yaml ipv6: autoconf: disable cli-conn6-status: 0 dhcp6-client-options: '' dhcp6-iapd-list: [] dhcp6-information-request: disable dhcp6-prefix-delegation: disable dhcp6-relay-ip: '' dhcp6-relay-service: disable dhcp6-relay-type: regular icmp6-send-redirect: enable interface-identifier: '::' ip6-address: 2001:... ip6-allowaccess: ping ip6-default-life: 1800 ip6-delegated-prefix-iaid: 0 ip6-delegated-prefix-list: [] ip6-dns-server-override: enable ip6-extra-addr: [] ip6-hop-limit: 0 ip6-link-mtu: 0 ip6-manage-flag: disable ip6-max-interval: 600 ip6-min-interval: 198 ip6-mode: static ip6-other-flag: disable ip6-prefix-list: [] ip6-prefix-mode: dhcp6 ip6-reachable-time: 0 ip6-retrans-time: 0 ip6-send-adv: disable ip6-subnet: ::/0 ip6-upstream-interface: '' nd-cert: '' nd-cga-modifier: 0065636473612D776974682D73686132 nd-mode: basic nd-security-level: 0 nd-timestamp-delta: 300 nd-timestamp-fuzz: 1 ra-send-mtu: enable unique-autoconf-addr: disable vrip6_link_local: fe80::1 vrrp-virtual-mac6: enable vrrp6: - accept-mode: enable adv-interval: 1 preempt: enable priority: 200 q_origin_key: 1 start-time: 3 status: enable vrdst6: 2001:... vrgrp: 164 vrid: 1 vrip6: 2001:... l2forward: disable lacp-ha-slave: enable lacp-mode: active lacp-speed: slow lcp-echo-interval: 5 lcp-max-echo-fails: 3 link-up-delay: 50 lldp-network-policy: '' lldp-reception: vdom lldp-transmission: vdom macaddr: 00:00:00:00:00:00 managed-subnetwork-size: '256' management-ip: 0.0.0.0 0.0.0.0 measured-downstream-bandwidth: 0 measured-upstream-bandwidth: 0 mediatype: none member: [] min-links: 1 min-links-down: operational mode: static monitor-bandwidth: disable mtu: 1500 mtu-override: disable name: vl1148-lan ndiscforward: enable netbios-forward: disable netflow-sampler: disable np-qos-profile: 0 outbandwidth: 0 padt-retry-timeout: 1 password: '' ping-serv-status: 0 polling-interval: 20 pppoe-unnumbered-negotiate: enable pptp-auth-type: auto pptp-client: disable pptp-password: '' pptp-server-ip: 0.0.0.0 pptp-timeout: 0 pptp-user: '' preserve-session-route: disable priority: 1 priority-override: enable proxy-captive-portal: disable q_origin_key: vl1148-lan reachable-time: 30000 remote-ip: 0.0.0.0 0.0.0.0 replacemsg-override-group: '' role: lan sample-direction: both sample-rate: 2000 secondary-IP: disable secondaryip: [] security-8021x-dynamic-vlan-id: 0 security-8021x-master: '' security-8021x-mode: default security-exempt-list: '' security-external-logout: '' security-external-web: '' security-groups: [] security-mac-auth-bypass: disable security-mode: none security-redirect-url: '' service-name: '' sflow-sampler: disable snmp-index: 89 speed: auto spillover-threshold: 0 src-check: enable status: up stp: disable stp-ha-secondary: priority-adjust stpforward: disable stpforward-mode: rpl-all-ext-id subst: disable substitute-dst-mac: 00:00:00:00:00:00 swc-first-create: 0 swc-vlan: 0 switch-controller-access-vlan: disable switch-controller-arp-inspection: disable switch-controller-dhcp-snooping: disable switch-controller-dhcp-snooping-option82: disable switch-controller-dhcp-snooping-verify-mac: disable switch-controller-dynamic: '' switch-controller-feature: none switch-controller-igmp-snooping: disable switch-controller-igmp-snooping-fast-leave: disable switch-controller-igmp-snooping-proxy: disable switch-controller-iot-scanning: disable switch-controller-learning-limit: 0 switch-controller-mgmt-vlan: 4094 switch-controller-nac: '' switch-controller-rspan-mode: disable switch-controller-source-ip: outbound switch-controller-traffic-policy: '' system-id: 00:00:00:00:00:00 system-id-type: auto tagging: [] tcp-mss: 0 trunk: disable trust-ip-1: 0.0.0.0 0.0.0.0 trust-ip-2: 0.0.0.0 0.0.0.0 trust-ip-3: 0.0.0.0 0.0.0.0 trust-ip6-1: ::/0 trust-ip6-2: ::/0 trust-ip6-3: ::/0 type: vlan username: '' vdom: test vindex: 0 vlan-protocol: 8021q vlanforward: disable vlanid: 1148 vrf: 0 vrrp: - accept-mode: enable adv-interval: 1 ignore-default-route: enable preempt: enable priority: 200 proxy-arp: [] q_origin_key: 1 start-time: 3 status: enable version: '3' vrdst: 88... vrdst-priority: 0 vrgrp: 164 vrid: 1 vrip: 193... vrrp-virtual-mac: enable wccp: disable weight: 0 wins-ip: 0.0.0.0 ```
tasks:
    - name: get interfaces vrrp1
      fortinet.fortios.fortios_configuration_fact:
        vdom: test
        selector: system_interface  # to dobi iz vseh VDOM?!
        filters:
          #- ipv6.vrrp-virtual-mac6==enable  <-- returns nothing
          #- ipv6.vrgrp==164                 <-- returns nothing
          #- vlanid==1148                    <-- it works, vlan1148 is returned
          #- ipv6.vrrp6.vrgrp==164           <-- returns nothing
          #- vrrp.vrgrp==164                 <-- returns nothing
          #- vrrp-virtual-mac==enable        <-- it works, returns interfaces with this enabled
          - ipv6.vrrp-virtual-mac6==enable   <-- returns nothing

What am I doing wrong?

Thanks, regards Peter

JieX19 commented 1 year ago

Hi @ciberp

I've forwarded the question to the API team and am still waiting for the response. I will update you once I hear back from them.