summaryrefslogtreecommitdiff
path: root/roles/postgresql/main.yml
blob: 2ab2498cd90659c6fc94971dc817eb15cefaebca (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
---
# Target: alpine3.11
- name: Install PostgreSQL server
  hosts: postgresql
  vars:
    config_path: /etc/postgresql
  tasks:
  - name: Installing the application
    apk:
      state: present
      update_cache: yes
      name:
        - postgresql
  - name: Copying main configuration file
    copy:
      src: postgresql.conf
      owner: postgres
      group: postgres
      dest: "{{ config_path }}"
      mode: '0600'
  - name: Copying client authentication configuration file
    copy:
      src: pg_hba.conf
      owner: postgres
      group: postgres
      dest: "{{ config_path }}"
      mode: '0600'
  - name: Ensuring PostgreSQL has been enabled and started
    service:
      name: postgresql
      state: started
      enabled: yes