Complex args + with_items ansible 2.0

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

Hi Adham,

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

Regards,
Luca

Hey

That was fast

fixed it 8716bf8021800a18cb8d6cfea3f296ba4f834692 :slight_smile:

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.

`

`

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