%PDF- %PDF-
Direktori : /usr/lib/python2.7/site-packages/salt/states/ |
Current File : //usr/lib/python2.7/site-packages/salt/states/zk_concurrency.pyo |
� ���^c @@ s� d Z d d l m Z m Z m Z d Z d Z d � Z d d d d e d d d d d d � Z d d d e d d d d d d � Z e d d d d d d � Z d S( u Control concurrency of steps within state execution using zookeeper =================================================================== :depends: kazoo :configuration: See :py:mod:`salt.modules.zookeeper` for setup instructions. This module allows you to "wrap" a state's execution with concurrency control. This is useful to protect against all hosts executing highstate simultaneously if your services don't all HUP restart. The common way of protecting against this is to run in batch mode, but that doesn't protect from another person running the same batch command (and thereby having 2x the number of nodes deploying at once). This module will bock while acquiring a slot, meaning that however the command gets called it will coordinate with zookeeper to ensure that no more than max_concurrency steps are executing with a single path. .. code-block:: yaml acquire_lock: zk_concurrency.lock: - name: /trafficeserver - zk_hosts: 'zookeeper:2181' - max_concurrency: 4 - prereq: - service: trafficserver trafficserver: service.running: - watch: - file: /etc/trafficserver/records.config /etc/trafficserver/records.config: file.managed: - source: salt://records.config release_lock: zk_concurrency.unlock: - name: /trafficserver - require: - service: trafficserver This example would allow the file state to change, but would limit the concurrency of the trafficserver service restart to 4. i ( t absolute_importt print_functiont unicode_literalsu zk_concurrency.locku zk_concurrency.unlocku zk_concurrency.party_membersu zk_concurrencyc C@ s t d � t D� � s t St S( Nc s@ s | ] } | t k Vq d S( N( t __salt__( t .0t func( ( s>