Hi,

I'm trying to push the limits of "subelements" but I can't figure out how..
Part of my task/main.yml
- name: Prepare for Shinken|user
  user: name={{ item.0.name }}
        comment={{ item.0.comment }}
        group={{ item.0.group }}
        shell={{ item.0.shell }}
        password={{ item.0.password }}
        state=present
        update_password=on_create
  with_subelements:
   - users
   - group
my var/main.yml
---
users:
  - name: shinken
    comment:
     - "Shinken.user"
    group:
     - "shinken"
    shell:
     - "/bin/bash"
    password:
     - 
"$6$cGTFMo0u$DPyI81Yn/9lFbAVMtTRy0vSXfn00ZaeBPg754BzDx7Aj6B6WZGicfjOjkeY9upT8HPvKV2voQ1SNuWIF2hfEi/"

This is what I get:
< TASK: shinken | Prepare for Shinken|user >
 ------------------------------------------
        \   ^__^
         \  (oo)\_______
            (__)\       )\/\
                ||----w |
                ||     ||


failed: [192.168.7.200] => (item=({'comment': ['Shinken.user'], 'password': 
['$6$cGTFMo0u$DPyI81Yn/9lFbAVMtTRy0vSXfn00ZaeBPg754BzDx7Aj6B6WZGicfjOjkeY9upT8HPvKV2voQ1SNuWIF2hfEi/'],
 
'shell': ['/bin/bash'], 'name': 'shinken'}, 'shinken')) => {"failed": true, 
"item": [{"comment": ["Shinken.user"], "name": "shinken", "password": 
["$6$cGTFMo0u$DPyI81Yn/9lFbAVMtTRy0vSXfn00ZaeBPg754BzDx7Aj6B6WZGicfjOjkeY9upT8HPvKV2voQ1SNuWIF2hfEi/"],
 
"shell": ["/bin/bash"]}, "shinken"], "name": "shinken", "rc": 3}
msg: useradd: invalid shell '[/bin/bash]'


FATAL: all hosts have already failed -- aborting


It looks like Ansible is not removing the "[]" from the list of elemets.
How would you do? Is it possible to do as I'm trying?

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/f811da11-3cc5-4670-ad5f-05ae0cab9ad5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to