尝试在Windows机器上运行state.apply sls时出现以下错误。
ID: ProvisionADDC Function: module.run Name: dsc.apply_config Result: False Comment: Module function dsc.apply_config threw an exception. Exception: No JSON results from powershell. Additional info follows: retcode: 0 stderr: stdout: Started: 12:06:08.044000 Duration: 2684.0 ms Changes:
因为win_dsc是执行模块,所以我被迫使用state.module模块在minion上运行这个函数:
C:\DSC:
file.directory:
- makedirs: True
allprofiles:
win_firewall.disabled
CopyDSCModules:
file.recurse:
- name: 'C:\Program Files\WindowsPowerShell\Modules'
- source: salt://windows/dsc/
InstallADDomainServices:
win_servermanager.installed:
- name: AD-Domain-Services
- restart: True
- require:
- file: CopyDSCModules
ProvisionADDC:
module.run:
- name: dsc.apply_config
- path: C:\DSC\
- source: salt://windows/mof
- require:
- file: 'C:\DSC'
- file: CopyDSCModules
- win_servermanager: InstallADDomainServices
有人有win_dsc和SaltStack的经验吗?