Revision 5af52b3b
Added by Ohad Levy about 14 years ago
- ID 5af52b3b8c6aaf16482f75aaf07c747a2e253908
app/controllers/hosts_controller.rb | ||
---|---|---|
@host = Host.find(params[:id])
|
||
end
|
||
|
||
def storeconfig_klasses
|
||
@host = Host.find(params[:id])
|
||
end
|
||
|
||
private
|
||
def find_hosts
|
||
fact, klass = params[:fact], params[:class]
|
app/models/host.rb | ||
---|---|---|
return data
|
||
end
|
||
|
||
def classes_from_storeconfigs
|
||
klasses = resources.find(:all, :conditions => {:restype => "Class"}, :select => :title)
|
||
klasses.map!(&:title).delete(:main)
|
||
return klasses
|
||
end
|
||
|
||
private
|
||
# align common mac and ip address input
|
||
def normalize_addresses
|
app/views/hosts/show.html.erb | ||
---|---|---|
<%= link_to "YAML", :action=>"externalNodes", :id => @host %>
|
||
<%= link_to_if @host.build == false, "Build", {:action=>"setBuild", :id => @host} %>
|
||
<%= link_to_if SETTINGS[:puppetrun], "Run Puppet", {:action=>"puppetrun", :id => @host} %>
|
||
<%= link_to_if @host.resources.count > 0, "All Puppet Classes", storeconfig_klasses_host_path(@host) %>
|
||
<%= link_to "Delete", host_path(@host), :confirm => 'Are you sure?', :method => :delete%>
|
||
</div>
|
||
|
app/views/hosts/storeconfig_klasses.html.erb | ||
---|---|---|
<ul>
|
||
<% for klass in @host.classes_from_storeconfigs -%>
|
||
<li><%= h klass %></li>
|
||
<% end -%>
|
||
</ul>
|
||
<%= link_to 'back', host_path(@host) %>
|
config/routes.rb | ||
---|---|---|
map.connect "/hosts/query", :controller => 'hosts', :action => 'query'
|
||
map.resources :hosts,
|
||
:member => {:report => :get, :reports => :get, :facts => :get,
|
||
:environment_selected => :post, :architecture_selected => :post, :os_selected => :post},
|
||
:environment_selected => :post, :architecture_selected => :post, :os_selected => :post,
|
||
:storeconfig_klasses => :get},
|
||
:collection => { :show_search => :get}
|
||
map.dashboard '/dashboard', :controller => 'dashboard'
|
||
map.audit '/audit', :controller => 'audit'
|
Also available in: Unified diff
fixes #220 - show all used puppet classes when using storeconfigs