@ -44,26 +44,11 @@
ignore_errors : True
ignore_errors : True
when : ansible_os_family == "Debian"
when : ansible_os_family == "Debian"
- name : install rpm dependencies for postgresql test
- name : install dependencies for postgresql test
package : name={{ postgresql_package_item }} state= lates t
package : name={{ postgresql_package_item }} state= presen t
with_items : "{{ postgresql_packages}}"
with_items : "{{ postgresql_packages }}"
loop_control:
loop_control:
loop_var : postgresql_package_item
loop_var : postgresql_package_item
when : ansible_os_family == "RedHat" or ansible_os_family == "Suse"
- name : install dpkg dependencies for postgresql test
apt : name={{ postgresql_package_item }} state=latest
with_items : "{{postgresql_packages}}"
loop_control:
loop_var : postgresql_package_item
when : ansible_pkg_mgr == 'apt'
- name : install FreeBSD dependencies for postgresql test
pkgng : name={{ postgresql_package_item }} state=present
with_items : "{{postgresql_packages}}"
loop_control:
loop_var : postgresql_package_item
when : ansible_os_family == "FreeBSD"
- name : initialize postgres (FreeBSD)
- name : initialize postgres (FreeBSD)
command : /usr/local/etc/rc.d/postgresql oneinitdb
command : /usr/local/etc/rc.d/postgresql oneinitdb
@ -71,13 +56,13 @@
- name : Initialize postgres (RedHat systemd)
- name : Initialize postgres (RedHat systemd)
command : postgresql-setup initdb
command : postgresql-setup initdb
when : ansible_ distribution == "Fedora" or (ansible_os_family == "RedHat" and ansible_distribution_major_version|int >= 7)
when : ansible_ os_family == "RedHat" and ansible_service_mgr == "systemd"
- name : Initialize postgres (RedHat sysv)
- name : Initialize postgres (RedHat sysv)
command : /sbin/service postgresql initdb
command : /sbin/service postgresql initdb
when : ansible_os_family == "RedHat" and ansible_ distribution_major_version|int <= 6
when : ansible_os_family == "RedHat" and ansible_ service_mgr != "systemd"
- name : Ini i talize postgres (Debian)
- name : Ini ti alize postgres (Debian)
command : /usr/bin/pg_createcluster {{ pg_ver }} main
command : /usr/bin/pg_createcluster {{ pg_ver }} main
# Sometimes package install creates the db cluster, sometimes this step is needed
# Sometimes package install creates the db cluster, sometimes this step is needed
ignore_errors : True
ignore_errors : True
@ -103,17 +88,37 @@
command : locale-gen es_ES
command : locale-gen es_ES
when : ansible_os_family == 'Debian'
when : ansible_os_family == 'Debian'
- name : install i18ndata
# Suse: locales are installed by default (glibc-locale package).
zypper : name=glibc-i18ndata state=present
# Fedora 23: locales are installed by default (glibc-common package)
when : ansible_os_family == 'Suse'
# CentOS: all locales are installed by default (glibc-common package) but some
# RPM macros could prevent their installation (for example when using anaconda
- name : Generate pt_BR locale (Red Hat)
# instLangs parameter).
command : localedef -f ISO-8859-1 -i pt_BR pt_BR
when : ansible_os_family == "RedHat" or ansible_os_family == "Suse"
- block:
- name : Check if locales need to be generated (RedHat)
- name : Generate es_ES locale (Red Hat)
shell : "localedef --list-archive | grep -a -q '^{{ locale }}$'"
command : localedef -f ISO-8859-1 -i es_ES es_ES
register : locale_present
when : ansible_os_family == "RedHat" or ansible_os_family == "Suse"
ignore_errors : True
with_items:
- es_ES
- pt_BR
loop_control:
loop_var : locale
- name : Generate locale (RedHat)
command : 'localedef -f ISO-8859-1 -i {{ item.locale }} {{ item.locale }}'
when : item|failed
with_items : '{{ locale_present.results }}'
when : ansible_os_family == 'RedHat' and ansible_distribution != 'Fedora'
- name : Install glibc langpacks (Fedora >= 24)
package:
name : '{{ item }}'
state : 'latest'
with_items:
- glibc-langpack-es
- glibc-langpack-pt
when : ansible_distribution == 'Fedora' and ansible_distribution_major_version|int >= 24
- name : enable postgresql service (FreeBSD)
- name : enable postgresql service (FreeBSD)
lineinfile:
lineinfile: