From 294128fa2b7b1c8009b8a3a0ddba219a9d5eb403 Mon Sep 17 00:00:00 2001 From: vincent Date: Sat, 4 Nov 2023 17:34:26 +0100 Subject: [PATCH] fix: not create user and dataase when not active database --- defaults/main.yml | 2 +- tasks/databases.yml | 1 + tasks/users.yml | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/defaults/main.yml b/defaults/main.yml index 0b7e928..b1ff787 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -71,4 +71,4 @@ postgresql_users: postgres_users_no_log: true postgres_consul_service: false postgres_consul_service_name: postgress -postgres_consul_tag: "active" +postgres_consul_tag: diff --git a/tasks/databases.yml b/tasks/databases.yml index e01d804..0ac87ca 100644 --- a/tasks/databases.yml +++ b/tasks/databases.yml @@ -17,5 +17,6 @@ become: true become_user: "{{ postgresql_user }}" # See: https://github.com/ansible/ansible/issues/16048#issuecomment-229012509 + when: postgres_consul_tag is not defined or postgres_consul_tag == "active" vars: ansible_ssh_pipelining: true diff --git a/tasks/users.yml b/tasks/users.yml index a1ae894..4129d92 100644 --- a/tasks/users.yml +++ b/tasks/users.yml @@ -17,6 +17,7 @@ no_log: "{{ postgres_users_no_log }}" become: true become_user: "{{ postgresql_user }}" + when: postgres_consul_tag is not defined or postgres_consul_tag == "active" # See: https://github.com/ansible/ansible/issues/16048#issuecomment-229012509 vars: ansible_ssh_pipelining: true