Пример #1
0
 def generateFilesFor(self, instance):
     folders = {}
     for f in instance.getSharedFolders():
         folders[f.getHostDir()] = f.getGuestDir()
     instance.getPackerFile()["variables"]["provider"] = self.__str__(
     ).lower()
     builder = {}
     builder["type"] = "virtualbox-iso"
     builder["guest_os_type"] = "Ubuntu_64"
     builder[
         "iso_url"] = "http://releases.ubuntu.com/trusty/ubuntu-14.04.2-server-amd64.iso"
     builder["iso_checksum_type"] = "none"
     builder["ssh_username"] = "******"
     builder["boot_command"] = [
         "<esc><esc><enter><wait>", "/install/vmlinuz noapic ",
         "preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed.cfg ",
         "debian-installer=en_US auto locale=en_US kbd-chooser/method=us ",
         "hostname={{ .Name }} ",
         "fb=false debconf/frontend=noninteractive ",
         "keyboard-configuration/modelcode=SKIP keyboard-configuration/layout=USA ",
         "keyboard-configuration/variant=USA console-setup/ask_detect=false ",
         "initrd=/install/initrd.gz -- <enter>"
     ]
     instance.getPackerFile()["builders"].append(builder)
     PROVIDERSLOGGER.debug("Files generated for Vbox provider.")
Пример #2
0
    def generateFilesFor(self, instance):
        folders = {}
        for f in instance.getSharedFolders():
            folders[f.getHostDir()] = f.getGuestDir()
        instance.getPackerFile()["variables"]["provider"] = self.__str__(
        ).lower()
        builder = {}
        builder["type"] = "docker"
        builder[
            "image"] = "aacebedo/ubuntu-{{user `os_version`}}-vagrant-{{user `architecture`}}"
        builder[
            "export_path"] = "machination-{{user `template_name`}}-{{user `architecture`}}-{{user `os_version`}}-{{user `provisioner`}}.tar"
        builder["run_command"] = [
            "-d", "-i", "-t", "--privileged", "{{.Image}}", "/sbin/init"
        ]
        builder["volumes"] = folders
        instance.getPackerFile()["builders"].append(builder)

        postproc = {}
        postproc["type"] = "docker-import"
        postproc[
            "repository"] = "machination-{{user `template_name`}}-{{user `architecture`}}-{{user `os_version`}}-{{user `provisioner`}}"
        postproc["tag"] = str(instance.getTemplate().getVersion())
        instance.getPackerFile()["post-processors"].append(postproc)
        PROVIDERSLOGGER.debug("Files generated for docker provider.")
Пример #3
0
 def generateFilesFor(self,instance):
   folders = {}
   for f in instance.getSharedFolders():
     folders[f.getHostDir()] = f.getGuestDir()
   instance.getPackerFile()["variables"]["provider"] = self.__str__().lower()
   builder = {}
   builder["type"] = "docker"
   builder["image"] = "aacebedo/ubuntu-{{user `os_version`}}-vagrant-{{user `architecture`}}"
   builder["export_path"] = "machination-{{user `template_name`}}-{{user `architecture`}}-{{user `os_version`}}-{{user `provisioner`}}.tar"
   builder["run_command"] = ["-d","-i","-t", "--privileged","{{.Image}}","/sbin/init"]
   builder["volumes"] = folders
   instance.getPackerFile()["builders"].append(builder)
   
   postproc = {}
   postproc["type"] = "docker-import"
   postproc["repository"] = "machination-{{user `template_name`}}-{{user `architecture`}}-{{user `os_version`}}-{{user `provisioner`}}"
   postproc["tag"] = str(instance.getTemplate().getVersion())
   instance.getPackerFile()["post-processors"].append(postproc)
   PROVIDERSLOGGER.debug("Files generated for docker provider.")
Пример #4
0
 def generateFilesFor(self,instance):
   folders = {}
   for f in instance.getSharedFolders():
     folders[f.getHostDir()] = f.getGuestDir()
   instance.getPackerFile()["variables"]["provider"] = self.__str__().lower()
   builder = {}
   builder["type"] = "virtualbox-iso"
   builder["guest_os_type"] = "Ubuntu_64"
   builder["iso_url"] = "http://releases.ubuntu.com/trusty/ubuntu-14.04.2-server-amd64.iso"
   builder["iso_checksum_type"] = "none"
   builder["ssh_username"] = "******"
   builder["boot_command"] = [ "<esc><esc><enter><wait>",
                               "/install/vmlinuz noapic ",
                               "preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed.cfg ",
                               "debian-installer=en_US auto locale=en_US kbd-chooser/method=us ",
                               "hostname={{ .Name }} ",
                               "fb=false debconf/frontend=noninteractive ",
                               "keyboard-configuration/modelcode=SKIP keyboard-configuration/layout=USA ",
                               "keyboard-configuration/variant=USA console-setup/ask_detect=false ",
                               "initrd=/install/initrd.gz -- <enter>"
   ]
   instance.getPackerFile()["builders"].append(builder)
   PROVIDERSLOGGER.debug("Files generated for Vbox provider.")