Organize the template directory within the roles folder

42 views
Skip to first unread message

Ajay Divakaran

unread,
Oct 19, 2014, 7:02:12 AM10/19/14
to ansible...@googlegroups.com
Hi all,

According to the documentation the template files should sit in the top directory of the templates folder for a given role. Does Ansible recognize the template files if the template directory is organized into sub folders?

e.g

roles
  x
    templates
         folder1
              template1.j2
         folder2
              template2.js



usage of template module in task for role x

 template: src=/folder1/template1.js dest=/opt/foo

Michael Peters

unread,
Oct 22, 2014, 4:15:47 PM10/22/14
to ansible...@googlegroups.com
It does, but the path is relative, not absolute. Try (notice missing
"/" prefix on src):

template: src=folder1/template1.js dest=/opt/foo
> --
> 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-proje...@googlegroups.com.
> To post to this group, send email to ansible...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/46f29700-a5fb-440c-bf2e-d2a388830816%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages