如何执行SALT.MODULES.WIN_LGPO MODULE

时间:2017-06-15 06:33:28

标签: python salt-stack

我是SALT的新手,我的要求是以编程方式将一组策略更新到多个系统。然后我才知道SALT可以执行我的任务。我浏览了文档salt.modules.win_lgpo。但我不明白如何在我的本地机器上执行它?是否有执行win_lgpo模块的先决条件。我非常感谢任何帮助或指导

我在我的本地系统上尝试过这样的操作,我在我的系统上安装了SALT。我收到了以下错误。

C:\salt>salt '*' lgpo.get_policy_info 'Maximum password age' machine
Salt request timed out. The master is not responding. If this error persists after verifying the master is up, worker_threads may need to be increased

我想获得如上所述的政策信息,并设置如下所示的政策

salt '*' lgpo.set computer_policy="{'LockoutDuration': 2, 'RestrictAnonymous': 'Enabled', 'AuditProcessTracking': 'Succes, Failure'}"

我在文档

的一些试验和错误尝试后收到以下错误
root@hyi01lr0bsaehost92:~# salt-key -L
Accepted Keys:
Win2K_12_R2
Unaccepted Keys:
Rejected Keys:
root@hyi01lr0bsaehost92:~# salt Win2K_12_R2 lgpo.get machine return_full_policy_names=True
Win2K_12_R2:
    'lgpo.get' is not available.
root@hyi01lr0bsaehost92:~# salt Win2K_12_R2 test.ping
Win2K_12_R2:
    True
root@hyi01lr0bsaehost92:~# salt Win2K_12_R2 secedit.set 'PasswordComplexity' 8
Win2K_12_R2:
    'secedit.set' is not available.
root@hyi01lr0bsaehost92:~# salt Win2K_12_R2  secedit.configure section="System Access" setting="MinimumPasswordAge" value="10"
Win2K_12_R2:
    'secedit.configure' is not available.
root@hyi01lr0bsaehost92:~# salt Win2K_12_R2 lgpo.get machine return_full_policy_names=True
Win2K_12_R2:
    'lgpo.get' is not available.

在我的minion windows机器上执行后出现以下错误。 salt-call --local saltutil.sync_modules。还有一个问题,无论如何我们可以下载模块并安装在像pip这样的机器上吗?

C:\salt>salt-call --local saltutil.sync_modules
[INFO    ] Loading fresh modules for state activity
[INFO    ] Creating module dir 'c:\\salt\\var\\cache\\salt\\minion\\extmods\\modules'
[INFO    ] Syncing modules for environment 'base'
[INFO    ] Loading cache from salt://_modules, for base)
[INFO    ] Caching directory '_modules/' for environment 'base'
local:

0 个答案:

没有答案