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 df6b5dd6..e6b9700b 100644 --- a/Ansible/ansible_collections/jfrog/platform/roles/postgres/tasks/install.yml +++ b/Ansible/ansible_collections/jfrog/platform/roles/postgres/tasks/install.yml @@ -1,3 +1,13 @@ +- 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: Define OS-specific variables ansible.builtin.include_vars: "{{ ansible_os_family }}.yml" @@ -81,16 +91,6 @@ 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