# Impossible to use "with\_subelements"...

**URL:** <https://forum.ansible.com/t/impossible-to-use-with-subelements/21217>\
**Category:** Ansible Project\
**Created:** [April 20, 2016, 9:28am UTC](https://forum.ansible.com/t/impossible-to-use-with-subelements/21217 "2016-04-20T09:28:07Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Clement\_VALENTIN](https://avatars.discourse-cdn.com/v4/letter/c/839c29/32.png) [@Clement\_VALENTIN](https://forum.ansible.com/u/Clement_VALENTIN)\
**Post date:** [April 20, 2016, 9:28am UTC](https://forum.ansible.com/t/impossible-to-use-with-subelements/21217/1 "2016-04-20T09:28:07Z")

</div>

Hi,

I try to use function “with\_subelements” with module mysql\_user to create an user with multiple host with a dict.  
But i can’t do this ☹

roles/vars/main.yml :

> TEST:
> 
> - name: TEST300
> 
> app\_MySQLHost: “127.0.0.1”
> 
> app\_MySQLPort: “3306”
> 
> app\_MySQLAuth: “{{ mysql\_auth\_file }}”
> 
> app\_MySQLDatabase: “TEST”
> 
> app\_MySQLUser: “TEST”
> 
> app\_MySQLAuthorizeHostname:
> 
> - ‘127.0.0.1’
> 
> - ‘192.168.0.1’

roles/tasks/main.yml

> - name: “[MySQL] Check user”  
> mysql\_user:  
> name: “{{ item.0.app\_MySQLUser }}”  
> host: “{{ item.1 }}”  
> login\_host: “{{ item.0.app\_MySQLHost }}”  
> login\_port: “{{ item.0.app\_MySQLPort }}”  
> config\_file: “{{ item.0.app\_MySQLAuth }}”  
> password: “{{ lookup(‘password’, ‘roles/TEST/credentials/mysql.pass length=15 chars=ascii\_letters,digits’) }}”  
> update\_password: on\_create  
> priv: “{{ item.0.app\_MySQLUser }}.\*:ALL”  
> state: present  
> with\_subelements:
> - “{{ project }}”
> - app\_MySQLAuthorizeHostname

But ansible return :

[WARNING]: Failure when attempting to use callback plugin (\<ansible.plugins.callback.default.CallbackModule object at 0x1a42350\>): not all arguments converted during string formatting

Any idea ?

Thx

---

<div class="post-metadata">

**Author:** ![Clement\_VALENTIN](https://avatars.discourse-cdn.com/v4/letter/c/839c29/32.png) [@Clement\_VALENTIN](https://forum.ansible.com/u/Clement_VALENTIN)\
**Post date:** [April 20, 2016, 9:30am UTC](https://forum.ansible.com/t/impossible-to-use-with-subelements/21217/2 "2016-04-20T09:30:17Z")

</div>

My Ansible version =\> 2.1.0
