I want to run a playbook to create an individual folder for users in
different groups
and I already create a teams.yml file like below
> {
>
> "chinese_name": "\u8ca1\u52d9\u6703\u8a08\u8655",
>
> "description": "\u8ca1\u52d9\u6703\u8a08\u8655",
>
> "gid": 10126,
>
> "location": [
>
> "hq"
>
> ],
>
> "name": "ac",
>
> "users": [
>
> "tsengyi",
>
> "chenp",
>
> "lich",
>
> "hsiaoch",
>
> "wangr",
>
> "dengm",
>
> ""guot".
>
> ]
>
>
>
then I wrote a task
> ### load yaml file first
- name: load teams.yml
>
>
tags:
- env
include_vars:
file: files/konwen/teams.yml
- name: create folders
file:
path: "/home/{{item.user}}/D"
state: present
when: item.name == 'ac'
with_items: "{{ teams}}"
but the result
>
> tsengyi
>
> '[u'\''tsengyi'\'', u'\''chenp'\'', u'\''lich'\'', u'\''hsiaoch'\'',
>> u'\''wangr'\'', u'\''dengm'\'', u'\''guot'\'', u'\''hsul'\'',
>> u'\''linm'\'']'
>
> wangc
>
>
> looks like ansible take whole list into a single value
I expect to create /home/tsengyi/D , /home/chenp/D .....and so on
How can I separate the list into piece to do what I need ??
--
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/4e7e34a9-48b8-4d6a-bd82-d04361dfeaca%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.