模拟 "templates hierarchy" 的最佳方法是什么?

What would be the best approach to emulate "templates hierarchy"?

Ansible Tower 不提供模板和工作流的目录层次结构。
我们应该如何在扁平结构中管理他们不断增长的数量?

我知道我们可以使用标签,但它们的使用似乎有点乏味,并且假设用户已经知道他们要查找的模板的标签。 有什么我们可以遵循的最佳实践吗?

Ansible Tower does not offer directory hierarchy for templates and workflows.

是的,根据文档,Job Templates 视图只是一个列表。

This list is sorted alphabetically by name, but you can sort by other criteria, or search by various fields and attributes of a template.

如果使用 Labels

Labels can be used to group and filter job templates and completed jobs in the Tower display.

没有帮助

I know we could use labels, but their use seems a bit tedious and assume that users already knows label for template they look for.

可能会为模板/名称引入结构化命名约定。

由于作业模板通常用于自动化管理任务,例如推出、更新、重新启动等,因此您可以在那里使用 DEP_ROLENAME_TASKNAME 这样的结构。这对于模板描述也是可能的。通过 UI 查找它们比通过 REST API

更容易
curl --silent -u "${ACCOUNT}:${PASSWORD}" https://${TOWER_URL}/api/v2/job_templates/?search=DEP_ROLENAME_TASKNAME | jq .

更好的方法可能是引入 Teams

a subdivision of an organization with associated users, projects, credentials, and permissions. Teams provide a means to implement role-based access control schemes and delegate responsibilities across organizations.

Add Permission for certain Job Templates. A specific team or users can than only see Job Templates for tasks which they are supposed to do。不再需要查找、搜索和过滤。

进一步阅读

标签太基础了,无法模拟“模板层次结构”。假设您有模板页面,有些页面有标签“ad”和“set”,有些标签有“ad”和“get”。您可以搜索标签为“ad”、“get”或“set”的模板,但不能搜索标签为“ad”和“get”的模板。您唯一的选择是某种命名标准(可以包含“/”字符)作为伪层次结构。