-
-
Notifications
You must be signed in to change notification settings - Fork 415
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
pg_upgrade.yml: Add ‘string’ filter for postgresql version variables #777
pg_upgrade.yml: Add ‘string’ filter for postgresql version variables #777
Conversation
Thanks! @ruslanloman It is better to add a string filter to the appropriate parts of the code than to require users to specify the version as a string. This will be a more flexible and more reliable option. example {{ postgresql_data_dir | string | regex_replace('(/$)', '') | regex_replace(postgresql_version | string, pg_old_version | string) }} To avoid this error, we need to make sure that all arguments passed to |
@ruslanloman Are you planning a new PR or can I do it myself? |
Hi @vitabaks, Thank you for your comment. Yes, I'm preparing an update for PR. I agree about this part "require users to specify the version as a string". I found out that we can use jinja2 replace filter instead of ansible regex_replace filter. I've updated code, but checking that deployment and upgrade works as expected. |
e57d38c
to
d36599f
Compare
d36599f
to
526b935
Compare
@vitabaks Updated. My local deployment/upgrade test passed. |
recommended to use a string filter to avoid possible errors, example:
|
… int * regex_replace ansible filter expects a string or pattern otherwise it fails with the error. "first argument must be string or compiled pattern"
526b935
to
1e5e352
Compare
Updated. Thanks |
Description
Ansible pg_upgrade.yml pre_check is failed when postgresql_version is int, because
regex_replace ansible filter expects a string or pattern.
Initially postgresql_version was a string, but changed in this PR to int