cp_gaia_ntp defines the sub-key version under the servers module parameters.
Parameters with this name have special logic in module_utils/checkpoint.py.
Root cause
replace_chkp_params rewrites keys on outbound and inbound requests:
| Direction |
Transform |
| Outbound (params -> API) |
ver -> version, msg -> message |
| Inbound (API -> params) |
version -> ver, message -> msg |
For outbound requests, this is correct - the /show-ntp API response does include version per the API spec.
However, cp_gaia_ntp first sends a request to /show-ntp to get the current server information, then applies the inbound transform to the response (version -> ver), and finally compares the result against the module's defined parameters.
Because the module defines its server parameter as version directly, the comparison is between version (params) and ver (transformed response).
This comparison will always fail, causing the module to always attempt a /set-ntp operation and mark the task as changed.
Fix
Update the module's server sub-parameter from version to ver in both cp_gaia_ntp and cp_gaia_ntp_facts.
The replace_chkp_params transform then applies correctly in both directions and the idempotency check passes.
cp_gaia_ntpdefines the sub-keyversionunder the servers module parameters.Parameters with this name have special logic in
module_utils/checkpoint.py.Root cause
replace_chkp_paramsrewrites keys on outbound and inbound requests:ver->version,msg->messageversion->ver,message->msgFor outbound requests, this is correct - the
/show-ntpAPI response does includeversionper the API spec.However,
cp_gaia_ntpfirst sends a request to/show-ntpto get the current server information, then applies the inbound transform to the response (version->ver), and finally compares the result against the module's defined parameters.Because the module defines its server parameter as
versiondirectly, the comparison is betweenversion(params) andver(transformed response).This comparison will always fail, causing the module to always attempt a
/set-ntpoperation and mark the task as changed.Fix
Update the module's server sub-parameter from
versiontoverin bothcp_gaia_ntpandcp_gaia_ntp_facts.The
replace_chkp_paramstransform then applies correctly in both directions and the idempotency check passes.