Project

General

Profile

« Previous | Next » 

Revision 76607ed5

Added by Ohad Levy almost 13 years ago

  • ID 76607ed5fc692646c4b31791eea9c71a903e8f17

fixes #100 - Setting is now a ActiveRecord object

This allows users to manage foreman settings via the UI.

the UI is a bit ugly, but works :)

View differences:

app/models/environment.rb
unless Rails.env == "test"
# reread puppet configuration
Puppet.clear
Puppet[:config] = SETTINGS[:puppetconfdir] || "/etc/puppet/puppet.conf"
Puppet[:config] = SETTINGS[:puppetconfdir]
end
Puppet.parse_config # Check that puppet.conf has not been edited since the rack application was started
conf = Puppet.settings.instance_variable_get(:@values)
......
end
if env.values.compact.size == 0
# fall back to defaults - we probably don't use environments
env[:production] = conf[:main][:modulepath] || conf[:puppetmasterd][:modulepath] || SETTINGS[:modulepath] || Puppet[:modulepath] || "/etc/puppet/modules"
env[:production] = conf[:main][:modulepath] || conf[:puppetmasterd][:modulepath] || Setting[:modulepath]
end
return env
end

Also available in: Unified diff