From e86b654deea2a5b66a388d3706aa720523d57e69 Mon Sep 17 00:00:00 2001 From: Ted Cook Date: Sun, 17 Mar 2024 19:02:58 -0600 Subject: [PATCH] Add database initialization toggle parameter --- defaults/main/params.yml | 1 + tasks/configure.yml | 1 + 2 files changed, 2 insertions(+) diff --git a/defaults/main/params.yml b/defaults/main/params.yml index f304ab2..b9a1431 100644 --- a/defaults/main/params.yml +++ b/defaults/main/params.yml @@ -8,6 +8,7 @@ postgresql_service_enabled: true postgresql_service_masked: false postgresql_user: postgres postgresql_group: postgres +postgresql_initdb: true postgresql_waldir: "/var/lib/postgresql/wal" postgresql_datadir: "/var/lib/postgresql/data" postgresql_roles: [] diff --git a/tasks/configure.yml b/tasks/configure.yml index 656dba5..0f63b7b 100644 --- a/tasks/configure.yml +++ b/tasks/configure.yml @@ -55,6 +55,7 @@ creates: "{{ _postgresql_datadir }}/PG_VERSION" become: true become_user: "{{ postgresql_user }}" + when: postgresql_initdb | bool - name: Create PostgreSQL include directory ansible.builtin.file: