Skip to content

cp_gaia_ntp module fails idempotency due to version property #79

@acbk2b

Description

@acbk2b

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions