aboutsummaryrefslogtreecommitdiffstats
path: root/roles/postgres/tasks/main.yml
diff options
context:
space:
mode:
Diffstat (limited to 'roles/postgres/tasks/main.yml')
-rw-r--r--roles/postgres/tasks/main.yml12
1 files changed, 6 insertions, 6 deletions
diff --git a/roles/postgres/tasks/main.yml b/roles/postgres/tasks/main.yml
index a203574..8046d40 100644
--- a/roles/postgres/tasks/main.yml
+++ b/roles/postgres/tasks/main.yml
@@ -1,12 +1,12 @@
- name: install postgres
- package:
+ ansible.builtin.package:
name:
- postgresql-server
- postgresql-contrib
state: present
- name: create postgres directories
- file:
+ ansible.builtin.file:
path: "{{ postgres_dir }}/{{ item }}"
owner: "{{ postgres_user }}"
group: "{{ postgres_group }}"
@@ -17,13 +17,13 @@
- "data"
- name: delete default data dir if exists
- file:
+ ansible.builtin.file:
path: "{{ postgres_default_dir }}"
state: absent
when: postgres_dir != "/var/postgresql"
- name: link postgres directory to default one
- file:
+ ansible.builtin.file:
src: "{{ postgres_dir }}"
dest: "{{ postgres_default_dir }}"
owner: "{{ postgres_user }}"
@@ -34,7 +34,7 @@
when: postgres_dir != "/var/postgresql"
- name: init postgres database # noqa: no-changed-when
- shell:
+ ansible.builtin.shell:
cmd: |
su "{{ postgres_user }}" \
-c 'initdb -D "{{ postgres_dir }}/data/" -U "{{ postgres_db_user }}" --encoding=UTF-8 --locale=en_US.UTF-8'
@@ -45,7 +45,7 @@
- "'exists but is not empty' not in result.stderr"
- name: enable and restart postgres service
- service:
+ ansible.builtin.service:
name: postgresql
state: restarted
enabled: true
remember that computers suck.