- name: set locale.gen content
  file: dest=/etc/locale.gen content='fr_FR.UTF-8 UTF-8\n'

- name: reconfigure locales
  environment:
    DEBIAN_FRONTEND: noninteractive
  command: dpkg-reconfigure locales

- name: installing dependencies
  apt: pkg={{ item }} state=installed update_cache=yes
  with_items:
  - postgresql-9.4-postgis-2.1
  - postgresql-contrib-9.4 #for dblink extension
  - postgis

- name: install python-psycopg2 for ansible psql modules
  apt: name=python-psycopg2 state=installed

- name: create georchestra user
  sudo: yes
  sudo_user: postgres
  postgresql_user: name={{ georchestra.db.user }} password={{ georchestra.db.pass }}

- name: create georchestra main database
  sudo: yes
  sudo_user: postgres
  postgresql_db: name={{ georchestra.db.name }} owner={{ georchestra.db.user }} template=template0 encoding=UTF8

- include: geonetwork.yml tags=postgresql_geonetwork
- include: geofence.yml tags=postgresql_geofence
- include: other_schemas.yml tags=postgresql_other_schemas
- include: geofence_gsinstance.yml tags=postgresql_geofence_gsinstance
- include: cadastrapp.yml tags=postgresql_cadastrapp
  when: cadastrapp.enabled
- include: clean.yml
  tags: [cleanup, postgresql_cleanup]
  when: cleanup is defined

- name: installing dependencies
  apt: pkg={{ item }} state=installed update_cache=yes
  with_items:
  - postgresql-9.4-postgis-2.1
  - postgresql-contrib-9.4 #for dblink extension
  - postgis

- name: install python-psycopg2 for ansible psql modules
  apt: name=python-psycopg2 state=installed

- name: create georchestra user
  sudo: yes
  sudo_user: postgres
  postgresql_user: name={{ georchestra.db.user }} password={{ georchestra.db.pass }}

- name: create georchestra main database
  sudo: yes
  sudo_user: postgres
  postgresql_db: name={{ georchestra.db.name }} owner={{ georchestra.db.user }} template=template0 encoding=UTF8

- include: geonetwork.yml tags=postgresql_geonetwork
- include: geofence.yml tags=postgresql_geofence
- include: other_schemas.yml tags=postgresql_other_schemas
- include: geofence_gsinstance.yml tags=postgresql_geofence_gsinstance
- include: cadastrapp.yml tags=postgresql_cadastrapp
  when: cadastrapp.enabled
- include: clean.yml
  tags: [cleanup, postgresql_cleanup]
  when: cleanup is defined

Revert "ensure an UTF-8 locale is set before bootstrapping psql"
Revert "ensure an UTF-8 locale is set before bootstrapping psql"

This reverts commit 048a5bb24b9089c09b1dff1d261833a1f1d95d9f.
