Skip to content
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

Use explicit credentials if password-less access is not possible #50

Merged
merged 1 commit into from
Mar 27, 2024
Merged
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
3 changes: 2 additions & 1 deletion defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
---
percona_server_version: 5.7

percona_server_root_username: root
percona_server_root_password: '+eswuw9uthUteFreyAqu'

percona_server_use_legacy_auth_method: false
Expand All @@ -15,7 +16,7 @@ percona_server_user_root_cnf_preset:
- name: host
value: localhost
- name: user
value: root
value: "{{ percona_server_root_username }}"
- name: password
value: "'{{ percona_server_root_password }}'"
percona_server_user_root_cnf: "{{ percona_server_user_root_cnf_preset }}"
Expand Down
6 changes: 6 additions & 0 deletions tasks/databases.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
collation: "{{ item.collation | default('utf8_general_ci') }}"
encoding: "{{ item.encoding | default('utf8') }}"
state: present
check_implicit_admin: true
login_user: "{{ percona_server_root_username }}"
login_password: "{{ percona_server_root_password }}"
with_items: "{{ percona_server_databases_present }}"
tags:
- percona-server-databases-create
Expand All @@ -14,6 +17,9 @@
community.mysql.mysql_db:
name: "{{ item.name }}"
state: absent
check_implicit_admin: true
login_user: "{{ percona_server_root_username }}"
login_password: "{{ percona_server_root_password }}"
with_items: "{{ percona_server_databases_absent }}"
tags:
- percona-server-databases-drop
4 changes: 4 additions & 0 deletions tasks/ib-logfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
- name: ib logfile | get datadir
community.mysql.mysql_variables:
variable: datadir
login_user: "{{ percona_server_root_username }}"
login_password: "{{ percona_server_root_password }}"
register: _datadir_value
tags:
- percona-server-store-datadir
Expand All @@ -23,6 +25,8 @@
community.mysql.mysql_variables:
variable: innodb_fast_shutdown
value: "1"
login_user: "{{ percona_server_root_username }}"
login_password: "{{ percona_server_root_password }}"
tags:
- percona-server-ib-logfile-innodb-fast-shutdown
- percona-server-ib-logfile-innodb-fast-shutdown-set
Expand Down
12 changes: 12 additions & 0 deletions tasks/users.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# tasks file
---
- name: users | create (default hosts)

Check failure on line 3 in tasks/users.yml

View workflow job for this annotation

GitHub Actions / Lint

args[module]

Unsupported parameters for (basic.py) module: no_log. Supported parameters include: append_privs, attributes, ca_cert, check_hostname, check_implicit_admin, client_cert, client_key, column_case_sensitive, config_file, connect_timeout, encrypted, force_context, host, host_all, login_host, login_password, login_port, login_unix_socket, login_user, password, password_expire, password_expire_interval, plugin, plugin_auth_string, plugin_hash_string, priv, resource_limits, session_vars, sql_log_bin, state, subtract_privs, tls_requires, update_password, user (name, ssl_ca, ssl_cert, ssl_key).
community.mysql.mysql_user:
name: "{{ item[0].name }}"
password: "{{ item[0].password }}"
Expand All @@ -8,6 +8,9 @@
host: "{{ item[1] }}"
state: present
no_log: true
check_implicit_admin: true
login_user: "{{ percona_server_root_username }}"
login_password: "{{ percona_server_root_password }}"
with_nested:
- "{{ percona_server_users_present | selectattr('hosts', 'undefined') | list }}"
- "{{ percona_server_users_present_hosts }}"
Expand All @@ -15,7 +18,7 @@
- percona-server-users-create
- percona-server-users-create-default-hosts

- name: users | create (custom hosts)

Check failure on line 21 in tasks/users.yml

View workflow job for this annotation

GitHub Actions / Lint

args[module]

Unsupported parameters for (basic.py) module: no_log. Supported parameters include: append_privs, attributes, ca_cert, check_hostname, check_implicit_admin, client_cert, client_key, column_case_sensitive, config_file, connect_timeout, encrypted, force_context, host, host_all, login_host, login_password, login_port, login_unix_socket, login_user, password, password_expire, password_expire_interval, plugin, plugin_auth_string, plugin_hash_string, priv, resource_limits, session_vars, sql_log_bin, state, subtract_privs, tls_requires, update_password, user (name, ssl_ca, ssl_cert, ssl_key).
community.mysql.mysql_user:
name: "{{ item[0].name }}"
password: "{{ item[0].password }}"
Expand All @@ -23,6 +26,9 @@
host: "{{ item[1] }}"
state: present
no_log: true
check_implicit_admin: true
login_user: "{{ percona_server_root_username }}"
login_password: "{{ percona_server_root_password }}"
with_subelements:
- "{{ percona_server_users_present | selectattr('hosts', 'defined') | list }}"
- hosts
Expand All @@ -35,6 +41,9 @@
name: "{{ item[0].name }}"
host: "{{ item[1] }}"
state: absent
check_implicit_admin: true
login_user: "{{ percona_server_root_username }}"
login_password: "{{ percona_server_root_password }}"
with_nested:
- "{{ percona_server_users_absent | selectattr('hosts', 'undefined') | list }}"
- "{{ percona_server_users_absent_hosts }}"
Expand All @@ -47,6 +56,9 @@
name: "{{ item[0].name }}"
host: "{{ item[1] }}"
state: absent
check_implicit_admin: true
login_user: "{{ percona_server_root_username }}"
login_password: "{{ percona_server_root_password }}"
with_subelements:
- "{{ percona_server_users_absent | selectattr('hosts', 'defined') | list }}"
- hosts
Expand Down
Loading