amazon.aws icon indicating copy to clipboard operation
amazon.aws copied to clipboard

Uniform the behaviour of purge_* parameters

Open alinabuzachis opened this issue 3 years ago • 2 comments

Summary

I have noticed that in some modules the purge_ * parameters default either to True or False. I think they should default to False instead. It would probably be best to have this consistent behavior across all modules. This would likely introduce some beraking changes.

Issue Type

Feature Idea

Component Name

several modules

Additional Information


Code of Conduct

  • [X] I agree to follow the Ansible Code of Conduct

alinabuzachis avatar Feb 11 '22 10:02 alinabuzachis

Files identified in the description: None

If these files are inaccurate, please update the component name section of the description or use the !component bot command.

click here for bot help

ansibullbot avatar Feb 11 '22 10:02 ansibullbot

+1 to consistent behaviour ( see also consistent module naming :) )

But there's two sides to the default behaviour coin:

As a 'user' I often want purge to default to False since it's destructive (and changing from purge: False to purge: True is less likely to cause widespread damage if people don't notice the deprecation warnings). Especially for things like Tagging, I often just want to add an extra Tag.

However, the downside of this is that it moves away from Ansible's general declarative nature: "This is the final state I want the resource to be in", which would have the default behaviour be purge set to True

tremble avatar Feb 11 '22 10:02 tremble

When we discussed this the consensus was that purge should default to True, but only take effect if the parameter to purge was explicitly passed as an empty list / dict.

eg: tags: {} or subnets: []

tremble avatar Feb 06 '23 08:02 tremble

Yes, we can close this one. Thank you @tremble

alinabuzachis avatar Feb 06 '23 08:02 alinabuzachis