src.nth.io/

summaryrefslogtreecommitdiff
path: root/postgresql/tasks
diff options
context:
space:
mode:
authorLuke Hoersten <[email protected]>2020-06-09 19:21:46 -0500
committerLuke Hoersten <[email protected]>2020-06-09 19:21:46 -0500
commitf7b6a96abb76655be80967c28b56b62ac9fc37d7 (patch)
tree8a489ddee78621a9b7bd2c9f4156623cd617da95 /postgresql/tasks
parent84bb36a6ba49c71f38178d2ddaeff7f94d2d6def (diff)
Moved over postgresql and nginx roles from pleroma roles.
Diffstat (limited to 'postgresql/tasks')
-rw-r--r--postgresql/tasks/main.yaml27
1 files changed, 27 insertions, 0 deletions
diff --git a/postgresql/tasks/main.yaml b/postgresql/tasks/main.yaml
new file mode 100644
index 0000000..6195840
--- /dev/null
+++ b/postgresql/tasks/main.yaml
@@ -0,0 +1,27 @@
+---
+
+- 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"