CentOS 6.5
Foreman 1.7.5
ruby193-ruby-1.9.3.484-50.el6.centos.alt.x86_64
Resolve template parameters keep failing if host_parameters_attributes
exists.
Started POST "/hosts/template_used?provisioning=build" for 10.100.17.143 at
2015-04-30 04:50:00 -0500
Processing by HostsController#template_used as /
Parameters: {"utf8"=>"✓",
"authenticity_token"=>"x5mJTuyhgKFAWbBzPR1GcbgkMKRTBbRh6eNr0XKIiCI=",
"host"=>{"name"=>"aic1-2", "hostgroup_id"=>"", "environment_id"=>"1",
"puppet_ca_proxy_id"=>"1", "puppet_proxy_id"=>"1", "puppetclass_ids"=>[""],
"managed"=>"t", "progress_report_id"=>"[FILTERED]", "domain_id"=>"3",
"realm_id"=>"", "mac"=>"00:15:b2:a5:f3:4d", "subnet_id"=>"2",
"ip"=>"172.29.60.26",
"interfaces_attributes"=>{"new_interfaces"=>{"_destroy"=>"false",
"type"=>"Nic::Managed", "mac"=>"", "identifier"=>"", "name"=>"",
"domain_id"=>"", "subnet_id"=>"", "ip"=>"", "managed"=>"1", "virtual"=>"0",
"tag"=>"", "attached_to"=>""}}, "architecture_id"=>"1",
"operatingsystem_id"=>"5", "medium_id"=>"20", "ptable_id"=>"7", "disk"=>"",
"root_pass"=>"[FILTERED]",
"host_parameters_attributes"=>{"0"=>{"name"=>"test", "value"=>"[FILTERED]",
"hidden_value"=>"[FILTERED]", "_destroy"=>"false", "nested"=>"",
"id"=>"301"}}, "is_owned_by"=>"1-Users", "enabled"=>"1", "model_id"=>"",
"comment"=>"", "overwrite"=>"false"}, "fakepassword"=>"[FILTERED]",
"provisioning"=>"build"}
Rendered common/404.html.erb within layouts/application (1.6ms)
Rendered layouts/base.html.erb (1.5ms)
Completed 404 Not Found in 29ms (Views: 5.3ms | ActiveRecord: 3.6ms)
The way i have fixed it (locally) is adding :host_parameters_attributes
to except list in "def template_used"
/usr/share/foreman/app/controllers/hosts_controller.rb
def template_used
host = Host.new(params[:host].except(:host_parameters_attributes,
:interfaces_attributes))
templates = host.available_template_kinds(params[:provisioning])
return not_found if templates.empty?
render :partial => 'provisioning', :locals => { :templates => templates
}
end