Ana*_*oly 3 powershell configurationmanager salt-stack
是否可以在Saltsack中执行相同的操作,但是通过嵌入式功能(没有PowerShell解决方法)?
installation:
cmd.run:
- name: ./installation_script
wait for installation:
cmd.run:
- name: powershell -command "Start-Sleep 10"
- unless: powershell -command "Test-Path @('/path/to/file/to/appear')"
Run Code Online (Sandbox Code Playgroud)
不幸的是,在当前版本的salt中没有更好的方法.但是retry在下一个版本的氮气中,有些逻辑被添加到各州.
我在那个版本中这样做的方式是.
installation:
cmd.run:
- name: ./installation_script
wait for installation:
cmd.run:
- name: Test-Path @('/path/to/file/to/appear')
- retry:
- attempts: 15
- interval: 10
- until: True
- shell: powershell
Run Code Online (Sandbox Code Playgroud)
这将继续运行Test-Path,直到它以0退出代码退出(或者在powershell中等效)
https://docs.saltstack.com/en/develop/ref/states/requisites.html#retrying-states
丹尼尔
| 归档时间: |
|
| 查看次数: |
334 次 |
| 最近记录: |