lib/hieracles/registry.rb in hieracles-0.3.2 vs lib/hieracles/registry.rb in hieracles-0.3.3

- old
+ new

@@ -20,7 +20,18 @@ Dir.glob(File.join(config.modulepath, '*')).sort.map do |f| File.basename(f) end end + def nodes_data(config, env = 'production', reload = false) + @_nodes_data = {} if reload || !@_nodes_data + @_nodes_data[env] ||= Dir.glob(File.join(config.encpath, '*.yaml')).sort.reduce({}) do |a, f| + fqdn = File.basename(f, '.yaml') + a[fqdn] = YAML.load_file(f)['parameters'] + a + end + end + + + end end