Puppet Function: choria::lock
- Defined in:
- lib/puppet/functions/choria/lock.rb
- Function type:
- Ruby 4.x API
Overview
Runs a block of Puppet code within a Choria Data Store Lock
This requires that you have a lockable data store, something like consul or etcd
26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/puppet/functions/choria/lock.rb', line 26 Puppet::Functions.create_function(:"choria::lock", Puppet::Functions::InternalFunction) do dispatch :lock do scope_param param "String", :item param "Hash", :properties block_param "Callable", :block end def lock(scope, item, properties, &blk) require_relative "../../_load_choria" MCollective::Util::BoltSupport.init_choria.data_lock(scope, item, properties, &blk) end end |