Method: Onceover::Controlrepo#hiera_data

Defined in:
lib/onceover/controlrepo.rb

#hiera_dataObject



432
433
434
435
436
437
438
439
440
# File 'lib/onceover/controlrepo.rb', line 432

def hiera_data
  # This is going to try to find your hiera data directory, if you have named it something
  # unexpected it won't work
  possibe_datadirs = Dir["#{@root}/*/"]
  possibe_datadirs.keep_if { |dir| dir =~ /hiera(?:.*data)?/i }
  raise "There were too many directories that looked like hiera data: #{possibe_datadirs}" if possibe_datadirs.count > 1

  File.expand_path(possibe_datadirs[0])
end