diff --git a/tasks/configure_root_access.yml b/tasks/configure_root_access.yml index 740778b..d48f2ca 100644 --- a/tasks/configure_root_access.yml +++ b/tasks/configure_root_access.yml @@ -8,10 +8,10 @@ login_unix_socket: "{{ mysql_socket }}" when: mysql_root_password is defined with_items: - - '{{ ansible_hostname }}' + - localhost - 127.0.0.1 - ::1 - - localhost + - '{{ ansible_hostname }}' ignore_errors: true tags: ['mysql', 'mysql_root'] @@ -23,10 +23,10 @@ login_unix_socket: "{{ mysql_socket }}" when: mysql_root_password is not defined with_items: - - '{{ ansible_hostname }}' + - localhost - 127.0.0.1 - ::1 - - localhost + - '{{ ansible_hostname }}' ignore_errors: true tags: ['mysql', 'mysql_root'] @@ -49,9 +49,15 @@ tags: ['mysql', 'mysql_root'] - name: configure_root_access | Delete anonymous MySQL server user for localhost - community.mysql.mysql_user: user="" state="absent" login_unix_socket={{ mysql_socket }} + community.mysql.mysql_user: + user: "" + state: "absent" + login_unix_socket: "{{ mysql_socket }}" tags: mysql - name: configure_root_access | Remove the MySQL test database - community.mysql.mysql_db: db=test state=absent login_unix_socket={{ mysql_socket }} + community.mysql.mysql_db: + db: test + state: absent + login_unix_socket: "{{ mysql_socket }}" tags: mysql