add qemu builder
authorvarac <varacanero@zeromail.org>
Thu, 14 Jan 2016 11:07:13 +0000 (12:07 +0100)
committervarac <varacanero@zeromail.org>
Thu, 14 Jan 2016 15:48:39 +0000 (16:48 +0100)
jessie.json

index 18808e1..e7ce261 100644 (file)
@@ -5,7 +5,10 @@
     },
     "variables": {
         "atlas_username": "{{env `ATLAS_USERNAME`}}",
-        "atlas_name": "{{env `ATLAS_NAME`}}"
+        "atlas_name": "{{env `ATLAS_NAME`}}",
+        "disk_size": "10000",
+        "password": "vagrant",
+        "user": "vagrant"
     },
     "provisioners": [
         {
         }
     ],
     "builders": [
-        {
+    {
+      "type": "qemu",
+      "accelerator": "kvm",
+      "boot_command": [
+        "<esc><wait><wait>",
+        "install auto <wait>",
+        "preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed.cfg <wait>",
+        "debian-installer=en_US locale=en_AU.UTF-8 keymap=us <wait>",
+        "netcfg/get_hostname={{ .Name }} <wait>",
+        "netcfg/get_domain={{ user `domain`}} <wait>",
+        "fb=false debconf/frontend=noninteractive <wait>",
+        "passwd/user-fullname={{user `user`}} <wait>",
+        "passwd/user-password={{user `password`}} <wait>",
+        "passwd/user-password-again={{user `password`}} <wait>",
+        "passwd/username={{user `user`}} <wait>",
+        "<enter><wait>"
+      ],
+      "boot_wait": "5s",
+      "disk_cache": "none",
+      "disk_interface": "virtio",
+      "disk_size": "{{ user `disk_size`}}",
+      "format": "qcow2",
+      "headless": "true",
+      "http_directory": "http",
+      "iso_checksum": "762eb3dfc22f85faf659001ebf270b4f",
+      "iso_checksum_type": "md5",
+      "iso_url": "http://cdimage.debian.org/debian-cd/current/amd64/iso-cd/debian-8.2.0-amd64-netinst.iso",
+      "net_device": "virtio-net",
+      "qemuargs": [
+        [
+          "-m",
+          "1024M"
+        ],
+        [
+          "-smp",
+          "4"
+        ]
+      ],
+      "shutdown_command": "echo '{{user `password`}}'|sudo -S shutdown -h now",
+      "ssh_password": "{{user `password`}}",
+      "ssh_username": "{{user `user`}}",
+      "ssh_wait_timeout": "15m"
+    },
+      {
             "type": "virtualbox-iso",
             "boot_command": [
                 "<esc><esc><enter><wait>",
                 "provider": "virtualbox",
                 "version": "0.0.1"
             }
+        },
+        {
+            "type": "atlas",
+            "only": ["qemu"],
+            "artifact": "{{user `atlas_username`}}/{{user `atlas_name`}}",
+            "artifact_type": "vagrant.box",
+            "metadata": {
+                "provider": "libvirt",
+                "version": "0.0.1"
+            }
         }]
     ]
 }