Hi:

I'd like to do a nested loop over a sequence and a file glob.  A simplified 
example of what I thought might work is:

- command: cp {{ item[1] }} {{ item[1] }}.{{ item[0] }}
  with_nested:
    - with_sequence: start=0 end=10
    - with_fileglob: 
      - /etc/*

However, this syntax doesn't work.  It reports:
failed: [...] => (item=['with_sequence', 'with_fileglob']) => {"changed": 
true, "cmd": ["cp", "with_fileglob", "/etc/"], "delta": "0:00:00.017533", 
"end": "2014-03-10 21:32:51.381160", "item": ["with_sequence", 
"with_fileglob"], "rc": 1, "start": "2014-03-10 21:32:51.363627"}
stderr: cp: cannot stat `with_fileglob': No such file or directory

Is there a way to achieve what I want?  I thought about replacing the 
with_fileglob with a register of "command: ls -1 /etc/*", and with_sequence 
replaced by a register of seq.  This seems hacky, though.

Thanks,

Rob


-- 
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 ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/55e7da16-182e-4fc4-8906-e5f4fb8cdf19%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to