怎么可能得到以下运行:
{% if not exist('/tmp/dummy/') then %}
dummy:
file.touch:
- name: /tmp/dummy/tmp.txt
...
{% endif %}
Run Code Online (Sandbox Code Playgroud)
我需要它来从ZIP文件安装软件.我想解开minions,但在那里我不想要任何许可证文件的遗留物,我只需要安装,左边.
{% if 1 == salt['cmd.retcode']('test -f /tmp/woo.test') %}
ack:
file.touch:
- name: /tmp/woo.test
{% endif %}
Run Code Online (Sandbox Code Playgroud)
你可以使用除非这个.
dummy:
file.touch:
- name: /tmp/dummy/tmp.txt
- unless: test -d /tmp/dummy/
Run Code Online (Sandbox Code Playgroud)