Skip to content

Conversation

Priyadharshini16092002
Copy link

@Priyadharshini16092002 Priyadharshini16092002 commented Sep 30, 2025

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update

Description

2 Bugs & 1 Enhancement feature done.

Bug Fix:
Following bugs fixed:

  1. Backup and Restore Module doesn't support "Delete All" operation.
  2. Backup Configuration fails without pre-existing NFS server Setup.

Root Cause (if applicable): NA

Fix Implemented:

  1. Added support for deleting all backups in a single operation.
  2. The module can now configure backup by automatically creating the NFS server configuration if it does not already exist.

Enhancement:

  1. Introduced a new parameter generate_new_backup.
  2. Introduced a new parameter deletion_timestamp.

Enhancement Description:
- When generate_new_backup set to true, the system always creates a new backup. The provided backup name is used as a prefix, and a timestamp suffix is automatically appended to ensure uniqueness.
- When generate_new_backup set to false (or left unspecified), the system uses the exact backup name as provided and enforces idempotent behaviour, avoiding duplicate backups with the same name.
- When deletion_timestamp is specified, deletes backups matching the given name prefix that were created before the provided timestamp.

Impact Area: NA

Testing Done:

  • Manual testing
  • Unit tests
  • Integration tests

Test cases covered: [Mention test case IDs or brief points]

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules
  • All the sanity checks have been completed and the sanity test cases have been executed

Ansible Best Practices

  • Tasks are idempotent (can be run multiple times without changing state)
  • Variables and secrets are handled securely (e.g., using ansible-vault or environment variables)
  • Playbooks are modular and reusable
  • Handlers are used for actions that need to run on change

Documentation

  • All options and parameters are documented clearly.
  • Examples are provided and tested.
  • Notes and limitations are clearly stated.

Screenshots (if applicable)

Notes to Reviewers

- Example deletion_timestamp="20241230_120000" with name="DAILY_BACKUP"
deletes backups starting with "DAILY_BACKUP" created before Dec 30, 2024 12:00:00.
- Ignored when delete_all_backup=true is specified.
type: str

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Timestamp is tricky and needs to be updated everytime. We discussed to have a duration fields where user can mention older_than : 1 day or 5days and all backup older then that times get deleted. We need that functionality. timestamp also you can keep but it is not addressing the requirement. backup_retention_days: If this is provided with delete, all backup which are created in this period will be retained and older backup will be deleted.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove timestamp also it, just backup_retention_days is good to handle all config as code mode.

dnac_task_poll_interval: 1
state: deleted
config:
- backup_job_creation:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

backup_job_creation, this parameter should be renamed. we don;t use module just to create the job, but full backup. So the name should be just backup.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants