diff options
author | Pierre-Louis Bonicoli <pierre-louis@libregerbil.fr> | 2017-05-07 16:22:43 +0200 |
---|---|---|
committer | Toshio Kuratomi <a.badger@gmail.com> | 2017-05-30 10:55:49 -0700 |
commit | fb1e7aaa81d926189f910cac5751fc623e37732c (patch) | |
tree | 75b8f3dd330138dba8ee95cda455f66929e2111b /test/integration/targets/setup_postgresql_db | |
parent | ce856c2123cb83a4e53f9905917965e65eb679a7 (diff) | |
download | ansible-fb1e7aaa81d926189f910cac5751fc623e37732c.tar.gz |
Creates cluster the same way Debian package does
This task is only executed when the playbook has already been executed
once, for example using 'ansible-test integration' with '--retry-error'
switch when the first run fails.
This modification allows to recreate default databases (postgres,
template0 and template1) using the same encoding that the one used by
the Debian package.
Default encoding is 'SQL_ASCII' when default locale is not set in
/etc/default/locale.
Diffstat (limited to 'test/integration/targets/setup_postgresql_db')
-rw-r--r-- | test/integration/targets/setup_postgresql_db/tasks/main.yml | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/test/integration/targets/setup_postgresql_db/tasks/main.yml b/test/integration/targets/setup_postgresql_db/tasks/main.yml index e87687cd2d..239aba6183 100644 --- a/test/integration/targets/setup_postgresql_db/tasks/main.yml +++ b/test/integration/targets/setup_postgresql_db/tasks/main.yml @@ -63,9 +63,9 @@ when: ansible_os_family == "RedHat" and ansible_service_mgr != "systemd" - name: Initialize postgres (Debian) - command: /usr/bin/pg_createcluster {{ pg_ver }} main - # Sometimes package install creates the db cluster, sometimes this step is needed - ignore_errors: True + shell: '. /usr/share/postgresql-common/maintscripts-functions && set_system_locale && /usr/bin/pg_createcluster -u postgres {{ pg_verĀ }} main' + args: + creates: "/etc/postgresql/{{ pg_ver }}/" when: ansible_os_family == 'Debian' - name: Initialize postgres (Suse) |