fuel-library/deployment/puppet/nailgun/lib/facter/generate_fuel_key.rb
Dmitry Ilyin 2b74b5299e Facts update: check several files for needed info
Updated "astute_settings_yaml" and "fuel_version_yaml" facts to
support search for info in several files. This is needed for Fuel
containers. Both facts look for their files in /etc/fuel/ dir
first, then in default locations. Infortmation is takes from
the first file it finds.

- astute_settings_yaml fact search path:
    * /etc/fuel/astute.yaml
    * /etc/astute.yaml

- fuel_version_path fact search path:
    * /etc/fuel/version.yaml
    * /etc/fuel/nailgun/version.yaml
    * /etc/nailgun/version.yaml

blueprint fuel-containerization-of-services

Change-Id: Ie31dc02b88f1c7de419ac8b1a6ce3f1d149e7eae
2014-04-15 19:42:37 +04:00

12 lines
254 B
Ruby

require 'facter'
fuel_uuid_path = [ '/etc/fuel/fuel-uuid', '/etc/fuel-uuid' ]
fuel_uuid_path.each do |uuid_file|
if File.exist?(uuid_file)
Facter.add('generate_fuel_key') do
setcode { File.read(uuid_file).chomp }
end
break
end
end