From 374f742f3369b35afd96af661f810e310ae81196 Mon Sep 17 00:00:00 2001 From: Bas Meijer Date: Mon, 2 Oct 2023 14:44:47 +0200 Subject: [PATCH] Assert that database username and password are defined. --- .../jfrog/platform/roles/postgres/tasks/install.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Ansible/ansible_collections/jfrog/platform/roles/postgres/tasks/install.yml b/Ansible/ansible_collections/jfrog/platform/roles/postgres/tasks/install.yml index d8b0c941..df6b5dd6 100644 --- a/Ansible/ansible_collections/jfrog/platform/roles/postgres/tasks/install.yml +++ b/Ansible/ansible_collections/jfrog/platform/roles/postgres/tasks/install.yml @@ -81,6 +81,16 @@ timeout: 120 sleep: 10 +- name: Assert database username and password are defined + ansible.builtin.assert: + that: + - curr_user.username is defined + - curr_user.password is defined + loop: "{{ database | dict2items | map(attribute='value') | list }}" + loop_control: + loop_var: curr_user + when: curr_user.enabled | bool + - name: Create user become: true become_user: postgres