class PackerFiles::Ubuntu::Server
Public Class Methods
new()
click to toggle source
Constructor. Yield self for further initialization
Calls superclass method
PackerFiles::Debian::Server::new
# File lib/PackerFiles/OS/Ubuntu/Server.rb, line 14 def initialize super end
Public Instance Methods
boot_command()
click to toggle source
Boot Command Override
# File lib/PackerFiles/OS/Ubuntu/Server.rb, line 57 def boot_command file = PackerFiles.DirPath('Ubuntu/Templates/boot_command_erb.rb') hash = { 'obj' => self, 'network' => self.Network } value = PackerFiles.evaluate_erb(file.first, hash) value.split("\n") end
cd_image_hook()
click to toggle source
Hook function called before normalizing CD
Image
# File lib/PackerFiles/OS/Ubuntu/Server.rb, line 19 def cd_image_hook self.CDImage.impl = Ubuntu::CD.new end
guest_os_type()
click to toggle source
Guest OS Type override
# File lib/PackerFiles/OS/Ubuntu/Server.rb, line 65 def guest_os_type return "Ubuntu_64" if (self.CDImage.arch == "amd64") return "Ubuntu" end
preseed_file()
click to toggle source
Name of the preseed file
# File lib/PackerFiles/OS/Ubuntu/Server.rb, line 49 def preseed_file rel = self.CDImage.release arch = self.CDImage.arch name = "preseed-ubuntu-server-#{rel}-#{arch}.cfg" File.join(http_dir, name) end
preseed_write_hook(objects)
click to toggle source
Hook for writing into preseed file.
# File lib/PackerFiles/OS/Ubuntu/Server.rb, line 24 def preseed_write_hook(objects) # Preseed file by evaluating templates @ Debian folder. preseed = Debian::Preseed.new(preseed_file) # Convert objects into Preseed configuration. objects.each do |obj| if obj.is_a? Debian::Apt preseed.convert obj, 'Ubuntu/Templates' else preseed.convert obj, 'Debian/Templates' end end # Generate fastest debian mirrors preseed.eval_file 'Debian/Templates/Mirrors_erb.rb', {'obj' => Ubuntu::Mirrors.new} # Return the preseed object for further customization # by derived classes. return preseed end
vmware_guest_os_type()
click to toggle source
VMWare Guest OS Type override
# File lib/PackerFiles/OS/Ubuntu/Server.rb, line 71 def vmware_guest_os_type return "ubuntu-64" if (self.CDImage.arch == "amd64") return "ubuntu" end