【发布时间】:2021-12-05 05:24:19
【问题描述】:
我试图在 Saltstack 中重用命令的输出,但是当我尝试使用“cmd.run”打印输出时,它失败并出现以下错误。不确定从“cmd.run”返回的数据格式。
{% set output = salt['cmd.shell']('ifconfig') %}
display:
cmd.run:
- name: echo '{{ output }}'
错误:
Data failed to compile:
----------
Rendering SLS 'base:patching.install_patches' failed: mapping values are not allowed in this context
【问题讨论】:
标签: jinja2 salt-stack