您的位置:首页 > 其它

SaltStack源码分析之state模块

2015-05-14 15:06 225 查看
state模块用于控制minion端的状态系统
/usr/lib/python2.6/site-packages/salt/modules/state.py

def highstate(test=None,
queue=False,
**kwargs):
'''
Retrieve the state data from the salt master for this minion and execute it

test
Notify states to execute in test-only (dry-run) mode.

Sets the ``test`` variable in the minion ``opts`` for the duration of
the state run.
pillar
Custom Pillar data can be passed with the ``pillar`` kwarg. Values
passed here will override hard-coded Pillar values.
queue : ``False``
Instead of failing immediately when another state run is in progress,
queue the new state run to begin running once the other has finished.

This option starts a new thread for each queued state run so use this
option sparingly.
localconfig:
Instead of using running minion opts, load ``localconfig`` and merge that
with the running minion opts. This functionality is intended for using
"roots" of salt directories (with their own minion config, pillars,
file_roots) to run highstate out of.

CLI Example:

.. code-block:: bash

salt '*' state.highstate

salt '*' state.highstate whitelist=sls1_to_run,sls2_to_run
salt '*' state.highstate exclude=sls_to_exclude
salt '*' state.highstate exclude="[{'id': 'id_to_exclude'}, {'sls': 'sls_to_exclude'}]"

salt '*' state.highstate pillar="{foo: 'Foo!', bar: 'Bar!'}"
'''


本文出自 “Linux SA John” 博客,请务必保留此出处http://john88wang.blog.51cto.com/2165294/1651252
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: