Closed mattford1212 closed 2 years ago
Hello, I'm still seeing fortios_router_bgp module only adding last entry in a dictionary. When I loop the module for multiple bgp neighbours, only the 1 last entry is added.
fortinet.fortios 1.0.9 ansible 2.12.1
<172.30.6.56> ESTABLISH LOCAL CONNECTION FOR USER: ansible <172.30.6.56> EXEC /bin/sh -c '( umask 77 && mkdir -p "echo /home/ansible/.ansible/tmp/ansible-local-8566999auak95g"&& mkdir "echo /home/ansible/.ansible/tmp/ansible-local-8566999auak95g/ansible-tmp-1644467059.4002728-856705-49686640687111" && echo ansible-tmp-1644467059.4002728-856705-49686640687111="echo /home/ansible/.ansible/tmp/ansible-local-8566999auak95g/ansible-tmp-1644467059.4002728-856705-49686640687111" ) && sleep 0' redirecting (type: modules) ansible.builtin.fortios_router_bgp to fortinet.fortios.fortios_router_bgp Using module file /home/ansible/.ansible/collections/ansible_collections/fortinet/fortios/plugins/modules/fortios_router_bgp.py <172.30.6.56> PUT /home/ansible/.ansible/tmp/ansible-local-8566999auak95g/tmpu40up728 TO /home/ansible/.ansible/tmp/ansible-local-8566999auak95g/ansible-tmp-1644467059.4002728-856705-49686640687111/AnsiballZ_fortios_router_bgp.py <172.30.6.56> EXEC /bin/sh -c 'chmod u+x /home/ansible/.ansible/tmp/ansible-local-8566999auak95g/ansible-tmp-1644467059.4002728-856705-49686640687111/ /home/ansible/.ansible/tmp/ansible-local-8566999auak95g/ansible-tmp-1644467059.4002728-856705-49686640687111/AnsiballZ_fortios_router_bgp.py && sleep 0' <172.30.6.56> EXEC /bin/sh -c '/usr/bin/python3 /home/ansible/.ansible/tmp/ansible-local-8566999auak95g/ansible-tmp-1644467059.4002728-856705-49686640687111/AnsiballZ_fortios_router_bgp.py && sleep 0' <172.30.6.56> EXEC /bin/sh -c 'rm -f -r /home/ansible/.ansible/tmp/ansible-local-8566999auak95g/ansible-tmp-1644467059.4002728-856705-49686640687111/ > /dev/null 2>&1 && sleep 0' redirecting (type: connection) ansible.builtin.httpapi to ansible.netcommon.httpapi changed: [RTR01] => (item={'name': '1111', 'vdom': 'TEST', 'activate': 'enable', 'remote_as': 1111, 'neighbor': '1.1.1.1', 'soft_reconfiguration': 'enable', 'send_community6': 'disable', 'description': '1111'}) => { "ansible_loop_var": "item", "changed": true, "invocation": { "module_args": { "access_token": null, "enable_log": null, "member_path": null, "member_state": null, "router_bgp": { "additional_path": null, "additional_path6": null, "additional_path_select": null, "additional_path_select6": null, "admin_distance": null, "aggregate_address": null, "aggregate_address6": null, "always_compare_med": null, "as": 135889, "bestpath_as_path_ignore": null, "bestpath_cmp_confed_aspath": null, "bestpath_cmp_routerid": null, "bestpath_med_confed": null, "bestpath_med_missing_as_worst": null, "client_to_client_reflection": null, "cluster_id": null, "confederation_identifier": null, "confederation_peers": null, "dampening": null, "dampening_max_suppress_time": null, "dampening_reachability_half_life": null, "dampening_reuse": null, "dampening_route_map": null, "dampening_suppress": null, "dampening_unreachability_half_life": null, "default_local_preference": null, "deterministic_med": null, "distance_external": null, "distance_internal": null, "distance_local": null, "ebgp_multipath": null, "enforce_first_as": null, "fast_external_failover": null, "graceful_end_on_timer": null, "graceful_restart": null, "graceful_restart_time": null, "graceful_stalepath_time": null, "graceful_update_delay": null, "holdtime_timer": null, "ibgp_multipath": null, "ignore_optional_capability": null, "keepalive_timer": null, "log_neighbour_changes": null, "multipath_recursive_distance": null, "neighbor": [ { "activate": "enable", "description": "1111 Primary", "ip": "1.1.1.1", "remote-as": "1111", "send-community6": "disable", "soft-reconfiguration": "enable" } ], "neighbor_group": null, "neighbor_range": null, "neighbor_range6": null, "network": null, "network6": null, "network_import_check": null, "recursive_next_hop": null, "redistribute": null, "redistribute6": null, "router_id": null, "scan_time": null, "synchronization": null, "vrf_leak": null, "vrf_leak6": null }, "vdom": "INET" } }, "item": { "activate": "enable", "description": "1111", "name": "1111", "neighbor": "1.1.1.1", "remote_as": 24324, "send_community6": "disable", "soft_reconfiguration": "enable", "vdom": "INET" }, "meta": { "build": 1914, "http_method": "PUT", "http_status": 200, "name": "bgp", "old_revision": "de1aa31ecc3fc8aaf52d9d5d6de5ee33", "path": "router", "revision": "f5b4f3d87ae79ede05b144bedbf04793", "revision_changed": true, "serial": "XXX", "status": "success", "vdom": "INET", "version": "v6.4.8" } } <172.30.6.56> ESTABLISH HTTP(S) CONNECTFOR USER: admin TO https://172.30.6.56:443 <172.30.6.56> ESTABLISH LOCAL CONNECTION FOR USER: ansible <172.30.6.56> EXEC /bin/sh -c '( umask 77 && mkdir -p "echo /home/ansible/.ansible/tmp/ansible-local-8566999auak95g"&& mkdir "echo /home/ansible/.ansible/tmp/ansible-local-8566999auak95g/ansible-tmp-1644467060.3322175-856705-162200992879369" && echo ansible-tmp-1644467060.3322175-856705-162200992879369="echo /home/ansible/.ansible/tmp/ansible-local-8566999auak95g/ansible-tmp-1644467060.3322175-856705-162200992879369" ) && sleep 0' redirecting (type: modules) ansible.builtin.fortios_router_bgp to fortinet.fortios.fortios_router_bgp Using module file /home/ansible/.ansible/collections/ansible_collections/fortinet/fortios/plugins/modules/fortios_router_bgp.py <172.30.6.56> PUT /home/ansible/.ansible/tmp/ansible-local-8566999auak95g/tmphhk7g5ay TO /home/ansible/.ansible/tmp/ansible-local-8566999auak95g/ansible-tmp-1644467060.3322175-856705-162200992879369/AnsiballZ_fortios_router_bgp.py <172.30.6.56> EXEC /bin/sh -c 'chmod u+x /home/ansible/.ansible/tmp/ansible-local-8566999auak95g/ansible-tmp-1644467060.3322175-856705-162200992879369/ /home/ansible/.ansible/tmp/ansible-local-8566999auak95g/ansible-tmp-1644467060.3322175-856705-162200992879369/AnsiballZ_fortios_router_bgp.py && sleep 0' <172.30.6.56> EXEC /bin/sh -c '/usr/bin/python3 /home/ansible/.ansible/tmp/ansible-local-8566999auak95g/ansible-tmp-1644467060.3322175-856705-162200992879369/AnsiballZ_fortios_router_bgp.py && sleep 0' <172.30.6.56> EXEC /bin/sh -c 'rm -f -r /home/ansible/.ansible/tmp/ansible-local-8566999auak95g/ansible-tmp-1644467060.3322175-856705-162200992879369/ > /dev/null 2>&1 && sleep 0' changed: [RTR01] => (item={'name': '2222', 'vdom': 'TEST', 'activate': 'enable', 'remote_as': 2222, 'neighbor': '2.2.2.2.', 'soft_reconfiguration': 'enable', 'send_community6': 'disable', 'description': '2222'}) => { "ansible_loop_var": "item", "changed": true, "invocation": { "module_args": { "access_token": null, "enable_log": null, "member_path": null, "member_state": null, "router_bgp": { "additional_path": null, "additional_path6": null, "additional_path_select": null, "additional_path_select6": null, "admin_distance": null, "aggregate_address": null, "aggregate_address6": null, "always_compare_med": null, "as": 135889, "bestpath_as_path_ignore": null, "bestpath_cmp_confed_aspath": null, "bestpath_cmp_routerid": null, "bestpath_med_confed": null, "bestpath_med_missing_as_worst": null, "client_to_client_reflection": null, "cluster_id": null, "confederation_identifier": null, "confederation_peers": null, "dampening": null, "dampening_max_suppress_time": null, "dampening_reachability_half_life": null, "dampening_reuse": null, "dampening_route_map": null, "dampening_suppress": null, "dampening_unreachability_half_life": null, "default_local_preference": null, "deterministic_med": null, "distance_external": null, "distance_internal": null, "distance_local": null, "ebgp_multipath": null, "enforce_first_as": null, "fast_external_failover": null, "graceful_end_on_timer": null, "graceful_restart": null, "graceful_restart_time": null, "graceful_stalepath_time": null, "graceful_update_delay": null, "holdtime_timer": null, "ibgp_multipath": null, "ignore_optional_capability": null, "keepalive_timer": null, "log_neighbour_changes": null, "multipath_recursive_distance": null, "neighbor": [ { "activate": "enable", "description": "2222", "ip": "2.2.2.2", "remote-as": "2222", "send-community6": "disable", "soft-reconfiguration": "enable" } ], "neighbor_group": null, "neighbor_range": null, "neighbor_range6": null, "network": null, "network6": null, "network_import_check": null, "recursive_next_hop": null, "redistribute": null, "redistribute6": null, "router_id": null, "scan_time": null, "synchronization": null, "vrf_leak": null, "vrf_leak6": null }, "vdom": "INET" } }, "item": { "activate": "enable", "description": "2222", "name": "2222", "neighbor": "2.2.2.2", "remote_as": 2222, "send_community6": "disable", "soft_reconfiguration": "enable", "vdom": "Test" }, "meta": { "build": 1914, "http_method": "PUT", "http_status": 200, "name": "bgp", "old_revision": "f5b4f3d87ae79ede05b144bedbf04793", "path": "router", "revision": "736d6cce0b97d721fb91a4dcd0db14c3", "revision_changed": true, "serial": "XXX", "status": "success", "vdom": "TEST", "version": "v6.4.8" } } META: role_complete for RTR01
echo /home/ansible/.ansible/tmp/ansible-local-8566999auak95g
echo /home/ansible/.ansible/tmp/ansible-local-8566999auak95g/ansible-tmp-1644467059.4002728-856705-49686640687111
echo /home/ansible/.ansible/tmp/ansible-local-8566999auak95g/ansible-tmp-1644467060.3322175-856705-162200992879369
META: ran handlers META: ran handlers
Hello, I'm still seeing fortios_router_bgp module only adding last entry in a dictionary. When I loop the module for multiple bgp neighbours, only the 1 last entry is added.
fortinet.fortios 1.0.9 ansible 2.12.1
<172.30.6.56> ESTABLISH LOCAL CONNECTION FOR USER: ansible <172.30.6.56> EXEC /bin/sh -c '( umask 77 && mkdir -p "
echo /home/ansible/.ansible/tmp/ansible-local-8566999auak95g
"&& mkdir "echo /home/ansible/.ansible/tmp/ansible-local-8566999auak95g/ansible-tmp-1644467059.4002728-856705-49686640687111
" && echo ansible-tmp-1644467059.4002728-856705-49686640687111="echo /home/ansible/.ansible/tmp/ansible-local-8566999auak95g/ansible-tmp-1644467059.4002728-856705-49686640687111
" ) && sleep 0' redirecting (type: modules) ansible.builtin.fortios_router_bgp to fortinet.fortios.fortios_router_bgp Using module file /home/ansible/.ansible/collections/ansible_collections/fortinet/fortios/plugins/modules/fortios_router_bgp.py <172.30.6.56> PUT /home/ansible/.ansible/tmp/ansible-local-8566999auak95g/tmpu40up728 TO /home/ansible/.ansible/tmp/ansible-local-8566999auak95g/ansible-tmp-1644467059.4002728-856705-49686640687111/AnsiballZ_fortios_router_bgp.py <172.30.6.56> EXEC /bin/sh -c 'chmod u+x /home/ansible/.ansible/tmp/ansible-local-8566999auak95g/ansible-tmp-1644467059.4002728-856705-49686640687111/ /home/ansible/.ansible/tmp/ansible-local-8566999auak95g/ansible-tmp-1644467059.4002728-856705-49686640687111/AnsiballZ_fortios_router_bgp.py && sleep 0' <172.30.6.56> EXEC /bin/sh -c '/usr/bin/python3 /home/ansible/.ansible/tmp/ansible-local-8566999auak95g/ansible-tmp-1644467059.4002728-856705-49686640687111/AnsiballZ_fortios_router_bgp.py && sleep 0' <172.30.6.56> EXEC /bin/sh -c 'rm -f -r /home/ansible/.ansible/tmp/ansible-local-8566999auak95g/ansible-tmp-1644467059.4002728-856705-49686640687111/ > /dev/null 2>&1 && sleep 0' redirecting (type: connection) ansible.builtin.httpapi to ansible.netcommon.httpapi changed: [RTR01] => (item={'name': '1111', 'vdom': 'TEST', 'activate': 'enable', 'remote_as': 1111, 'neighbor': '1.1.1.1', 'soft_reconfiguration': 'enable', 'send_community6': 'disable', 'description': '1111'}) => { "ansible_loop_var": "item", "changed": true, "invocation": { "module_args": { "access_token": null, "enable_log": null, "member_path": null, "member_state": null, "router_bgp": { "additional_path": null, "additional_path6": null, "additional_path_select": null, "additional_path_select6": null, "admin_distance": null, "aggregate_address": null, "aggregate_address6": null, "always_compare_med": null, "as": 135889, "bestpath_as_path_ignore": null, "bestpath_cmp_confed_aspath": null, "bestpath_cmp_routerid": null, "bestpath_med_confed": null, "bestpath_med_missing_as_worst": null, "client_to_client_reflection": null, "cluster_id": null, "confederation_identifier": null, "confederation_peers": null, "dampening": null, "dampening_max_suppress_time": null, "dampening_reachability_half_life": null, "dampening_reuse": null, "dampening_route_map": null, "dampening_suppress": null, "dampening_unreachability_half_life": null, "default_local_preference": null, "deterministic_med": null, "distance_external": null, "distance_internal": null, "distance_local": null, "ebgp_multipath": null, "enforce_first_as": null, "fast_external_failover": null, "graceful_end_on_timer": null, "graceful_restart": null, "graceful_restart_time": null, "graceful_stalepath_time": null, "graceful_update_delay": null, "holdtime_timer": null, "ibgp_multipath": null, "ignore_optional_capability": null, "keepalive_timer": null, "log_neighbour_changes": null, "multipath_recursive_distance": null, "neighbor": [ { "activate": "enable", "description": "1111 Primary", "ip": "1.1.1.1", "remote-as": "1111", "send-community6": "disable", "soft-reconfiguration": "enable" } ], "neighbor_group": null, "neighbor_range": null, "neighbor_range6": null, "network": null, "network6": null, "network_import_check": null, "recursive_next_hop": null, "redistribute": null, "redistribute6": null, "router_id": null, "scan_time": null, "synchronization": null, "vrf_leak": null, "vrf_leak6": null }, "vdom": "INET" } }, "item": { "activate": "enable", "description": "1111", "name": "1111", "neighbor": "1.1.1.1", "remote_as": 24324, "send_community6": "disable", "soft_reconfiguration": "enable", "vdom": "INET" }, "meta": { "build": 1914, "http_method": "PUT", "http_status": 200, "name": "bgp", "old_revision": "de1aa31ecc3fc8aaf52d9d5d6de5ee33", "path": "router", "revision": "f5b4f3d87ae79ede05b144bedbf04793", "revision_changed": true, "serial": "XXX", "status": "success", "vdom": "INET", "version": "v6.4.8" } } <172.30.6.56> ESTABLISH HTTP(S) CONNECTFOR USER: admin TO https://172.30.6.56:443 <172.30.6.56> ESTABLISH LOCAL CONNECTION FOR USER: ansible <172.30.6.56> EXEC /bin/sh -c '( umask 77 && mkdir -p "echo /home/ansible/.ansible/tmp/ansible-local-8566999auak95g
"&& mkdir "echo /home/ansible/.ansible/tmp/ansible-local-8566999auak95g/ansible-tmp-1644467060.3322175-856705-162200992879369
" && echo ansible-tmp-1644467060.3322175-856705-162200992879369="echo /home/ansible/.ansible/tmp/ansible-local-8566999auak95g/ansible-tmp-1644467060.3322175-856705-162200992879369
" ) && sleep 0' redirecting (type: modules) ansible.builtin.fortios_router_bgp to fortinet.fortios.fortios_router_bgp Using module file /home/ansible/.ansible/collections/ansible_collections/fortinet/fortios/plugins/modules/fortios_router_bgp.py <172.30.6.56> PUT /home/ansible/.ansible/tmp/ansible-local-8566999auak95g/tmphhk7g5ay TO /home/ansible/.ansible/tmp/ansible-local-8566999auak95g/ansible-tmp-1644467060.3322175-856705-162200992879369/AnsiballZ_fortios_router_bgp.py <172.30.6.56> EXEC /bin/sh -c 'chmod u+x /home/ansible/.ansible/tmp/ansible-local-8566999auak95g/ansible-tmp-1644467060.3322175-856705-162200992879369/ /home/ansible/.ansible/tmp/ansible-local-8566999auak95g/ansible-tmp-1644467060.3322175-856705-162200992879369/AnsiballZ_fortios_router_bgp.py && sleep 0' <172.30.6.56> EXEC /bin/sh -c '/usr/bin/python3 /home/ansible/.ansible/tmp/ansible-local-8566999auak95g/ansible-tmp-1644467060.3322175-856705-162200992879369/AnsiballZ_fortios_router_bgp.py && sleep 0' <172.30.6.56> EXEC /bin/sh -c 'rm -f -r /home/ansible/.ansible/tmp/ansible-local-8566999auak95g/ansible-tmp-1644467060.3322175-856705-162200992879369/ > /dev/null 2>&1 && sleep 0' changed: [RTR01] => (item={'name': '2222', 'vdom': 'TEST', 'activate': 'enable', 'remote_as': 2222, 'neighbor': '2.2.2.2.', 'soft_reconfiguration': 'enable', 'send_community6': 'disable', 'description': '2222'}) => { "ansible_loop_var": "item", "changed": true, "invocation": { "module_args": { "access_token": null, "enable_log": null, "member_path": null, "member_state": null, "router_bgp": { "additional_path": null, "additional_path6": null, "additional_path_select": null, "additional_path_select6": null, "admin_distance": null, "aggregate_address": null, "aggregate_address6": null, "always_compare_med": null, "as": 135889, "bestpath_as_path_ignore": null, "bestpath_cmp_confed_aspath": null, "bestpath_cmp_routerid": null, "bestpath_med_confed": null, "bestpath_med_missing_as_worst": null, "client_to_client_reflection": null, "cluster_id": null, "confederation_identifier": null, "confederation_peers": null, "dampening": null, "dampening_max_suppress_time": null, "dampening_reachability_half_life": null, "dampening_reuse": null, "dampening_route_map": null, "dampening_suppress": null, "dampening_unreachability_half_life": null, "default_local_preference": null, "deterministic_med": null, "distance_external": null, "distance_internal": null, "distance_local": null, "ebgp_multipath": null, "enforce_first_as": null, "fast_external_failover": null, "graceful_end_on_timer": null, "graceful_restart": null, "graceful_restart_time": null, "graceful_stalepath_time": null, "graceful_update_delay": null, "holdtime_timer": null, "ibgp_multipath": null, "ignore_optional_capability": null, "keepalive_timer": null, "log_neighbour_changes": null, "multipath_recursive_distance": null, "neighbor": [ { "activate": "enable", "description": "2222", "ip": "2.2.2.2", "remote-as": "2222", "send-community6": "disable", "soft-reconfiguration": "enable" } ], "neighbor_group": null, "neighbor_range": null, "neighbor_range6": null, "network": null, "network6": null, "network_import_check": null, "recursive_next_hop": null, "redistribute": null, "redistribute6": null, "router_id": null, "scan_time": null, "synchronization": null, "vrf_leak": null, "vrf_leak6": null }, "vdom": "INET" } }, "item": { "activate": "enable", "description": "2222", "name": "2222", "neighbor": "2.2.2.2", "remote_as": 2222, "send_community6": "disable", "soft_reconfiguration": "enable", "vdom": "Test" }, "meta": { "build": 1914, "http_method": "PUT", "http_status": 200, "name": "bgp", "old_revision": "f5b4f3d87ae79ede05b144bedbf04793", "path": "router", "revision": "736d6cce0b97d721fb91a4dcd0db14c3", "revision_changed": true, "serial": "XXX", "status": "success", "vdom": "TEST", "version": "v6.4.8" } } META: role_complete for RTR01META: ran handlers META: ran handlers