From 0220b67a856bcb04ee3e4a3d5fc39cd66c5ce47b Mon Sep 17 00:00:00 2001 From: Jon Nelson Date: Fri, 8 Jul 2016 15:34:45 -0500 Subject: [PATCH 1/7] - re-arrange cluster initialization to a set of variables in a dictionary which control three things: 1. should we initialize? 2. if so, how? 3. what environment variables and user to use The approach taken is very similar to what the Apache formula uses, namely: a default dictionary which is over-ridden by: os-specific defaults, then os codename defaults, then os finger defaults, and finally user-specified pillar values - this also adds support for grains['osfinger'] --- pillar.example | 20 +++++++++++--------- postgres/codenamemap.yaml | 8 ++++++-- postgres/defaults.yaml | 19 ++++++++++++------- postgres/init.sls | 24 +++++++++++------------- postgres/map.jinja | 34 +++++++++++++++++----------------- postgres/osfingermap.yaml | 1 + postgres/osmap.yaml | 32 ++++++++++++++++++++------------ 7 files changed, 78 insertions(+), 60 deletions(-) create mode 100644 postgres/osfingermap.yaml diff --git a/pillar.example b/pillar.example index 2b64166..fa459b7 100644 --- a/pillar.example +++ b/pillar.example @@ -1,17 +1,19 @@ postgres: pg_hba.conf: salt://postgres/pg_hba.conf - commands: - initdb: service postgresql initdb + prepare_cluster: + user: root + command: service postgresql initdb + test: test -f /path/to/some/file + env: + LC_ALL: C.UTF-8 use_upstream_repo: False - lookup: - pkg: 'postgresql-9.3' - pkg_client: 'postgresql-client-9.3' - pkgs_extra: - - postgresql-contrib - - postgresql-plpython - pg_hba: '/etc/postgresql/9.3/main/pg_hba.conf' + pkg: 'postgresql-9.3' + pkg_client: 'postgresql-client-9.3' + pkgs_extra: + - postgresql-contrib + - postgresql-plpython users: localUser: diff --git a/postgres/codenamemap.yaml b/postgres/codenamemap.yaml index 10052ba..9fa89be 100644 --- a/postgres/codenamemap.yaml +++ b/postgres/codenamemap.yaml @@ -1,9 +1,13 @@ {%- macro ubuntu_block(name, version) %} {{ name }}: - version: {{ version }} pkg_repo: deb http://apt.postgresql.org/pub/repos/apt/ {{ name }}-pgdg main conf_dir: /etc/postgresql/{{ version }}/main - data_dir: /var/lib/postgresql/{{ version }}/main + prepare_cluster: + command: pg_createcluster {{ version }} main + test: test -f /var/lib/postgresql/{{ version }}/main/PG_VERSION && test -f /etc/postgresql/{{ version }}/main/postgresql.conf + user: root + env: + LC_ALL: C.UTF-8 {%- endmacro %} {{ ubuntu_block('wheezy', 9.1) }} diff --git a/postgres/defaults.yaml b/postgres/defaults.yaml index 7dd6013..9c85efa 100644 --- a/postgres/defaults.yaml +++ b/postgres/defaults.yaml @@ -7,8 +7,6 @@ postgres: python: python-psycopg2 service: postgresql conf_dir: /var/lib/pgsql/data - data_dir: /var/lib/pgsql/data - version: 9.1 use_upstream_repo: False users: {} acls: [] @@ -17,10 +15,17 @@ postgres: postgresconf_backup: True postgresconf: "" pg_hba.conf: salt://postgres/pg_hba.conf - initdb: True - initdb_user: root - initdb_args: --data-checksum - commands: - initdb: service postgresql initdb user: postgres group: postgres + # if prepare_cluster is over-ridden in any of: + # - osmap.yaml + # - oscodenamemap.yaml + # - osfingermap.yaml + # you will have to specify a complete dictionary. + prepare_cluster: + user: root + command: service postgresql initdb + test: test -f /var/lib/pgsql/data/PG_VERSION + env: + LC_ALL: C.UTF-8 + diff --git a/postgres/init.sls b/postgres/init.sls index e6f8de5..4f97783 100644 --- a/postgres/init.sls +++ b/postgres/init.sls @@ -16,9 +16,7 @@ postgresql-config-dir: - makedirs: True - require: - pkg: postgresql-installed -{% if postgres.conf_dir == postgres.data_dir %} - cmd: postgresql-cluster-prepared -{% endif %} postgresql-installed: pkg.installed: @@ -28,20 +26,17 @@ postgresql-installed: # make sure the data directory and contents have been initialized postgresql-cluster-prepared: cmd.run: - {% if postgres.initdb %} - - name: {{ postgres.commands.initdb }} {{ postgres.initdb_args }} -D {{ postgres.data_dir }} - {% elif grains.os_family == 'Debian' %} - - name: pg_createcluster {{ postgres.version }} main - {# else: TODO #} - {% endif %} - cwd: / - - user: {{ postgres.initdb_user }} + - name: {{ postgres.prepare_cluster.command }} + - user: {{ postgres.prepare_cluster.user }} - unless: - - test -f {{ postgres.data_dir }}/PG_VERSION + - {{ postgres.prepare_cluster.test }} - require: - pkg: postgresql-installed - env: - LC_ALL: C.UTF-8 +{% for name, value in postgres.prepare_cluster.env.items() %} + {{ name }}: {{ value }} +{% endfor %} postgresql-running: service.running: @@ -154,8 +149,11 @@ postgresql-db-{{ name }}: - user: {{ db.get('runas', postgres.user) }} - require: - service: postgresql-running - {% if db.get('user') %} - - postgres_user: postgresql-user-{{ db.get('user') }} + {% if db.get('tablespace') %} + - postgres_tablespace: postgresql-tablespace-{{ name }} + {% endif %} + {% if db.get('owner') %} + - postgres_user: postgresql-user-{{ db.get('owner') }} {% endif %} {% if db.schemas is defined %} diff --git a/postgres/map.jinja b/postgres/map.jinja index c6032f0..c2889f4 100644 --- a/postgres/map.jinja +++ b/postgres/map.jinja @@ -1,22 +1,22 @@ {% import_yaml "postgres/defaults.yaml" as defaults %} {% import_yaml "postgres/osmap.yaml" as osmap %} -{% import_yaml "postgres/codenamemap.yaml" as codemap %} +{% import_yaml "postgres/codenamemap.yaml" as oscodenamemap %} +{% import_yaml "postgres/osfingermap.yaml" as osfingermap %} -{# get the settings for the os_family grain #} -{% set osfam = salt['grains.filter_by'](osmap, grain='os_family') or {} %} -{# get the settings for the oscodename grain, os_family data will override - oscodename data #} -{% set oscode = salt['grains.filter_by'](codemap, - grain='oscodename', - merge=osfam) or {} %} +{% set _postgres = salt['grains.filter_by']( + osmap, + grain='os_family', + merge=salt['grains.filter_by']( + oscodenamemap, + grain='oscodename', + merge=salt['grains.filter_by']( + osfingermap, + grain='osfinger', + merge=salt['pillar.get']('postgres', {}) + ) + ) +) %} -{# merge the os family/codename specific data over the defaults #} -{% do defaults.postgres.update(oscode) %} +{% do defaults.postgres.update(_postgres) %} -{# merge the pillar:lookup dict into the defaults/os specific dict #} -{% set lookup = salt['pillar.get']('postgres:lookup', - default=defaults.postgres, - merge=True) %} - -{# merge the actual postgres pillar into the above combined dict #} -{% set postgres = salt['pillar.get']('postgres', default=lookup, merge=True) %} +{% set postgres = defaults.postgres %} diff --git a/postgres/osfingermap.yaml b/postgres/osfingermap.yaml new file mode 100644 index 0000000..0967ef4 --- /dev/null +++ b/postgres/osfingermap.yaml @@ -0,0 +1 @@ +{} diff --git a/postgres/osmap.yaml b/postgres/osmap.yaml index 72d4981..f5325c7 100644 --- a/postgres/osmap.yaml +++ b/postgres/osmap.yaml @@ -1,29 +1,37 @@ RedHat: - initdb_user: postgres - commands: - initdb: initdb pkg: postgresql-server pkg_client: postgresql pkg_repo: pgdg94 repo_baseurl: http://yum.postgresql.org/9.4/redhat/rhel-$releasever-$basearch + prepare_cluster: + test: test -f /var/lib/pgsql/data/PG_VERSION + env: + LC_ALL: C.UTF-8 +{% if grains['os_family'] == 'RedHat' %} +{% if grains['osmajorrelease'] >= 7 %} + PGSETUP_INITDB_OPTIONS: + user: root + command: postgresql-setup initdb +{% else %} + user: postgres + command: initdb -D /var/lib/pgsql/data +{% endif %} +{% endif %} Arch: conf_dir: /var/lib/postgres/data - data_dir: /var/lib/postgres/data - initdb_user: postgres - initdb_args: --locale en_US.UTF8 -E UTF8 - commands: - initdb: initdb + prepare_cluster: + user: postgres + command: initdb -D /var/lib/postgresql/data + test: test -f /var/lib/postgres/data/PG_VERSION + env: + LC_ALL: C.UTF-8 pkg_client: postgresql pkg_dev: postgresql Debian: pkg_repo_file: /etc/apt/sources.list.d/pgdg.list pkg_dev: postgresql-server-dev-all pkg_libpq_dev: libpq-dev - initdb: False Suse: - initdb_user: postgres - commands: - initdb: initdb pkg: postgresql-server pkg_client: postgresql FreeBSD: From 9b5526a6805c054f99ff4ed0e91e1619f963351a Mon Sep 17 00:00:00 2001 From: Jon Nelson Date: Mon, 11 Jul 2016 13:18:17 -0500 Subject: [PATCH 2/7] - add 'runas', 'user', and 'owner' to all database object creation (where appropriate) - add missing 'requires' on database objects (schemas require databases, databases require users, etc....) - alter structure of schema and extension configuration: now schema and extension configuration follows the other items in that they are expected to be *dictionaries* where the key is the name of the object and the value is another subdictionary of configuration. --- postgres/init.sls | 131 ++++++++++++++++++++++++++++++++++------------ 1 file changed, 97 insertions(+), 34 deletions(-) diff --git a/postgres/init.sls b/postgres/init.sls index 4f97783..11ae33e 100644 --- a/postgres/init.sls +++ b/postgres/init.sls @@ -91,6 +91,9 @@ postgresql-user-{{ name }}: postgres_user.absent: - name: {{ name }} - user: {{ user.get('runas', postgres.user) }} +{% if user.get('user') %} + - db_user: {{ user.user }} +{% endif %} {% else %} postgres_user.present: - name: {{ name }} @@ -99,20 +102,26 @@ postgresql-user-{{ name }}: - createuser: {{ user.get('createuser', False) }} - inherit: {{ user.get('inherit', True) }} - replication: {{ user.get('replication', False) }} - - password: {{ user.get('password', 'changethis') }} - - user: {{ user.get('runas', postgres.user) }} + - password: {{ user.password }} - superuser: {{ user.get('superuser', False) }} + - user: {{ user.get('runas', postgres.user) }} +{% if user.get('user') %} + - db_user: {{ user.get('runas', postgres.user) }} +{% endif %} {% endif %} - require: - service: postgresql-running +{% if user.get('user') %} + - postgres_user: postgresql-user-{{ user.user }} +{% endif %} {% endfor %} -{% for name, directory in postgres.tablespaces.items() %} -postgresql-tablespace-dir-perms-{{ directory}}: +{% for name, tblspace in postgres.tablespaces.items() %} +postgresql-tablespace-dir-perms-{{ tblspace.directory}}: file.directory: - - name: {{ directory }} - - user: postgres - - group: postgres + - name: {{ tblspace.directory }} + - user: {{ postgres.user }} + - group: {{ postgres.group }} - makedirs: True - recurse: - user @@ -121,11 +130,17 @@ postgresql-tablespace-dir-perms-{{ directory}}: postgresql-tablespace-{{ name }}: postgres_tablespace.present: - name: {{ name }} - - directory: {{ directory }} - - user: postgres + - directory: {{ tblspace.directory }} + - user: {{ tblspace.get('runas', postgres.user) }} +{% if tblspace.get('user') %} + - db_user: {{ tblspace.user }} +{% endif %} +{% if tblspace.get('owner') %} + - owner: {{ tblspace.owner }} +{% endif %} - require: - service: postgresql-running - - file: postgresql-tablespace-dir-perms-{{ directory}} + - file: postgresql-tablespace-dir-perms-{{ tblspace.directory}} {% endfor %} {% for name, db in postgres.databases.items() %} @@ -133,6 +148,10 @@ postgresql-db-{{ name }}: {% if db.get('ensure', 'present') == 'absent' %} postgres_database.absent: - name: {{ name }} + - user: {{ db.get('runas', postgres.user) }} +{% if db.get('user') %} + - db_user: {{ db.user }} +{% endif %} - require: - service: postgresql-running {% else %} @@ -144,50 +163,94 @@ postgresql-db-{{ name }}: - template: {{ db.get('template', 'template0') }} - tablespace: {{ db.get('tablespace', 'pg_default') }} {% if db.get('owner') %} - - owner: {{ db.get('owner') }} + - owner: {{ db.owner }} {% endif %} - user: {{ db.get('runas', postgres.user) }} + {% if db.get('user') %} + - db_user: {{ db.user }} + {% endif %} - require: - service: postgresql-running + {% if db.get('user') %} + - postgres_user: postgresql-user-{{ db.user }} + {% endif %} + {% if db.get('owner') %} + - postgres_user: postgresql-user-{{ db.owner }} + {% endif %} {% if db.get('tablespace') %} - postgres_tablespace: postgresql-tablespace-{{ name }} {% endif %} - {% if db.get('owner') %} - - postgres_user: postgresql-user-{{ db.get('owner') }} + +{# NOTE: postgres_schema doesn't have a 'runas' equiv. at all #} +{% for schema_name, schema in db.get('schemas', dict()).items() %} +postgresql-schema-{{ schema_name }}-for-db-{{ name }}: +{% if schema.get('ensure', 'present') == 'absent' %} + postgres_schema.absent: + - name: {{ schema_name }} + {% if schema.get('user') %} + - db_user: {{ schema.user }} {% endif %} - -{% if db.schemas is defined %} -{% for schema, schema_args in db.schemas.items() %} -postgresql-schema-{{ schema }}-for-db-{{ name }}: + - require: + - service: postgresql-running +{% else %} postgres_schema.present: - - name: {{ schema }} + - name: {{ schema_name }} - dbname: {{ name }} -{% if schema_args is not none %} -{% for arg, value in schema_args.items() %} - - {{ arg }}: {{ value }} -{% endfor %} + {% if schema.get('user') %} + - db_user: {{ schema.user }} + {% endif %} +{% if schema.get('owner') %} + - owner: {{ schema.owner }} +{% endif %} - require: - service: postgresql-running + - postgres_database: postgresql-db-{{ name }} + {% if schema.get('user') %} + - postgres_user: postgresql-user-{{ schema.user }} + {% endif %} + {% if schema.get('owner') %} + - postgres_user: postgresql-user-{{ schema.owner }} + {% endif %} {% endif %} {% endfor %} -{% endif %} -{% if db.extensions is defined %} -{% for ext, ext_args in db.extensions.items() %} -postgresql-ext-{{ ext }}-for-db-{{ name }}: +{% for ext_name, ext in db.get('extensions', dict()).items() %} +postgresql-ext-{{ ext_name }}-for-db-{{ name }}: + {% if ext.get('ensure', 'present') == 'absent' %} + postgres_extension.absent: + - name: {{ ext_name }} + - user: {{ ext.get('runas', postgres.user) }} + {% if ext.get('user') %} + - db_user: {{ ext.user }} + {% endif %} + - require: + - service: postgresql-running + {% else %} postgres_extension.present: - - name: {{ ext }} - - user: {{ db.get('runas', postgres.user) }} + - name: {{ ext_name }} + - user: {{ ext.get('runas', postgres.user) }} + {% if ext.get('user') %} + - db_user: {{ ext.user }} + {% endif %} + {% if ext.get('version') %} + - ext_version: {{ ext.version }} + {% endif %} + {% if ext.get('schema') %} + - schema: {{ ext.schema }} + {% endif %} - maintenance_db: {{ name }} -{% if ext_args is not none %} -{% for arg, value in ext_args.items() %} - - {{ arg }}: {{ value }} -{% endfor %} - require: - service: postgresql-running -{% endif %} + - postgres_database: postgresql-db-{{ name }} + {% if ext.get('user') %} + - postgres_user: postgresql-user-{{ ext.user }} + {% endif %} + {% if ext.get('schema') %} + - postgres_schema: postgresql-schema-{{ ext.schema }} + {% endif %} + {% endif %} {% endfor %} -{% endif %} + {% endif %} {% endfor %} From 278c2e4ce83801d927a744eddef72c516dd5fefe Mon Sep 17 00:00:00 2001 From: Jon Nelson Date: Mon, 11 Jul 2016 19:13:48 -0500 Subject: [PATCH 3/7] support 'owner' argument to tablespace_create --- _modules/postgres_ext.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/_modules/postgres_ext.py b/_modules/postgres_ext.py index 6dfaba8..54b338e 100644 --- a/_modules/postgres_ext.py +++ b/_modules/postgres_ext.py @@ -174,7 +174,7 @@ def tablespace_exists(name, user=None, host=None, port=None, maintenance_db=None return name in tablespaces -def tablespace_create(name, location, user=None, host=None, port=None, +def tablespace_create(name, location, owner=None, user=None, host=None, port=None, maintenance_db=None, password=None, runas=None): ''' Adds a tablespace to the Postgres server. @@ -186,6 +186,8 @@ def tablespace_create(name, location, user=None, host=None, port=None, salt '*' postgres_ext.tablespace_create tablespacename '/path/datadir' ''' query = 'CREATE TABLESPACE {0} LOCATION \'{1}\''.format(name, location) + if owner is not None: + query += ' OWNER \'{1}\''.format(owner) # Execute the command ret = _psql_prepare_and_run(['-c', query], @@ -252,3 +254,4 @@ def tablespace_remove(name, user=None, host=None, port=None, maintenance_db=maintenance_db, password=password) return ret['retcode'] == 0 + From 45887735c6d9cbf403d87622a5afcdefa9d33139 Mon Sep 17 00:00:00 2001 From: Jon Nelson Date: Tue, 12 Jul 2016 09:48:21 -0500 Subject: [PATCH 4/7] properly quote identifiers with double quotes. This is rarely necessary. --- _modules/postgres_ext.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/_modules/postgres_ext.py b/_modules/postgres_ext.py index 54b338e..8712028 100644 --- a/_modules/postgres_ext.py +++ b/_modules/postgres_ext.py @@ -185,9 +185,9 @@ def tablespace_create(name, location, owner=None, user=None, host=None, port=Non salt '*' postgres_ext.tablespace_create tablespacename '/path/datadir' ''' - query = 'CREATE TABLESPACE {0} LOCATION \'{1}\''.format(name, location) + query = 'CREATE TABLESPACE "{0}" LOCATION \'{1}\''.format(name, location) if owner is not None: - query += ' OWNER \'{1}\''.format(owner) + query += ' OWNER "{1}"'.format(owner) # Execute the command ret = _psql_prepare_and_run(['-c', query], @@ -214,16 +214,16 @@ def tablespace_alter(name, user=None, host=None, port=None, maintenance_db=None, queries = [] if new_name: - queries.append('ALTER TABLESPACE {} RENAME TO {}'.format( + queries.append('ALTER TABLESPACE "{}" RENAME TO "{}"'.format( name, new_name)) if new_owner: - queries.append('ALTER TABLESPACE {} OWNER TO {}'.format( + queries.append('ALTER TABLESPACE "{}" OWNER TO "{}"'.format( name, new_owner)) if set_option: - queries.append('ALTER TABLESPACE {} SET ({} = {})'.format( + queries.append('ALTER TABLESPACE "{}" SET ({} = {})'.format( name, set_option[0], set_option[1])) if reset_option: - queries.append('ALTER TABLESPACE {} RESET ({})'.format( + queries.append('ALTER TABLESPACE "{}" RESET ({})'.format( name, reset_option)) for query in queries: @@ -245,7 +245,7 @@ def tablespace_remove(name, user=None, host=None, port=None, .. code-block:: bash salt '*' postgres_ext.tablespace_remove tsname ''' - query = 'DROP TABLESPACE {}'.format(name) + query = 'DROP TABLESPACE "{}"'.format(name) ret = _psql_prepare_and_run(['-c', query], user=user, host=host, From 7a7396fcb2f7899fbe79ddc5126c8d802360fc7f Mon Sep 17 00:00:00 2001 From: Jon Nelson Date: Tue, 19 Jul 2016 10:09:39 -0500 Subject: [PATCH 5/7] remove explicit LC_ALL environment variable setting that only works on some distros --- postgres/codenamemap.yaml | 3 +-- postgres/defaults.yaml | 3 +-- postgres/osmap.yaml | 7 ++----- 3 files changed, 4 insertions(+), 9 deletions(-) diff --git a/postgres/codenamemap.yaml b/postgres/codenamemap.yaml index 9fa89be..88f0b8a 100644 --- a/postgres/codenamemap.yaml +++ b/postgres/codenamemap.yaml @@ -6,8 +6,7 @@ command: pg_createcluster {{ version }} main test: test -f /var/lib/postgresql/{{ version }}/main/PG_VERSION && test -f /etc/postgresql/{{ version }}/main/postgresql.conf user: root - env: - LC_ALL: C.UTF-8 + env: {} {%- endmacro %} {{ ubuntu_block('wheezy', 9.1) }} diff --git a/postgres/defaults.yaml b/postgres/defaults.yaml index 9c85efa..d35e17b 100644 --- a/postgres/defaults.yaml +++ b/postgres/defaults.yaml @@ -26,6 +26,5 @@ postgres: user: root command: service postgresql initdb test: test -f /var/lib/pgsql/data/PG_VERSION - env: - LC_ALL: C.UTF-8 + env: {} diff --git a/postgres/osmap.yaml b/postgres/osmap.yaml index f5325c7..19fb77c 100644 --- a/postgres/osmap.yaml +++ b/postgres/osmap.yaml @@ -5,11 +5,9 @@ RedHat: repo_baseurl: http://yum.postgresql.org/9.4/redhat/rhel-$releasever-$basearch prepare_cluster: test: test -f /var/lib/pgsql/data/PG_VERSION - env: - LC_ALL: C.UTF-8 + env: {} {% if grains['os_family'] == 'RedHat' %} {% if grains['osmajorrelease'] >= 7 %} - PGSETUP_INITDB_OPTIONS: user: root command: postgresql-setup initdb {% else %} @@ -23,8 +21,7 @@ Arch: user: postgres command: initdb -D /var/lib/postgresql/data test: test -f /var/lib/postgres/data/PG_VERSION - env: - LC_ALL: C.UTF-8 + env: {} pkg_client: postgresql pkg_dev: postgresql Debian: From 1c72c7c3a149af6c184f98e6c7eed77867fdc6d3 Mon Sep 17 00:00:00 2001 From: Jon Nelson Date: Tue, 19 Jul 2016 10:10:07 -0500 Subject: [PATCH 6/7] - for encoding, lc_type, and lc_collate, only set them on the database if they are explicitly supplied. Otherwise use the postgres database defaults. --- postgres/init.sls | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/postgres/init.sls b/postgres/init.sls index 11ae33e..25efb2c 100644 --- a/postgres/init.sls +++ b/postgres/init.sls @@ -157,9 +157,15 @@ postgresql-db-{{ name }}: {% else %} postgres_database.present: - name: {{ name }} - - encoding: {{ db.get('encoding', 'UTF8') }} - - lc_ctype: {{ db.get('lc_ctype', 'en_US.UTF8') }} - - lc_collate: {{ db.get('lc_collate', 'en_US.UTF8') }} + {% if 'encoding' in db %} + - encoding: {{ db.encoding }} + {% endif %} + {% if 'lc_ctype' in db %} + - lc_ctype: {{ db.lc_type }} + {% endif %} + {% if 'lc_collate' in db %} + - lc_collate: {{ db.lc_collate }} + {% endif %} - template: {{ db.get('template', 'template0') }} - tablespace: {{ db.get('tablespace', 'pg_default') }} {% if db.get('owner') %} From 90cfea1e15006c9781a3c4d2984a0f852b62324c Mon Sep 17 00:00:00 2001 From: Jon Nelson Date: Tue, 19 Jul 2016 10:10:56 -0500 Subject: [PATCH 7/7] - change C.UTF-8 to en_us.UTF-8 in example pillar, as the former does not work on all distributions --- pillar.example | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pillar.example b/pillar.example index fa459b7..33435c7 100644 --- a/pillar.example +++ b/pillar.example @@ -5,7 +5,7 @@ postgres: command: service postgresql initdb test: test -f /path/to/some/file env: - LC_ALL: C.UTF-8 + LC_ALL: en_US.UTF-8 use_upstream_repo: False @@ -57,8 +57,8 @@ postgres: owner: 'localUser' user: 'localUser' template: 'template0' - lc_ctype: 'C.UTF-8' - lc_collate: 'C.UTF-8' + lc_ctype: 'en_US.UTF-8' + lc_collate: 'en_US.UTF-8' # optional schemas to enable on database schemas: uuid_ossp: @@ -71,8 +71,8 @@ postgres: owner: 'localUser' user: 'remoteUser' template: 'template0' - lc_ctype: 'C.UTF-8' - lc_collate: 'C.UTF-8' + lc_ctype: 'en_US.UTF-8' + lc_collate: 'en_US.UTF-8' tablespace: 'my_space' # optional extensions to enable on database # extensions: