postgresql/tasks/main.yaml
author Luke Hoersten <luke@hoersten.org>
Wed, 19 Oct 2022 09:17:03 -0500
changeset 196 e07868e39791
parent 40 b42b417751e5
child 227 2e0366f2dcbe
permissions -rw-r--r--
Use apt package for homebridge.

---

- name: install postgresql
  become: yes
  apt: name="{{postgresql_apt_packages}}"

- name: configure postgresql data dir
  become: yes
  lineinfile:
    path: "{{postgresql_config_path}}"
    regexp: "^data_directory = "
    line: "data_directory = '{{postgresql_data_dir}}'"
  notify: restart postgres

- name: create postgresql data dir
  become: yes
  file:
    path: "{{postgresql_data_dir}}"
    state: "directory"
    mode: "0700"
    owner: "postgres"
    group: "postgres"
  notify: restart postgres

- name: ensure postgresql is started
  become: yes
  systemd: name="postgresql" enabled="yes" state="started"