Skip to content

cp_mgmt_add_repository_package is not idempotent when package already exists in repository #202

Description

@kenancakir

Summary

The cp_mgmt_add_repository_package module does not behave idempotently when attempting to add a package that already exists in the local repository.
Instead of reporting that the desired state is already achieved (ok / changed=false), the module fails with an error returned by the Management API.

Environment

Ansible Collection: check_point.mgmt
Module: cp_mgmt_add_repository_package
Check Point Version: R82.10
Package: Blink_image_1.1_Check_Point_R82.10_T467_JHF_T24_SecurityGateway.tgz
ansible [core 2.21.1]

Steps to Reproduce

Add a package to the repository using cp_mgmt_add_repository_package.
Run the same playbook again with the identical package.
Observe the module result.

Expected Behavior

The module should detect that the package is already present in the repository and return:
changed: false

Actual Behavior

failed: [10.25.124.183] (item={
  'recommended': False,
  'package-id': 'Blink_image_1.1_Check_Point_R82.10_T467_JHF_T24_SecurityGateway.tgz',
  'category': 'major'
}) => {
  "changed": false,
  "msg": "Task Adding the following software package to the package repository: Blink_image_1.1_Check_Point_R82.10_T467_JHF_T24_SecurityGateway.tgz with task id 30fd9681-358f-4e30-b231-734c4d4c5936 failed. Message: Failed to download package Blink_image_1.1_Check_Point_R82.10_T467_JHF_T24_SecurityGateway.tgz. Reason: Download aborted; A package with the same name already exists in the local repository."
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    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