diff --git a/tasks/users.yml b/tasks/users.yml index 3138fd4d..07a321e1 100644 --- a/tasks/users.yml +++ b/tasks/users.yml @@ -16,18 +16,3 @@ sudo_user: "{{postgresql_admin_user}}" with_items: postgresql_users when: postgresql_users|length > 0 - -- name: PostgreSQL | Update the user privileges - postgresql_user: - name: "{{item.name}}" - db: "{{item.db}}" - port: "{{postgresql_port}}" - priv: "{{item.priv | default('ALL')}}" - state: present - login_user: "{{postgresql_admin_user}}" - role_attr_flags: "{{item.role_attr_flags | default('')}}" - sudo: yes - sudo_user: "{{postgresql_admin_user}}" - with_items: postgresql_user_privileges - when: postgresql_users|length > 0 - diff --git a/tasks/users_privileges.yml b/tasks/users_privileges.yml index 56b377c3..5b7ea492 100644 --- a/tasks/users_privileges.yml +++ b/tasks/users_privileges.yml @@ -4,8 +4,13 @@ postgresql_user: name: "{{item.name}}" db: "{{item.db}}" + port: "{{postgresql_port}}" priv: "{{item.priv | default('ALL')}}" state: present login_host: "{{item.host | default('localhost')}}" + login_user: "{{postgresql_admin_user}}" + role_attr_flags: "{{item.role_attr_flags | default('')}}" + sudo: yes + sudo_user: "{{postgresql_admin_user}}" with_items: postgresql_user_privileges when: postgresql_users|length > 0