You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@trafficcontrol.apache.org by GitBox <gi...@apache.org> on 2021/01/11 22:45:52 UTC
[GitHub] [trafficcontrol] jhg03a commented on a change in pull request #5420: Postgres version agnostic
jhg03a commented on a change in pull request #5420:
URL: https://github.com/apache/trafficcontrol/pull/5420#discussion_r555387731
##########
File path: infrastructure/ansible/roles/traffic_ops/defaults/main.yml
##########
@@ -18,7 +18,7 @@ to_pkg_name: "{% if to_version is defined and to_version != omit %}{{ 'traffic_o
# Postgres Superuser account to use with TO database and user creation
postgresql_admin_user:
postgresql_admin_user_password:
-postgresql_client_pkg_name: "{% if postgresql_version is defined and postgresql_version != omit %}{{ 'postgresql96-'+postgresql_version }}{% else %}postgresql96{% endif %}"
+postgresql_client_pkg_name: "{% if pg_major_version | int < 10 %}postgresql{{pg_major_version}}{{pg_minor_version}}-{{postgresql_version}}{% else %}postgresql{{pg_major_version}}-{{postgresql_version}}{% endif %}"
Review comment:
If postgresql_version is undefined here, it will fail even though the major/minor are set by default. Notice in the original the hyphen and more specific version are missing including the build are missing entirely.
##########
File path: infrastructure/ansible/roles/traffic_opsdb/defaults/main.yml
##########
@@ -15,9 +15,9 @@
install_traffic_opsdb: false
initialize_traffic_opsdb: false
-postgresql_server_pkg_name: "{% if postgresql_version is defined and postgresql_version != omit %}{{ 'postgresql96-server-'+postgresql_version }}{% else %}postgresql96-server{% endif %}"
-postgresql_client_pkg_name: "{% if postgresql_version is defined and postgresql_version != omit %}{{ 'postgresql96-'+postgresql_version }}{% else %}postgresql96{% endif %}"
-postgresql_devel_pkg_name: "{% if postgresql_version is defined and postgresql_version != omit %}{{ 'postgresql96-devel-'+postgresql_version }}{% else %}postgresql96-devel{% endif %}"
+postgresql_server_pkg_name: "{% if pg_major_version | int < 10 %}postgresql{{pg_major_version}}{{pg_minor_version}}-server-{{postgresql_version}}{% else %}postgresql{{pg_major_version}}-server-{{postgresql_version}}{% endif %}"
+postgresql_client_pkg_name: "{% if pg_major_version | int < 10 %}postgresql{{pg_major_version}}{{pg_minor_version}}-{{postgresql_version}}{% else %}postgresql{{pg_major_version}}-{{postgresql_version}}{% endif %}"
+postgresql_devel_pkg_name: "{% if pg_major_version | int < 10 %}postgresql{{pg_major_version}}{{pg_minor_version}}-devel-{{postgresql_version}}{% else %}postgresql{{pg_major_version}}-devel-{{postgresql_version}}{% endif %}"
Review comment:
If postgresql_version is undefined here, it will fail even though the major/minor are set by default. Notice in the original the hyphen and more specific version are missing including the build are missing entirely.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org