diff --git a/tasks/configure_root_access.yml b/tasks/configure_root_access.yml
index d48f2ca..9cfcf3d 100644
--- a/tasks/configure_root_access.yml
+++ b/tasks/configure_root_access.yml
@@ -7,11 +7,11 @@
     password: "{{ mysql_root_password }}"
     login_unix_socket: "{{ mysql_socket }}"
   when: mysql_root_password is defined
-  with_items:
-    - localhost
+  loop:
     - 127.0.0.1
     - ::1
     - '{{ ansible_hostname }}'
+    - localhost
   ignore_errors: true
   tags: ['mysql', 'mysql_root']
 
@@ -22,11 +22,11 @@
     password: ""
     login_unix_socket: "{{ mysql_socket }}"
   when: mysql_root_password is not defined
-  with_items:
-    - localhost
+  loop:
     - 127.0.0.1
     - ::1
     - '{{ ansible_hostname }}'
+    - localhost
   ignore_errors: true
   tags: ['mysql', 'mysql_root']