Open toydarian opened 1 day ago
i concur w/ the proposed removal of the option. i'm not sure we need to support adding 'out-of-line' comments. seems like if the user wants that, they could use the template
module to build the file. my $0.02
I introduced the keep_comments_at_rules
and comment
in #135. comment
was only intended to be used together with keep_comments_at_rules: true
.
I'm using the feature to write justifications behind each rules and preserve those comments. I want to preserve this feature.
Using a comment
with keep_comments_at_rules: false
is indeed not idempotent. I see multiple ways to handle this:
keep_comments_at_rules
and always run with keep_comments_at_rules: true
behavior (avoiding this change was the reason for keep_comments_at_rules
)Supporting management of comments which don't belong to a specific rule (for example gathered at the top of the pg_hba.conf) would be nice, but I think that's a new feature and therefore low priority.
@hunleyd The postgresql_pg_hba
module offers advanced features which a template
doesn't have. Using postgresql_pg_hba
for the rules, together with a lineinfile
for standalone comments is probably a better solution. Although this may break if there are multi-line rules in the file...
SUMMARY
if
keep_comments_at_rules
isfalse
(which is the default) this breaks idempotencyISSUE TYPE
COMPONENT NAME
postgresql_pg_hba
ANSIBLE VERSION
COLLECTION VERSION
All versions of the collections since
1.5.0
STEPS TO REPRODUCE
Run this playbook twice:
EXPECTED RESULTS
As shown above the same comments are added and moved over and over again
ACTUAL RESULTS
The comments don't get added several times
SUGGESTED FIX
Completely remove the
keep_comments_at_rules
option and add a way to add a comment to the top of the file.