ansible - 如何从文件中为 Ansible Tower 作业模板设置额外的变量?
问题描述
我正在寻找从文件加载额外变量的 Ansible Tower 等效方法。就像从带有 ...--extra-vars "@somefile.yml" 参数的 cli 中一样。这可以在 Ansible Tower 中完成吗?
解决方案
From the Tower you have several options:
- Under Job Templates use the Extra Variables option. This is the
--extra-vars
equivalent to the cli (Take into account that Tower is not cli and you cannot pass a file but you can copy/paste your file there) - Use Surveys
- Load the Var file from your playbook directly and make it "flexible" with a variable to be sent from a Survey like:
- name: Load a variable file based on Survey, or a default if not found.
include_vars: "{{ item }}"
with_first_found:
- "{{ firts_option }}.yaml"
- "{{ second_option }}.yaml"
- default.yaml
推荐阅读
- typo3 - 如何在控制器中使用图像编辑器裁剪图像?TYPO3
- asp.net-core - 在布局中用@section 包围@RenderSection 的目的是什么?
- python - 神经网络的输入形状
- vim - Vim 在启动时会回显很多变量
- pandas - 根据两个条件加入或合并或重塑数据框
- java - 在 foreach 循环中的代码完成后关闭 Webdriver?
- mysql - MYSQL 5.7 表 3 字段 DATETIME '0000-00-00 00:00:00' 如何将新结构更改为 DEFAULT NULL
- node.js - 如何使用 socket.io 和 node 构建私人聊天信使
- python - 我们如何在一个 x 轴上绘制两个不同的字典,一个向上,另一个向下绘制,就像从头到尾的格式一样?
- graph - 是否可以在python的机器学习中找到数据集的x和y坐标中的移位值?