We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fbb164e commit 4eaae0eCopy full SHA for 4eaae0e
tasks/main.yml
@@ -33,6 +33,10 @@
33
state=started
34
enabled=yes
35
36
+- name: Check if .my.cnf file already exists.
37
+ stat: "path={{ mysql_user_home }}/.my.cnf"
38
+ register: mycnf_file
39
+
40
# 'localhost' needs to be the last item for idempotency, see
41
# http://ansible.cc/docs/modules.html#mysql-user
42
- name: Update MySQL root password for all root accounts.
@@ -44,6 +48,7 @@
44
48
- 127.0.0.1
45
49
- ::1
46
50
- localhost
51
+ when: mycnf_file.stat.exists == false
47
52
53
# Has to be after the root password assignment, for idempotency.
54
- name: Copy .my.cnf file with root password credentials.
0 commit comments