From faa63a96d4416bc193ce01ca72231809c018f02c Mon Sep 17 00:00:00 2001 From: Emilien Mantel Date: Sat, 8 Aug 2015 13:02:59 +0200 Subject: [PATCH] mysql users with host management --- README.md | 1 + tasks/main.yml | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 7ca88ef..1cf3ce1 100644 --- a/README.md +++ b/README.md @@ -35,6 +35,7 @@ mysql_users: - name: 'kiki' password: '123' priv: hihi.*:ALL + host: '%' ``` Check "priv" syntax in [http://docs.ansible.com/mysql_user_module.html](mysql_user module documentation) diff --git a/tasks/main.yml b/tasks/main.yml index 5365df0..20c16b0 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -29,6 +29,11 @@ with_items: mysql_databases - name: MYSQL_USER | Manages users... - mysql_user: name={{ item.name }} password={{ item.password }} priv={{ item.priv }} state=present + mysql_user: > + name={{ item.name }} + password={{ item.password }} + priv={{ item.priv }} + host={{ item.host | default('localhost') }} + state=present with_items: mysql_users