【发布时间】:2020-07-18 05:48:06
【问题描述】:
根据ansible文档,我可以使用slurp来读取远程文件。
我有一个远程主机上的 java 属性文件,我想 slurp,所以我做了:
- name slurp xyz properties
slurp:
src: /some/path/on/the/remote/my.properties
register: myprops
- debug:
msg: "{{ myprops['content'] | b64decode }}"
如果我这样做,我会得到内容。
现在我想在 ansible 中使用该内容。例如。通过lookup。像这样的:
{{lookup('somePropertyInPropertiesFile', myprops['content'])}}
但这不起作用,因为查找模块只允许在文件中查找。
如何将 slurped 文件传递给查找?
我正在使用 ansible 2.9.9
【问题讨论】:
标签: ansible ansible-facts