mirror of
https://github.com/geerlingguy/ansible-role-postgresql.git
synced 2025-03-10 17:26:20 -04:00
Issue #2: Generate missing locales on Debian/Ubuntu.
This commit is contained in:
parent
21ce5557ce
commit
6859807bb9
2 changed files with 15 additions and 0 deletions
|
@ -7,6 +7,10 @@ postgresql_group: postgres
|
|||
|
||||
postgresql_unix_socket_dir: /var/run/postgresql
|
||||
|
||||
# Debian only. Used to generate the locales used by PostgreSQL databases.
|
||||
postgresql_locales:
|
||||
- 'en_US.UTF-8'
|
||||
|
||||
# Databases to ensure exist.
|
||||
postgresql_databases: []
|
||||
# - name: example
|
||||
|
|
|
@ -5,3 +5,14 @@
|
|||
- name: Ensure PostgreSQL packages are installed.
|
||||
apt: "name={{ item }} state=installed"
|
||||
with_items: "{{ postgresql_packages }}"
|
||||
|
||||
- name: Ensure all configured locales are present.
|
||||
locale_gen: "name={{ item }} state=present"
|
||||
with_items: "{{ postgresql_locales }}"
|
||||
register: locale_gen_result
|
||||
|
||||
- name: Force-restart PostgreSQL after new locales are generated.
|
||||
service:
|
||||
name: "{{ postgresql_daemon }}"
|
||||
state: restarted
|
||||
when: locale_gen_result.changed
|
||||
|
|
Loading…
Add table
Reference in a new issue