ansible - 根据变量更改 ansible 库存
问题描述
剧本可以从变量中加载库存列表吗?所以我可以根据选择的环境轻松自定义运行?
tasks:
- name: include environment config variables
include_vars:
file: "{{ item }}"
with_items:
- "../../environments/default.yml"
- "../../environments/{{ env_name }}.yml"
- name: set inventory
set_fact:
inventory.docker_host = " {{ env_docker_host }}"
解决方案
推荐阅读
- mongodb - mongo-driver:未知操作员:$meta
- flutter - 升级后 Flutter 应用程序无法编译
- angular - 通过角度组件使用自托管在 Windows 服务中的 wcf 服务
- excel - 确定是添加还是删除行
- azure - 为什么 Azure AD B2C 智能锁定规则不适用于自定义策略?
- keras - 创建对抗性生成器和预训练分类器的组合模型
- ios - WKWebView GoBack 从本地 Html
- c# - C# selenium instagram 登录问题
- python - 无法在 jupyter 笔记本中将字符串转换为浮点数
- python - 同时对多个文档使用 TF-IDF Vectorizer