mysql_user doesen't translate variables

15 views
Skip to first unread message

Florian Lüttgens

unread,
Apr 28, 2016, 7:11:48 PM4/28/16
to Ansible Project
Hi,
im trying to add a mysql user, but it seems the mysql_user module does not translate the variables. It works on mysql_db tho.

Output:

<178.250.***.***> REMOTE_MODULE mysql_user name={{ item.value.projekt | lower }}_{{ item.key }}_{{ stage }} password=VALUE_HIDDEN item.value.password }} host=localhost login_host={{ ansible.fqdn }} priv=*.*:ALL state=present
[...]
msg: this module requires key=value arguments (['name={#', 'item.value.projekt', '|', 'lower', '#}_{#', 'item.key', '#}_{#', 'stage', '#}', 'password={#', 'item.value.password', '#}', 'host=localhost', 'login_host={#', 'ansible.fqdn', '#}', 'priv=*.*:ALL', 'state=present'])


Task:
    - name: Create MySQL Database User
      mysql_user
: name={{ item.value.projekt | lower }}_{{ item.key }}_{{ stage }} password={{ item.value.password }} host=localhost login_host={{ ansible.fqdn }} priv=*.*:ALL state=present
      with_dict
: "{{webpaket}}"


Any guess?

Regards
Florian Luettgens

Johannes Kastl

unread,
May 3, 2016, 3:21:24 AM5/3/16
to ansible...@googlegroups.com
On 28.04.16 10:15 Florian Lüttgens wrote:

> - name: Create MySQL Database User
> mysql_user: name={{ item.value.projekt | lower }}_{{ item.key }}_{{
> stage }} password={{ item.value.password }} host=localhost login_host={{
> ansible.fqdn }} priv=*.*:ALL state=present
> with_dict: "{{webpaket}}"

Don't you need to quote all the variables?

... name: "{{ item.value.projekt | lower }}_{{ item.key }}_{{
> stage }}" ...

Johannes

signature.asc
Reply all
Reply to author
Forward
0 new messages