-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixed undefined var issues in the create.yml and delete.yml files of azure_manage_postgresql role #96
Fixed undefined var issues in the create.yml and delete.yml files of azure_manage_postgresql role #96
Conversation
@@ -64,7 +64,7 @@ | |||
value: "{{ item.value }}" | |||
with_items: "{{ azure_manage_postgresql_postgresql_settings }}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Won't we still have an error here if azure_manage_postgresql_postgresql_settings is not defined?
I think a better solution would be to set this in defaults/main.yml
azure_manage_postgresql_postgresql_settings: []
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think in case of undefined var it won't even come to this line, will fail on "when". But I'll set in defaults/main.yml , thanks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be able to remove the default() calls now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure, sorry. I thought I already pushed it, my fault..
77e929f
to
6b9b675
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
@@ -1,3 +1,4 @@ | |||
--- | |||
azure_manage_postgresql_operation: create | |||
azure_manage_postgresql_postgresql_version: "11" | |||
azure_manage_postgresql_postgresql_settings: [] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think instead of adding empty default we should handle the "not defined" case in the role itself.
It should be done by adding the following lines:
when:
- azure_manage_postgresql_postgresql_settings is defined
- azure_manage_postgresql_postgresql_settings | length > 0
What do you think @p3ck @prabinovRedhat ?
This is something we should change in multiple places, so I'm ok with fixing it here now or leaving it with the default solution and opening new task for this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can add it , I'll update the PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
f2b0d20
to
363b268
Compare
363b268
to
0cb192f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is look good
@p3ck can you please take a look again?
Fixed bugs:
Fixed undefined var issue in the create.yml file of azure_manage_postgresql role (https://issues.redhat.com/browse/ACA-1839)
Fixed undefined var issue in the delete.yml file of azure_manage_postgresql role (https://issues.redhat.com/browse/ACA-1838)