Closed tim427 closed 1 month ago
You can run the module with diff and check mode (--diff -C
) enabled to see what it thinks it is changing.
The reason seems to be that you provide "as" as a string, while the router returns it as an int. The module sees these as different values and thus tries to change the value.
@felixfontein Perfect, that was indeed the cause. Thanks!
SUMMARY
When using:
I receive the status "changed" and the ID is indeed changed:
See following (nothing has changed):
`-vvvv` output
``` changed: [routerhostname -> localhost] => { "changed": true, "diff": { "after": { "data": [ { ".id": "*F", "address-families": "ip", "as": 4321, "disabled": false, "name": "ixname-ipv4", "output.network": "bgp-networks", "router-id": "1.2.3.18", "routing-table": "main" }, { ".id": "*10", "address-families": "ipv6", "as": 4321, "disabled": false, "name": "ixname-ipv6", "output.network": "bgp-networks", "router-id": "1.2.3.18", "routing-table": "main" } ] }, "before": { "data": [ { ".id": "*F", "address-families": "ip", "as": 4321, "disabled": false, "name": "ixname-ipv4", "output.network": "bgp-networks", "router-id": "1.2.3.18", "routing-table": "main" }, { ".id": "*10", "address-families": "ipv6", "as": 4321, "disabled": false, "name": "ixname-ipv6", "output.network": "bgp-networks", "router-id": "1.2.3.18", "routing-table": "main" } ] } }, "invocation": { "module_args": { "ca_path": null, "data": [ { "address-families": "ip", "as": "4321", "disabled": false, "name": "ixname-ipv4", "output.network": "bgp-networks", "router-id": "1.2.3.18", "routing-table": "main" }, { "address-families": "ipv6", "as": "4321", "disabled": false, "name": "ixname-ipv6", "output.network": "bgp-networks", "router-id": "1.2.3.18", "routing-table": "main" } ], "encoding": "ASCII", "ensure_order": true, "force_no_cert": false, "handle_absent_entries": "remove", "handle_entries_content": "remove", "handle_read_only": "error", "handle_write_only": "create_only", "hostname": "routerhostname", "password": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER", "path": "routing bgp template", "port": null, "restrict": [ { "field": "name", "invert": false, "match_disabled": false, "regex": "ixname-ipv[4,6]", "values": null } ], "timeout": 10, "tls": true, "username": "tim", "validate_cert_hostname": false, "validate_certs": true } }, "new_data": [ { ".id": "*F", "address-families": "ip", "as": 4321, "disabled": false, "name": "ixname-ipv4", "output.network": "bgp-networks", "router-id": "1.2.3.18", "routing-table": "main" }, { ".id": "*10", "address-families": "ipv6", "as": 4321, "disabled": false, "name": "ixname-ipv6", "output.network": "bgp-networks", "router-id": "1.2.3.18", "routing-table": "main" } ], "old_data": [ { ".id": "*F", "address-families": "ip", "as": 4321, "disabled": false, "name": "ixname-ipv4", "output.network": "bgp-networks", "router-id": "1.2.3.18", "routing-table": "main" }, { ".id": "*10", "address-families": "ipv6", "as": 4321, "disabled": false, "name": "ixname-ipv6", "output.network": "bgp-networks", "router-id": "1.2.3.18", "routing-table": "main" } ] } ```Whe using: When using:
I receive status "changed", without any actual changes. See following (only the
.id
has changed):`-vvvv` output
``` changed: [routerhostname -> localhost] => { "changed": true, "diff": { "after": { "data": [ { ".id": "*A0", "address-families": "ip", "as": 4321, "disabled": true, "local.address": "1.2.3.18", "local.role": "ebgp", "name": "ixname-as1234-1-ipv4", "output.network": "bgp-networks", "remote.address": "1.2.3.253", "remote.as": 1234, "router-id": "1.2.3.18", "routing-table": "main", "templates": "ixname-ipv4" }, { ".id": "*A1", "address-families": "ipv6", "as": 4321, "disabled": true, "local.address": "2001:1:2:3:4::304:1", "local.role": "ebgp", "name": "ixname-as1234-1-ipv6", "output.network": "bgp-networks", "remote.address": "2001:1:2:3:4::e2", "remote.as": 1234, "router-id": "1.2.3.18", "routing-table": "main", "templates": "ixname-ipv6" } ] }, "before": { "data": [ { ".id": "*94", "address-families": "ip", "as": 4321, "disabled": true, "local.address": "1.2.3.18", "local.role": "ebgp", "name": "ixname-as1234-1-ipv4", "output.network": "bgp-networks", "remote.address": "1.2.3.253", "remote.as": 1234, "router-id": "1.2.3.18", "routing-table": "main", "templates": "ixname-ipv4" }, { ".id": "*95", "address-families": "ipv6", "as": 4321, "disabled": true, "local.address": "2001:1:2:3:4::304:1", "local.role": "ebgp", "name": "ixname-as1234-1-ipv6", "output.network": "bgp-networks", "remote.address": "2001:1:2:3:4::e2", "remote.as": 1234, "router-id": "1.2.3.18", "routing-table": "main", "templates": "ixname-ipv6" } ] } }, "invocation": { "module_args": { "ca_path": null, "data": [ { ".id": "*A0", "disabled": true, "local.address": "1.2.3.18", "local.role": "ebgp", "name": "ixname-as1234-1-ipv4", "remote.address": "1.2.3.253", "remote.as": "1234", "templates": "ixname-ipv4" }, { ".id": "*A1", "disabled": true, "local.address": "2001:1:2:3:4::304:1", "local.role": "ebgp", "name": "ixname-as1234-1-ipv6", "remote.address": "2001:1:2:3:4::e2", "remote.as": "1234", "templates": "ixname-ipv6" } ], "encoding": "ASCII", "ensure_order": true, "force_no_cert": false, "handle_absent_entries": "remove", "handle_entries_content": "remove", "handle_read_only": "error", "handle_write_only": "create_only", "hostname": "routerhostname", "password": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER", "path": "routing bgp connection", "port": null, "restrict": [ { "field": "name", "invert": false, "match_disabled": false, "regex": "ixname-as1234-1-ipv[4,6]", "values": null } ], "timeout": 10, "tls": true, "username": "tim", "validate_cert_hostname": false, "validate_certs": true } }, "new_data": [ { ".id": "*A0", "address-families": "ip", "as": 4321, "disabled": true, "local.address": "1.2.3.18", "local.role": "ebgp", "name": "ixname-as1234-1-ipv4", "output.network": "bgp-networks", "remote.address": "1.2.3.253", "remote.as": 1234, "router-id": "1.2.3.18", "routing-table": "main", "templates": "ixname-ipv4" }, { ".id": "*A1", "address-families": "ipv6", "as": 4321, "disabled": true, "local.address": "2001:1:2:3:4::304:1", "local.role": "ebgp", "name": "ixname-as1234-1-ipv6", "output.network": "bgp-networks", "remote.address": "2001:1:2:3:4::e2", "remote.as": 1234, "router-id": "1.2.3.18", "routing-table": "main", "templates": "ixname-ipv6" } ], "old_data": [ { ".id": "*94", "address-families": "ip", "as": 4321, "disabled": true, "local.address": "1.2.3.18", "local.role": "ebgp", "name": "ixname-as1234-1-ipv4", "output.network": "bgp-networks", "remote.address": "1.2.3.253", "remote.as": 1234, "router-id": "1.2.3.18", "routing-table": "main", "templates": "ixname-ipv4" }, { ".id": "*95", "address-families": "ipv6", "as": 4321, "disabled": true, "local.address": "2001:1:2:3:4::304:1", "local.role": "ebgp", "name": "ixname-as1234-1-ipv6", "output.network": "bgp-networks", "remote.address": "2001:1:2:3:4::e2", "remote.as": 1234, "router-id": "1.2.3.18", "routing-table": "main", "templates": "ixname-ipv6" } ] } ```ISSUE TYPE
COMPONENT NAME
api-modify
ANSIBLE VERSION
COLLECTION VERSION
CONFIGURATION
OS / ENVIRONMENT
Debian 12.7
STEPS TO REPRODUCE
EXPECTED RESULTS
When no changes are applied, the status should ben "Ok" and the
.id
should not change.ACTUAL RESULTS
See summary