Skip to content

Add conn_limit option to postgresql_user #243

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ postgresql_users:
login_unix_socket: # defaults to 1st of postgresql_unix_socket_directories
port: # defaults to not set
state: # defaults to 'present'
conn_limit: # defaults to not set
```

A list of users to ensure exist on the server. Only the `name` is required; all other properties are optional.
Expand Down
1 change: 1 addition & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,10 @@
# login_unix_socket: # defaults to 1st of postgresql_unix_socket_directories
# port: # defaults to not set
# state: # defaults to 'present'
# conn_limit: # defaults to not set

# Privileges to configure
# see https://docs.ansible.com/ansible/latest/collections/community/postgresql/postgresql_privs_module.html#ansible-collections-community-postgresql-postgresql-privs-module

Check warning on line 72 in defaults/main.yml

View workflow job for this annotation

GitHub Actions / Lint

72:121 [line-length] line too long (172 > 120 characters)
postgresql_privs: []
# - db: exampledb # database (required)
# roles: jdoe # role(s) the privs apply to (required)
Expand Down
1 change: 1 addition & 0 deletions tasks/users_props.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
login_unix_socket: "{{ item.login_unix_socket | default(postgresql_unix_socket_directories[0]) }}"
port: "{{ item.port | default(omit) }}"
state: "{{ item.state | default('present') }}"
conn_limit: "{{ item.conn_limit | default(omit) }}"
with_items: "{{ postgresql_users }}"
no_log: "{{ postgres_users_no_log }}"
become: true
Expand All @@ -24,7 +25,7 @@

- name: Ensure PostgreSQL users do not use deprecated privileges settings
debug:
msg "Postgresql user {{ item.name }} uses deprecated privileges settings. See https://github.com/geerlingguy/ansible-role-postgresql/issues/254"

Check warning on line 28 in tasks/users_props.yml

View workflow job for this annotation

GitHub Actions / Lint

28:121 [line-length] line too long (148 > 120 characters)
with_items: "{{ postgresql_users }}"
when: item.priv is defined

Expand Down
Loading