module PackerFiles

Utility functions for the module

Implement the CLI sub-commands for OS.

The ROOT of all the CLI commands. Other Sub commands are declared as they go.

Top level Module for this gem.

Exceptions generated by the PackerFile generator.

Requires

An implementation for CDImage which lists all available CentOS CD Mirrors

OS class that handles details for generating Kickstart files for CentOS Servers.

OS class that handles details for generating Packer files for CentOS Servers.

Apt Setup handles all apt-related questions during the initial phase of OS installation.

An implementation for CDImage which lists all available Debian CD Mirrors

Auto configures the debian mirror list. This is useful in pre-seeding the fastest possible mirror.

OS class that handles details for generating Preseed files for Debian Servers.

OS class that handles details for generating Packer files for Debian Servers.

The Document generator class generates the template file for a given OS class.

The Finder class is used to find various things about OS supported by PackerFiles gem.

An implementation for CDImage For RHEL

OS class that handles details for generating Packer files for Fedora Servers.

An implementation for CDImage For Fedora

OS class that handles details for generating Packer files for RHEL Servers.

An implementation for CDImage which lists all available Ubuntu CD Mirrors

OS class that handles details for generating Packer files for Ubuntu Desktop.

An implementation for CDImage for Ubuntu Desktop.

Auto configures the Ubuntu mirror list. This is useful in pre-seeding the fastest possible mirror.

OS class that handles details for generating Packer files for Ubuntu Servers.

The Remote Copier class is used for copying local files or directories into the remote host.

The Chef Solo class is used for executing a series of Cookbooks inside the VM, using chef solo provisioner.

Chef Solo helper is useful to download [remote tar.gz] files into a local folder.

The Remote Copier class is used for copying local files or directories into the remote host.

The External script class is used for executing a series of external scripts inside the VM.

The Inline script class is used for executing a series of script commands inside the VM.

Top level class for managing Provisioners in a OS Spec file

Requires

Converts a given OS into a KVM builder

Converts a given OS into a VMWare builder

Converts a given OS into a VirtualBox builder

Constants

VERSION

Public Class Methods

DirPath(file_name) click to toggle source

Given a Path, return it's absolute path within the context of the Gem

# File lib/PackerFiles.rb, line 23
def self.DirPath(file_name)
   self.GemSpec.matches_for_glob(file_name)
end
GemName() click to toggle source

Accessor for the Gem name

# File lib/PackerFiles.rb, line 13
def self.GemName
  @@gem
end
GemSpec() click to toggle source

Accessor for Gem Spec

# File lib/PackerFiles.rb, line 18
def self.GemSpec
  Gem::Specification.find_by_name(self.GemName)
end
Generate(os_name, version = nil, &block) click to toggle source

Top level function that is called by the DSL to generate all the required PackerFiles

# File lib/PackerFiles.rb, line 36
def self.Generate(os_name, version = nil, &block)
   require 'Finder'
   finder = Finder.new
   obj    = finder.class_name(os_name, version).new(&block)
   obj.Generate
end
evaluate_erb(filename, hash) click to toggle source

Evaluate a given ERB file in a given OS folder with the object hash. The hash contains object bindings in the form of {var, obj} where {var} is present in the erb file.

# File lib/PackerFiles.rb, line 30
def self.evaluate_erb(filename, hash)
   return Erubis::Eruby.new(File.read(filename)).evaluate(hash)
end