I have got the following playbooks where i am trying to copy directories and all its contents recursively which is present in project repo. For identifying the correct directory, i am using a variable which holds the pattern value. For some reason, the task is skipped and the full verbose too doesn’t give me enough information about where it is failing. Can someone please suggest.
I have got the following playbooks where i am trying to copy directories and all its contents recursively which is
present in project repo. For identifying the correct directory, i am using a variable which holds the pattern value. For
some reason, the task is skipped and the full verbose too doesn't give me enough information about where it is failing.
Can someone please suggest.
>
---
-hosts:all
gather_facts:no
become:yes
vars:
appid:'1554'
tasks:
-name:Copyeach file over that matches the given pattern
copy:
src:"{{ item }}"
dest:"/tmp"
with_fileglob:
-/home/DS/ram/playbooks/app_dir_{{appid }}*
I think you need to wrap the argument into double_quotes like that:
you are not passing a 'glob' to fileglob, in any case the problem is
that it is returning an empty list, examine it in a debug statement
until you get the output you expect.