fuel-library/deployment/puppet/nailgun/lib/facter/fuel_version.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

15 lines
372 B
Ruby

require 'facter'
fuel_version_path = [ '/etc/fuel/version.yaml', '/etc/fuel/nailgun/version.yaml', '/etc/nailgun/version.yaml' ]
read_data = "none"
Facter.add('fuel_version_yaml') do
fuel_version_path.each do |fuel_version_file|
if File.exist?(fuel_version_file)
read_data = File.read(fuel_version_file)
break
end
end
setcode { read_data }
end