Skip to content

Commit e6969ef

Browse files
committed
Issue geerlingguy#60: 'Get list of hosts for the root user' fails to run.
1 parent 7f8cd51 commit e6969ef

File tree

3 files changed

+5
-1
lines changed

3 files changed

+5
-1
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,10 @@ None.
1212

1313
Available variables are listed below, along with default values (see `vars/main.yml`):
1414

15+
mysql_user_provisioning: root
1516
mysql_user_home: /root
1617

17-
The home directory inside which Python MySQL settings will be stored, which Ansible will use when connecting to MySQL. This should be the home directory of the user which runs this Ansible role.
18+
The user this role will use, along with the home directory inside which Python MySQL settings will be stored, when Ansible connects to MySQL for administrative purposes.
1819

1920
mysql_root_password: root
2021

defaults/main.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
---
2+
mysql_user_provisioning: root
23
mysql_user_home: /root
34
mysql_root_username: root
45
mysql_root_password: root

tasks/secure-installation.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
command: mysql -NBe 'SELECT Host FROM mysql.user WHERE User = "root" ORDER BY (Host="localhost") ASC'
44
register: mysql_root_hosts
55
changed_when: false
6+
sudo: yes
7+
sudo_user: "{{ mysql_user_provisioning }}"
68

79
# 'localhost' needs to be last for idempotency.
810
- name: Update MySQL root password for localhost root account.

0 commit comments

Comments
 (0)