Skip to content

Commit 34e4eca

Browse files
committed
Fixes geerlingguy#175: Problems with Ansible 2.2.0.
1 parent 2c8c807 commit 34e4eca

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

tasks/main.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,11 @@
55
# Setup/install tasks.
66
- include: setup-RedHat.yml
77
when: ansible_os_family == 'RedHat'
8+
static: no
89

910
- include: setup-Debian.yml
1011
when: ansible_os_family == 'Debian'
12+
static: no
1113

1214
- name: Check if MySQL packages were installed.
1315
set_fact:

tasks/secure-installation.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,15 @@
2323
shell: >
2424
mysql -u root -NBe
2525
'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([]) }}"
2727
when: ((mysql_install_packages | bool) or mysql_root_password_update) and ('5.7.' in mysql_cli_version.stdout)
2828

2929
# Set root password for MySQL < 5.7.x.
3030
- name: Update MySQL root password for localhost root account (< 5.7.x).
3131
shell: >
3232
mysql -u root -NBe
3333
'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([]) }}"
3535
when: ((mysql_install_packages | bool) or mysql_root_password_update) and ('5.7.' not in mysql_cli_version.stdout)
3636

3737
# Has to be after the root password assignment, for idempotency.
@@ -54,7 +54,7 @@
5454
name: ""
5555
host: "{{ item }}"
5656
state: absent
57-
with_items: "{{ mysql_anonymous_hosts.stdout_lines }}"
57+
with_items: "{{ mysql_anonymous_hosts.stdout_lines|default([]) }}"
5858

5959
- name: Remove MySQL test database.
6060
mysql_db: "name='test' state=absent"

0 commit comments

Comments
 (0)