SaltMine用于从minion端收集任意数据然后存储到Master端。这些数据可以通过调用salt.modules.mine模块来供其他minion访问这些数据是在minion端收集然后发送到Master端,只有最近的数据才被维护。如果需要长期维护这些数据可以使用saltstack的returner或者theexternaljobcache
分类:
其他好文 时间:
2015-05-29 18:35:01
阅读次数:
192
/usr/lib/python2.6/site-packages/salt/runners/pillar.pypillarrunner模块提供一些在Master端与Pillar编译器交互的函数返回指定minion的pillar的编译top数据,如果没有指定minion,就使用第一个找到的miniondefshow_top(minion=None,saltenv=‘base‘):
‘‘‘
Returnsthecompiled..
分类:
其他好文 时间:
2015-05-29 16:04:42
阅读次数:
204
/usr/lib/python2.6/site-packages/salt/runners/cache.pycache模块返回minion端缓存的数据返回目标minion缓存的grains数据defgrains(tgt=None,expr_form=‘glob‘,**kwargs):
‘‘‘
Returncachedgrainsofthetargetedminions
CLIExample:
..code-block::bash
salt-runcache.grai..
分类:
系统相关 时间:
2015-05-29 15:55:49
阅读次数:
245
/usr/bin/salt-run#!/usr/bin/python
#EASY-INSTALL-ENTRY-SCRIPT:‘salt==2014.7.0‘,‘console_scripts‘,‘salt-run‘
__requires__=‘salt==2014.7.0‘
importsys
frompkg_resourcesimportload_entry_point
if__name__==‘__main__‘:
sys.exit(
load_entry_point(‘salt==2014.7.0‘,..
分类:
其他好文 时间:
2015-05-29 12:15:46
阅读次数:
126
Saltrunnersareconvenienceapplicationsexecutedwiththesalt-runcommand.Saltrunners是在Master端执行而不是在minion端执行runner模块和excution模块工作方式一样。所有可以使用的runner模块都放到runners目录下参考文章:http://docs.saltstack.com/en/2014.7/ref/runners/ind..
分类:
其他好文 时间:
2015-05-29 12:13:07
阅读次数:
141
/usr/lib/python2.6/site-packages/salt/runners/jobs.pyjobsrunner模块用于方便管理正在运行或者处于活动状态的job返回所有正在运行的job的报告defactive():
‘‘‘
Returnareportonallactivelyrunningjobsfromajobidcentric
perspective
CLIExample:
..code-block::bash
salt..
分类:
其他好文 时间:
2015-05-29 12:12:18
阅读次数:
199
Salt从0.11.0版本开始引入ReactorSystem。EventSystemTheeventsystemisalocalZeroMQPUBinterfacewhichfiressaltevents.ThiseventbusisanopensystemusedforsendinginformationnotifyingSaltandothersystemsaboutoperations.ReactorSLSfilesandeventtagsareassociatedinthemaster..
分类:
其他好文 时间:
2015-05-28 18:21:07
阅读次数:
173
/usr/lib/python2.6/site-packages/salt/modules/cmdmod.pycmdmod模块用于执行一些命令行‘‘
Amoduleforshellingout
Keepinmindthatthismoduleisinsecure,inthatitcangivewhomeverhas
accesstothemasterrootexecutionaccesstoallsaltminions.
‘‘‘#Importpythonlibs
importtime
..
分类:
其他好文 时间:
2015-05-28 14:17:59
阅读次数:
278
/usr/lib/python2.6/site-packages/salt/modules/pillar.pydefget(key,default=‘‘,merge=False,delimiter=‘:‘):
‘‘‘
..versionadded::0.14
Attempttoretrievethenamedvaluefrompillar,ifthenamedvalueisnot
availablereturnthepasseddefault.Thedefaultreturnisanemptystring...
分类:
其他好文 时间:
2015-05-27 16:02:05
阅读次数:
171
使用salt-call可以在minion本机执行salt命令/usr/bin/salt-call#!/usr/bin/python
#EASY-INSTALL-ENTRY-SCRIPT:‘salt==2014.7.0‘,‘console_scripts‘,‘salt-call‘
__requires__=‘salt==2014.7.0‘
importsys
frompkg_resourcesimportload_entry_point
if__name__==‘__main__‘:
s..
分类:
其他好文 时间:
2015-05-27 16:00:41
阅读次数:
247