Skip to content

Commit

Permalink
Assertion at the start of the postgres role.
Browse files Browse the repository at this point in the history
  • Loading branch information
bbaassssiiee committed Oct 9, 2023
1 parent 43ab561 commit d6c17ad
Showing 1 changed file with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
@@ -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"

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit d6c17ad

Please sign in to comment.