Created
October 17, 2013 14:21
-
-
Save MarcGrimme/7025764 to your computer and use it in GitHub Desktop.
interfaces_attributes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ "interfaces_attributes"=>{ | |
"new_interfaces"=>{ | |
"_destroy"=>"false", | |
"type"=>"Nic::Managed", | |
"mac"=>"FF:FF:FF:FF:FF:FF", | |
"name"=>if params[:host][:name] then params[:host][:name] else "" end + "-srv", | |
"domain_id"=>@domain.id, | |
"subnet_id"=> if @domain.subnets and @subnet and @domain.subnets.find_by_name(@subnet.name.split("-")[0]+"-Backend") then | |
@domain.subnets.find_by_name(@subnet.name.split("-")[0]+"-Backend").id | |
else | |
"" | |
end, | |
# ToDo: Replace if found with IP from DNS | |
"ip"=>begin Resolv.getaddress(params["host"]["name"]+"-srv") rescue "" end, | |
} | |
}} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment