Skip to content

Commit

Permalink
Add support for resource_limits when creating database users
Browse files Browse the repository at this point in the history
  • Loading branch information
Kalle Kiviaho committed Jan 10, 2025
1 parent 40f2b78 commit fc7808a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
2 changes: 2 additions & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@ mariadb_users: []
# host: 100.64.200.10
# password: password
# priv: "*.*:USAGE/db1.*:ALL"
# resource_limits:
# MAX_USER_CONNECTIONS: 20
# state: present|absent

# Replication
Expand Down
7 changes: 7 additions & 0 deletions molecule/default/vars/testvars.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,13 @@ mariadb_users:
password: user2passwd
priv: "db2.*:ALL"
state: present
- name: user3
host: "%"
password: user3passwd
priv: "db2.*:ALL"
resource_limits:
MAX_USER_CONNECTIONS: 20
state: present

mariadb_replication_user:
- name: ReplicationUser
Expand Down
1 change: 1 addition & 0 deletions tasks/users.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@
append_privs: "{{ item.append_privs | default('no') }}"
encrypted: "{{ item.encrypted | default('no') }}"
login_unix_socket: "{{ mariadb_unix_socket }}"
resource_limits: "{{ item.resource_limits | default({}) }}"
loop: "{{ mariadb_users }}"
no_log: true

0 comments on commit fc7808a

Please sign in to comment.