2
0
mirror of https://dev.sum7.eu/sum7/ansible-role-postgresql synced 2025-04-05 02:09:06 +02:00
ansible-role-postgresql/tasks/main.yml
2020-11-13 21:23:39 +01:00

27 lines
528 B
YAML

- name: DB - Install PostgreSQL
package:
name:
- postgresql
- python-psycopg2
- postgresql-old-upgrade
- postgis
- name: DB - Ensure a locale exists
locale_gen:
name: en_US.UTF-8
state: present
- name: DB - Init
become: yes
become_user: postgres
become_method: su
command: initdb --locale=en_US.UTF-8 -E UTF8 -D /var/lib/postgres/data
args:
creates: /var/lib/postgres/data/postgresql.conf
- name: DB - starting
systemd:
name: postgresql
enabled: yes
state: started