Issue #2: Generate missing locales on Debian/Ubuntu.

This commit is contained in:
Jeff Geerling 2016-09-29 22:05:15 -05:00
parent 21ce5557ce
commit 6859807bb9
2 changed files with 15 additions and 0 deletions

View File

@ -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

View File

@ -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