diff --git a/Puppetfile b/Puppetfile index ee05fd472..44cfa4aa2 100644 --- a/Puppetfile +++ b/Puppetfile @@ -99,7 +99,7 @@ mod 'module-collectd', :git => 'https://github.com/pdxcat/puppet-module-collectd.git' mod 'module-data', - :commit => '0eead7f411f404b0a9a73bb161aac46c9fbe3219', + :commit => 'f62e245b08fd4003f13be13d75ea4a899fe8d3ea', :git => 'https://github.com/ripienaar/puppet-module-data.git' mod 'mongodb', diff --git a/module-data/lib/hiera/backend/module_data_backend.rb b/module-data/lib/hiera/backend/module_data_backend.rb index 94cd72ccb..94f4b4761 100644 --- a/module-data/lib/hiera/backend/module_data_backend.rb +++ b/module-data/lib/hiera/backend/module_data_backend.rb @@ -13,7 +13,7 @@ def initialize(cache=nil) def load_module_config(module_name, environment) default_config = {:hierarchy => ["common"]} - mod = Puppet::Module.find(module_name, environment) + mod = Puppet::Module.find(module_name) unless Puppet::Module.find(module_name, environment) return default_config unless mod @@ -25,7 +25,7 @@ def load_module_config(module_name, environment) Hiera.debug("Reading config from %s file" % module_config) config = load_data(module_config) end - + config["path"] = path default_config.merge(config) @@ -35,7 +35,11 @@ def load_data(path) return {} unless File.exist?(path) @cache.read(path, Hash, {}) do |data| - YAML.load(data) + if path.end_with? "/hiera.yaml" + YAML.load(data, deserialize_symbols: true) + else + YAML.load(data) + end end end