From fb4c70827c8a01b2754f4e27532a6671b2e50ff1 Mon Sep 17 00:00:00 2001 From: Emilien Mantel Date: Fri, 25 Jan 2019 11:42:04 +0100 Subject: [PATCH] Manages "host_all" on users --- README.md | 10 +++++++--- tasks/main.yml | 3 ++- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 48cda28..6615b2e 100644 --- a/README.md +++ b/README.md @@ -47,10 +47,14 @@ Example: ``` mariadb_users: - - name: 'kiki' + - name: 'lorem' password: '123' - priv: hihi.*:ALL - host: '%' + priv: lorem.*:ALL + host: 'localhost' + - name: 'ipsum' + password: '465' + priv: ipsum.*:ALL + host_all: yes ``` Check "priv" syntax in [mysql\_user module documentation](http://docs.ansible.com/mysql_user_module.html) diff --git a/tasks/main.yml b/tasks/main.yml index a242e8f..4548699 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -68,7 +68,8 @@ name: "{{ item.name }}" password: "{{ item.password }}" priv: "{{ item.priv }}" - host: "{{ item.host | default('localhost') }}" + host: "{{ item.host | default(omit) }}" + host_all: "{{ item.host_all | default(omit) }}" state: present with_items: "{{ mariadb_users }}"