File tree Expand file tree Collapse file tree 3 files changed +5
-5
lines changed Expand file tree Collapse file tree 3 files changed +5
-5
lines changed Original file line number Diff line number Diff line change 23
23
shell : >
24
24
mysql -u root -NBe
25
25
'ALTER USER "{{ mysql_root_username }}"@"{{ item }}" IDENTIFIED WITH mysql_native_password BY "{{ mysql_root_password }}";'
26
- with_items : " {{ mysql_root_hosts.stdout_lines }}"
26
+ with_items : " {{ mysql_root_hosts.stdout_lines | default([]) }}"
27
27
when : ((mysql_install_packages | bool) or mysql_root_password_update) and ('5.7.' in mysql_cli_version.stdout)
28
28
29
29
# Set root password for MySQL < 5.7.x.
30
30
- name : Update MySQL root password for localhost root account (< 5.7.x).
31
31
shell : >
32
32
mysql -u root -NBe
33
33
'SET PASSWORD FOR "{{ mysql_root_username }}"@"{{ item }}" = PASSWORD("{{ mysql_root_password }}");'
34
- with_items : " {{ mysql_root_hosts.stdout_lines }}"
34
+ with_items : " {{ mysql_root_hosts.stdout_lines | default([]) }}"
35
35
when : ((mysql_install_packages | bool) or mysql_root_password_update) and ('5.7.' not in mysql_cli_version.stdout)
36
36
37
37
# Has to be after the root password assignment, for idempotency.
54
54
name : " "
55
55
host : " {{ item }}"
56
56
state : absent
57
- with_items : " {{ mysql_anonymous_hosts.stdout_lines }}"
57
+ with_items : " {{ mysql_anonymous_hosts.stdout_lines | default([]) }}"
58
58
59
59
- name : Remove MySQL test database.
60
60
mysql_db : " name='test' state=absent"
Original file line number Diff line number Diff line change 12
12
13
13
- name : Ensure MySQL packages are installed.
14
14
apt : " name={{ item }} state=installed"
15
- with_items : " {{ mysql_packages }}"
15
+ with_items : " {{ mysql_packages | default([]) }}"
16
16
register : deb_mysql_install_packages
17
17
18
18
# Because Ubuntu starts MySQL as part of the install process, we need to stop
Original file line number Diff line number Diff line change 1
1
---
2
2
- name : Ensure MySQL packages are installed.
3
3
yum : " name={{ item }} state=installed enablerepo={{ mysql_enablerepo }}"
4
- with_items : " {{ mysql_packages }}"
4
+ with_items : " {{ mysql_packages | default([]) }}"
5
5
register : rh_mysql_install_packages
6
6
7
7
- name : Ensure MySQL Python libraries are installed.
You can’t perform that action at this time.
0 commit comments