Closed mandar242 closed 3 months ago
Hello @mandar242 , what leads you to believe that a string is being passed for backup_options? Could you kindly provide a reference? From my observations, everything appears to be functioning as intended. Here's the value of the create parameters passed to the create_backup_plan CLI.
{'BackupPlan': {'AdvancedBackupSettings': [{'BackupOptions': {'Windowsvss': 'enabled'}, 'ResourceType': 'EC2'}], 'BackupPlanName': 'elasticcopy', 'Rules': [{'CompletionWindowMinutes': 1440, 'EnableContinuousBackup': False, 'RuleName': 'daily', 'ScheduleExpression': 'cron(0 5 ? * * *)', 'StartWindowMinutes': 60, 'TargetBackupVaultName': 'vault1'}]}}
Hello @mandar242 , what leads you to believe that a string is being passed for backup_options? Could you kindly provide a reference? From my observations, everything appears to be functioning as intended. Here's the value of the create parameters passed to the create_backup_plan CLI.
{'BackupPlan': {'AdvancedBackupSettings': [{'BackupOptions': {'Windowsvss': 'enabled'}, 'ResourceType': 'EC2'}], 'BackupPlanName': 'elasticcopy', 'Rules': [{'CompletionWindowMinutes': 1440, 'EnableContinuousBackup': False, 'RuleName': 'daily', 'ScheduleExpression': 'cron(0 5 ? * * *)', 'StartWindowMinutes': 60, 'TargetBackupVaultName': 'vault1'}]}}
Hi @GomathiselviS , I could be missing something about the param backup_options
being passed as a string.
however there are a couple of things that could be improved.
backup_options
is defined in argspec, is the only module that defines it like choices=[{"WindowsVSS": "enabled"}, {"WindowsVSS": "disabled"}], whereas all other modules make use of suboptions. To ensure consistency, I feel we should modify the way it is written currently and changed to use suboptions instead.advanced_backup_settings
and advanced_backup_settings.backup_options
Hello @mandar242 , what leads you to believe that a string is being passed for backup_options? Could you kindly provide a reference? From my observations, everything appears to be functioning as intended. Here's the value of the create parameters passed to the create_backup_plan CLI.
{'BackupPlan': {'AdvancedBackupSettings': [{'BackupOptions': {'Windowsvss': 'enabled'}, 'ResourceType': 'EC2'}], 'BackupPlanName': 'elasticcopy', 'Rules': [{'CompletionWindowMinutes': 1440, 'EnableContinuousBackup': False, 'RuleName': 'daily', 'ScheduleExpression': 'cron(0 5 ? * * *)', 'StartWindowMinutes': 60, 'TargetBackupVaultName': 'vault1'}]}}
Hi @GomathiselviS , I could be missing something about the param
backup_options
being passed as a string. however there are a couple of things that could be improved.
- The way
backup_options
is defined in argspec, is the only module that defines it like choices=[{"WindowsVSS": "enabled"}, {"WindowsVSS": "disabled"}], whereas all other modules make use of suboptions. To ensure consistency, I feel we should modify the way it is written currently and changed to use suboptions instead.- The current definition is causing error with docs rendering Update return block of Backup modules #2106 (comment)
- There is no example that showcases usage of
advanced_backup_settings
andadvanced_backup_settings.backup_options
I will create a PR to update the examples and argspec.
Summary
The module
amazon.aws.backup_plan
does not provide example of usageadvanced_backup_settings
andadvanced_backup_settings.backup_options
param. Also looking at the argspec for the option, not sure if it will work as expected because it's expecting a dict but I what actually gets passed is a string.https://github.com/ansible-collections/amazon.aws/blob/main/plugins/modules/backup_plan.py#L151-L156 https://github.com/ansible-collections/amazon.aws/blob/main/plugins/modules/backup_plan.py#L383-L393
Issue Type
Bug Report
Component Name
backup_plan
Ansible Version
Collection Versions
AWS SDK versions
Configuration
OS / Environment
No response
Steps to Reproduce
Create a backup_plan using the option similar to above
Expected Results
The usage of param is advanced_backup_settings verified and fixed if required.
Actual Results
Code of Conduct