From d510f8aee85c6119d833bc38a761af8b923e23e5 Mon Sep 17 00:00:00 2001 From: Jeremy Lecour Date: Mon, 17 Oct 2016 09:37:08 +0200 Subject: [PATCH] Mysql: all hosts must be removed manually Until Ansible 2.1 we have to loop over all hosts when deleting the root user --- mysql/tasks/users.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/mysql/tasks/users.yml b/mysql/tasks/users.yml index 366c9510..254b8b20 100644 --- a/mysql/tasks/users.yml +++ b/mysql/tasks/users.yml @@ -44,7 +44,13 @@ - name: remove root user mysql_user: name: root + host: "{{ item }}" config_file: /root/.my.cnf state: absent + with_items: + - "localhost" + - "127.0.0.1" + - "::1" + - "{{ ansible_hostname }}" tags: - mysql