List in File command ?

To use a list in the file command is not possible ?
I tried this:

  vars:
    user: root
    group: root
    basedir: /opt/basedir
    createdirectories: ["$basedir/test1","$basedir/test2"]

   #createdirectories: [{$basedir/test1}, {$basedir/test2}]
   #createdirectories: [ $basedir/test1, $basedir/test2 ]

  tasks:
     - action: file path=$item state=directory owner=$user group=
$group
       with_items:
        - $createdirectories

Expansion seams correct:
"createdirectories": ["$basedir/test1", "$basedir/test2"],

and got an error like this:

fatal: [10.101.1.102] => failed to parse: Traceback (most recent call
last):
line 138, in <module>
(k, v) = x.split("=")

Use with_items, http://ansible.github.com/playbooks2.html#loop-shorthand

Thank you, yes that works of course and that is how it is today.

But i would like to put all these into a variable which comes from an
external .yml-file.
This will make the playbook more generic and reusable when the
uncommon config is stored externally...

ansibleguest wrote:

Thank you, yes that works of course and that is how it is today.

But i would like to put all these into a variable which comes from an
external .yml-file.
This will make the playbook more generic and reusable when the
uncommon config is stored externally...

with_items and vars_files are not friends right now. It's something I've
been looking at fixing, but I don't think it'll make 0.5.

Yeah, it seems possible to evaluate vars_files earlier, for vars_files that do not contain host specific variables.

For vars_files that DO contain variables though, with_items can't be friends because task expansion has to happen
before variable expansion -- every host in a playbook gets the same number of tasks (which also keeps counts from
getting confusing)

It may be possible to move the looping over with_items to be an entirely runner thing, in which case that abstraction no
longer makes multiple tasks, but is ONE task, with an array of returns or something.