From 479efa19547bf710e0113b08bc6165b66d1b7980 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Romain=20Gon=C3=A7alves?= Date: Tue, 13 Feb 2024 23:09:02 +0100 Subject: feat(roles/postgresql): simplify postgresql init --- roles/postgresql/tasks/create_db.yml | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 roles/postgresql/tasks/create_db.yml (limited to 'roles/postgresql/tasks/create_db.yml') diff --git a/roles/postgresql/tasks/create_db.yml b/roles/postgresql/tasks/create_db.yml new file mode 100644 index 0000000..d2f3676 --- /dev/null +++ b/roles/postgresql/tasks/create_db.yml @@ -0,0 +1,6 @@ +--- + +- name: create database # noqa: no-changed-when + ansible.builtin.command: createdb -U postgres -O "{{ postgres_db_user }}" "{{ postgres_db_name }}" + register: result + failed_when: result.rc != 0 and "already exists" not in result.stderr -- cgit v1.2.3