Got it. thank you so much!

在 2016年10月2日星期日 UTC+8下午3:12:51,Kai Stian Olstad写道:
>
> On 01. okt. 2016 05:49, 郭大瞎 wrote: 
> > I need to copy files from managed node to control machines. 
> > A machine's tomcat path : /usr/local/tomcat-aux 
> > B machine's tomcat path : /usr/local/tomcat-hk 
> > actually there is not only these two instance. 
> > so I've tried below methods, but failed. 
> > 
> >  name: copy file to tomcat path 
> >  copy: src=/deploy/a.conf  dest=/usr/local/tomcat*/ 
>
> copy module doesn't support regexp, only a handful modules do, and if 
> they do it's documented in the individual module documentation. 
>
> You example you can written like this: 
>
> - name: Find tomcat directories 
>    find: 
>      paths=/usr/local 
>      patterns=tomcat* 
>      file_type=directory 
>    register: result 
>
> - name: copy file to tomcat path 
>    copy: 
>      src=/deploy/a.conf 
>      dest={{ item.path }} 
>    with_items: result.files 
>
> -- 
> Kai Stian Olstad 
>

-- 
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/16f7786f-0171-4a7e-aaad-97bfd6d27d4b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to