Skip to content
This repository has been archived by the owner on Nov 7, 2024. It is now read-only.

Commit

Permalink
Issue geerlingguy#223: Don't fetch user password from config when it'…
Browse files Browse the repository at this point in the history
…s not available/appropriate.
  • Loading branch information
Colan Schwartz committed Oct 9, 2021
1 parent cf4d144 commit b6a2c40
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tasks/secure-installation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,15 @@
slurp:
src: "{{ mysql_user_cnf_path }}"
register: mysql_user_cnf_file
when: mysql_user_name != mysql_root_username

# It would be cleaner to use the `ini` lookup plugin, but that only works
# locally so we'd have to copy the file first, which we'd rather not do because
# it contains secrets.
- name: Extract the user password from .my.cnf
set_fact:
mysql_user_password_written: "{{ mysql_user_cnf_file['content'] | b64decode | regex_findall('password=\"(.+)\"') | first }}"
when: mysql_user_name != mysql_root_username

- name: Ensure default user is present.
mysql_user:
Expand Down

0 comments on commit b6a2c40

Please sign in to comment.