geerlingguy / ansible-role-postgresql

Ansible Role - PostgreSQL
https://galaxy.ansible.com/geerlingguy/postgresql/
MIT License
572 stars 389 forks source link

Global Default Locale Configuration for PostgreSQL Databases #246

Closed oyale closed 6 months ago

oyale commented 1 year ago

Hello,

This Pull Request introduces a refinement to the Ensure PostgreSQL databases are present task, providing an option for setting a global default locale. While the existing role does permit locale modification at the individual database level, I observed that there are use cases where one might need to change the default locale across all databases without having to specify lc_collate and lc_ctype for each one. This led me to propose this enhancement.

The following lines in databases.yml have been updated to use the new postgresql_default_locale variable when individual lc_collate and lc_ctype values are not provided:

lc_collate: "{{ item.lc_collate | default(postgresql_default_locale) }}"
lc_ctype: "{{ item.lc_ctype | default(postgresql_default_locale) }}"

I have added the postgresql_default_locale variable to the defaults/main.yml file. This new variable allows users to define a global default locale:

postgresql_default_locale: 'en_US.UTF-8'

Additionally, I have updated the README to explain the purpose of this new variable and how to use it. The documentation clarifies that postgresql_default_locale is used to set default lc_collate and lc_ctype values for all databases, unless specifically overridden for a particular database.

This modification aims to increase the role's versatility and simplify PostgreSQL database configuration by offering a global default locale setting.

I look forward to hearing your thoughts on this proposed change.

Thank you.

oyale commented 1 year ago

Just pushed a new commit to fix the linter errors related to indentation in the tasks/variables.yml file.

github-actions[bot] commented 1 year ago

This pr has been marked 'stale' due to lack of recent activity. If there is no further activity, the issue will be closed in another 30 days. Thank you for your contribution!

Please read this blog post to see the reasons why I mark issues as stale.

oyale commented 1 year ago

Hey @geerlingguy!

Could you take some time to do a review of this PR?

Thanks! :smiley:

github-actions[bot] commented 8 months ago

This pr has been marked 'stale' due to lack of recent activity. If there is no further activity, the issue will be closed in another 30 days. Thank you for your contribution!

Please read this blog post to see the reasons why I mark issues as stale.

github-actions[bot] commented 6 months ago

This pr has been closed due to inactivity. If you feel this is in error, please reopen the issue or file a new issue with the relevant details.