diff --git a/README.md b/README.md index 051c3f2..0872d0f 100644 --- a/README.md +++ b/README.md @@ -129,22 +129,21 @@ Example: ### postgresql_role_memberships -| Name | Type | Required | Default | Comment | -|-----------|-------|----------|---------|-----------------------------------------| -| key | str | yes | | the group role name | -| roles | array | yes | | the roles name to add in the role group | -| state | str | no | present | if absent the memberships are deleted | +| Name | Type | Required | Default | Comment | +|-----------|-------|----------|---------|------------------------------------------| +| key | str | yes | | the role name | +| groups | array | yes | | the groups (roles) where to add the role | +| state | str | no | present | if absent the memberships are deleted | Example: ``` postgres: - roles: + groups: - myuser state: present ``` - ## How to use ``` diff --git a/tasks/main.yml b/tasks/main.yml index bb53be6..1064072 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -87,8 +87,8 @@ - name: manage role membership community.postgresql.postgresql_membership: - groups: '{{ item.key }}' - target_roles: '{{ item.value.roles }}' + groups: '{{ item.value.groups }}' + target_roles: '{{ item.key }}' state: '{{ item.value.state | default("present") }}' loop: '{{ postgresql_role_memberships | dict2items }}' loop_control: