Ansible:全局模板文件夹? [英] Ansible: Global template folder?

查看:130
本文介绍了Ansible:全局模板文件夹?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

找不到任何Google搜索内容。

变量有 group_vars / all / 。模板有类似的东西吗?我想在多个角色中使用一些模板。

There is group_vars/all/ for variables. Is there something similar for templates? I would like to use some templates across multiple roles.

推荐答案

您可以将全局模板放入模板中目录位于Ansible布局的顶层(与 group_vars 相同)。顺便说一句,全局文件也是如此。

You can put your global templates into templates directory at the top level of Ansible layout (same level as group_vars). BTW same goes for global files.

files/
group_vars/
roles/
site.yml
templates/

这篇关于Ansible:全局模板文件夹?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆