# Complex args + with\_items ansible 2.0

**URL:** <https://forum.ansible.com/t/complex-args-with-items-ansible-2-0/20032>\
**Category:** Ansible Project\
**Created:** [December 16, 2015, 2:59pm UTC](https://forum.ansible.com/t/complex-args-with-items-ansible-2-0/20032 "2015-12-16T14:59:58Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Adham\_H](https://avatars.discourse-cdn.com/v4/letter/a/b2d939/32.png) [@Adham\_H](https://forum.ansible.com/u/Adham_H)\
**Post date:** [December 16, 2015, 2:59pm UTC](https://forum.ansible.com/t/complex-args-with-items-ansible-2-0/20032/1 "2015-12-16T14:59:58Z")

</div>

Starting to test my roles with ansible 2.0 dev branch

Complex args breaks when using with\_ but works with 1.9.X

> - name : Loop  
> hosts : all  
> gather\_facts : yes  
> become : True  
> vars :  
> usermanage\_groupsdb :
> 
> - name : “group1”  
> state : “present”  
> gid : “5000”  
> system : “true”
> 
> - name : “group2”  
> state : “present”  
> gid : “5001”  
> system : “false”  
> tasks:
> 
> - debug: var=usermanage\_groupsdb
> 
> - name: groups | Create groups  
> group:  
> args: “{{ item }}”  
> with\_items: usermanage\_groupsdb

I am not sure if thats a bug or its by design. Since the complex args was not heavily documented.

So I dont want to report it on github unless it is

Regards  
Adham

---

<div class="post-metadata">

**Author:** ![Luca\_Berruti](https://avatars.discourse-cdn.com/v4/letter/l/258eb7/32.png) [@Luca\_Berruti](https://forum.ansible.com/u/Luca_Berruti)\
**Post date:** [December 16, 2015, 7:17pm UTC](https://forum.ansible.com/t/complex-args-with-items-ansible-2-0/20032/2 "2015-12-16T19:17:20Z")

</div>

Hi Adham,

see [https://github.com/ansible/ansible/issues/13518](https://github.com/ansible/ansible/issues/13518), the issue is tagged “v2 milestone”

Regards,  
Luca

---

<div class="post-metadata">

**Author:** ![Adham\_H](https://avatars.discourse-cdn.com/v4/letter/a/b2d939/32.png) [@Adham\_H](https://forum.ansible.com/u/Adham_H)\
**Post date:** [December 16, 2015, 10:38pm UTC](https://forum.ansible.com/t/complex-args-with-items-ansible-2-0/20032/3 "2015-12-16T22:38:16Z")

</div>

Hey

That was fast

fixed it 8716bf8021800a18cb8d6cfea3f296ba4f834692 🙂

---

<div class="post-metadata">

**Author:** ![Luca\_Berruti](https://avatars.discourse-cdn.com/v4/letter/l/258eb7/32.png) [@Luca\_Berruti](https://forum.ansible.com/u/Luca_Berruti)\
**Post date:** [December 17, 2015, 11:32am UTC](https://forum.ansible.com/t/complex-args-with-items-ansible-2-0/20032/4 "2015-12-17T11:32:42Z")

</div>

Now I get a “DEPRECATION WARNING”:

`  
[DEPRECATION WARNING]: Using variables for task params is unsafe, especially if the variables come from an external source like facts. This  
feature will be removed in a future release. Deprecation warnings can be disabled by setting deprecation\_warnings=False in ansible.cfg.

`

`

---

<div class="post-metadata">

**Author:** ![Adham\_H](https://avatars.discourse-cdn.com/v4/letter/a/b2d939/32.png) [@Adham\_H](https://forum.ansible.com/u/Adham_H)\
**Post date:** [December 19, 2015, 7:00pm UTC](https://forum.ansible.com/t/complex-args-with-items-ansible-2-0/20032/5 "2015-12-19T19:00:33Z")

</div>

But, whats the point of having complex args if its not going to be dynamic ?
