Bug #582 ยป 0001-Fixes-bug-582-make-dependency-on-libvirt-optional-th.patch
app/models/orchestration.rb | ||
---|---|---|
include Orchestration::DHCP
|
||
include Orchestration::DNS
|
||
include Orchestration::TFTP
|
||
include Orchestration::Libvirt
|
||
include Orchestration::Libvirt unless SETTINGS[:provisioning] == false
|
||
# save handles both creation and update of hosts
|
||
before_save :on_save
|
app/views/home/_settings.html.erb | ||
---|---|---|
['Global Parameters', common_parameters_url],
|
||
['Hardware Models', models_url],
|
||
['Host Groups', hostgroups_url],
|
||
['Hypervisors', hypervisors_url],
|
||
['Installation Media', media_url],
|
||
['LDAP Authentication', auth_source_ldaps_url],
|
||
['Operating Systems', operatingsystems_url],
|
||
... | ... | |
choices += [
|
||
['Roles', roles_url]
|
||
] if SETTINGS[:login] and User.current.admin?
|
||
choices += [
|
||
['Hypervisors', hypervisors_url],
|
||
] if SETTINGS[:provisioning]
|
||
%>
|
||
<%= select_tag "settings_dropdown", options_for_select(choices, @controller.request.url) %>
|
||
app/views/hosts/_unattended.html.erb | ||
---|---|---|
<% field_set_tag 'Unattended settings', :id => "unattended" do -%>
|
||
<% if SETTINGS[:provisioning] == true -%>
|
||
<span id="virtual_machine">
|
||
<%= render 'hypervisor' if @host.new_record? and Hypervisor.count > 0 %>
|
||
</span>
|
||
<% end -%>
|
||
<% field_set_tag 'Network settings', :id => "network" do -%>
|
||
<table>
|
||
<tr>
|
config/environment.rb | ||
---|---|---|
config.gem "googlecharts", :lib => "gchart"
|
||
config.gem "safemode"
|
||
config.gem "rack", :version => '1.1.0'
|
||
|
||
if SETTINGS[:provisioning] == true
|
||
config.gem 'libvirt'
|
||
config.gem 'virt'
|
||
end
|
||
# config.gem "bj"
|
||
# config.gem "hpricot", :version => '0.6', :source => "http://code.whytheluckystiff.net"
|
||
# config.gem "sqlite3-ruby", :lib => "sqlite3"
|
config/initializers/foreman.rb | ||
---|---|---|
require 'puppet/rails'
|
||
require 'gchart'
|
||
# import settings file
|
||
SETTINGS= YAML.load_file("#{RAILS_ROOT}/config/settings.yaml")
|
||
# fallback to a 30 minutes run interval if its not defined
|
||
SETTINGS[:puppet_interval] ||= 30
|
||
SETTINGS[:run_interval] = SETTINGS[:puppet_interval].minutes
|
config/preinitializer.rb | ||
---|---|---|
require 'yaml'
|
||
# import settings file
|
||
SETTINGS = YAML.load_file("#{RAILS_ROOT}/config/settings.yaml")
|
||
SETTINGS[:provisioning] = true unless SETTINGS.has_key?(:provisioning)
|
config/settings.yaml | ||
---|---|---|
#if none specified, plain "puppet" will be used.
|
||
#:puppet_server: puppet
|
||
#:unattended: false
|
||
#:provisioning: false
|
||
#use the following setting to override the default 30 minutes puppet run interval - value must be in minutes
|
||
#:puppet_interval: 60
|
||
#:document_root: /var/www
|