Defining states depending on existance of a file/directory

前端 未结 3 684
广开言路
广开言路 2021-01-06 11:33

How is it possible to get something like the following running:

{% if not exist(\'/tmp/dummy/\') then %}
dummy:
  file.touch:
    - name: /tmp/dummy/tmp.txt
         


        
3条回答
  •  情歌与酒
    2021-01-06 11:56

    {% if 1 == salt['cmd.retcode']('test -f /tmp/woo.test') %}
    ack:
      file.touch:
        - name: /tmp/woo.test
    {% endif %}
    

提交回复
热议问题