ansible - 将json文件分配给循环jinja2 ansible内的变量
问题描述
我正在尝试使用 --set-string 将 json 文件分配给 ansible 循环内的变量,然后运行 helm upgrade 命令。但它给了 -
此命令需要 2 个参数:版本名称、图表路径\n错误:插件 \"tiller\" exited with error" 错误。
{% for file in v.value.files %}
--set-string config[{{ loopOut.index0 }}].files[{{ loop.index0 }}].name={{ file }}
{% set args = args|combine(v.value.args) %}
--set-string config[{{ loopOut.index0 }}].files[{{ loop.index0 }}].value=
{{ lookup('file','../files/initData.json')| from_json }}
{% endfor %}
其中 loopOut 是外部循环变量,其中我有这个当前循环。我在这里做错了什么?我什至试着把
"{{ lookup('file','../files/initData.json')| from_json }}" in quotes
但这也无济于事。
解决方案
推荐阅读
- c++ - C结构对象成员名称作为参数
- docusignapi - DOB 字段作为日期选项卡提示日期选择器
- vb.net - 添加新行 Richtextbox
- javascript - 过滤出要显示的计划数据
- c++ - Conda CMake 没有找到 GCC——Windows
- python - Applescript调用包含模块的python文件
- android - 未处理的异常:'package:flutter/src/widgets/navigator.dart':断言失败:第 3018 行 pos 18:'!navigator._debugLocked':不正确
- r - 如何检查值是否存在于 R 中具有相同 ID 的几行中的任何一行中?
- python - PyToch Big Graph 的嵌入数据集中优化器的 state_dict 的目的是什么?
- java - 如何使用 Spring Kafka 处理两个时间戳之间的所有消息?