4

次のようなものを実行するにはどうすればよいですか。

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

...
{% endif %}

ZIP ファイルからソフトウェアをインストールするために必要です。ミニオンで解凍したいのですが、インストールにのみ必要なライセンス ファイルの残りを残したくありません。

4

3 に答える 3

2

ソルトには純粋な python レンダラーを使用できます。これがどのように見えるかです。

#!py
import os

def run():
  # defines the hash config
  config = {}

  if (not os.path.isfile("/tmp/dummy")):
    config["dummy"] = { 
      "file.touch": [
        {'name': '/tmp/dummy'},
      ],  
    }    

  return config
于 2014-02-18T16:14:39.957 に答える