-
-
Notifications
You must be signed in to change notification settings - Fork 875
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Extend users and database module with additional options
- Add additional config options, like - login_user - login_host - login_password - ca_certificate This also allows using this role for configuring users/databases for SaaS offerings, like Azure Database for MySQL. E.g. ```yaml - hosts: localhost vars: mysql_login_host: myazuredb.azure.net mysql_login_user: rootuser mysql_login_password: secret mysql_ca_cert: path/to/my/cert.pem tasks: - include_role: name: geerlingguy.mysql tasks_from: "{{ item }}" loop: - users - databases ```
- Loading branch information
Showing
9 changed files
with
39 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,13 @@ | ||
--- | ||
- name: Ensure MySQL databases are present. | ||
mysql_db: | ||
community.mysql.mysql_db: | ||
name: "{{ item.name }}" | ||
collation: "{{ item.collation | default('utf8_general_ci') }}" | ||
encoding: "{{ item.encoding | default('utf8') }}" | ||
state: "{{ item.state | default('present') }}" | ||
target: "{{ item.target | default(omit) }}" | ||
with_items: "{{ mysql_databases }}" | ||
login_user: "{{ mysql_login_user | default(omit) }}" | ||
login_password: "{{ mysql_login_password | default(omit) }}" | ||
login_host: "{{ mysql_login_host | default(omit) }}" | ||
ca_cert: "{{ mysql_ca_cert | default(omit) }}" | ||
with_items: "{{ mysql_databases }}" | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,16 @@ | ||
--- | ||
- name: Ensure MySQL users are present. | ||
mysql_user: | ||
community.mysql.mysql_user: | ||
name: "{{ item.name }}" | ||
host: "{{ item.host | default('localhost') }}" | ||
password: "{{ item.password }}" | ||
priv: "{{ item.priv | default('*.*:USAGE') }}" | ||
state: "{{ item.state | default('present') }}" | ||
append_privs: "{{ item.append_privs | default('no') }}" | ||
encrypted: "{{ item.encrypted | default('no') }}" | ||
login_user: "{{ mysql_login_user | default(omit) }}" | ||
login_password: "{{ mysql_login_password | default(omit) }}" | ||
login_host: "{{ mysql_login_host | default(omit) }}" | ||
ca_cert: "{{ mysql_ca_cert | default(omit) }}" | ||
with_items: "{{ mysql_users }}" | ||
no_log: "{{ mysql_hide_passwords }}" |