Puppet Function: choria::data
- Defined in:
- lib/puppet/functions/choria/data.rb
- Function type:
- Ruby 4.x API
Overview
Read or write data from a Choria Playbook Data Store
Any Data Store supported by Choria Playbooks is supported except the ‘memory` one as there is no shared memory space between these function invocations
The properties passed to the function is identical to those documents in the [Choria Playbook Documentation](choria.io/docs/playbooks/data/).
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 |
# File 'lib/puppet/functions/choria/data.rb', line 28 Puppet::Functions.create_function(:"choria::data", Puppet::Functions::InternalFunction) do dispatch :read do scope_param param "String", :item param "Hash", :properties end dispatch :write do scope_param param "String", :item param "String", :value param "Hash", :properties end def init require_relative "../../_load_choria" MCollective::Util::BoltSupport.init_choria end def read(scope, item, properties) init.data_read(scope, item, properties) end def write(scope, item, value, properties) init.data_write(scope, item, value, properties) end end |