|
1 | 1 | { |
| 2 | + "variables": { |
| 3 | + |
2 | 4 | "iso_url": "https://mirror.rackspace.com/archlinux/iso/latest/archlinux-2018.10.01-x86_64.iso", |
3 | 5 | "iso_checksum_url": "https://mirror.rackspace.com/archlinux/iso/latest/sha1sums.txt", |
4 | 6 | "iso_checksum_type": "sha1", |
5 | 7 | "disk_size": "20480", |
6 | 8 | "memory": "1024", |
7 | 9 | "cpus": "2", |
8 | 10 | "headless": "true", |
9 | | - "vagrant_cloud_token": "PLACEHOLDER", |
10 | 11 | "write_zeroes": "", |
11 | 12 | "boot_wait": "60s" |
| 13 | + }, |
| 14 | + "builders": [ |
| 15 | + { |
| 16 | + "type": "virtualbox-iso", |
| 17 | + "boot_wait": "{{user `boot_wait`}}", |
| 18 | + "http_directory": "http", |
| 19 | + "disk_size": "{{user `disk_size`}}", |
| 20 | + "guest_os_type": "ArchLinux_64", |
| 21 | + "iso_checksum_url": "{{user `iso_checksum_url`}}", |
| 22 | + "iso_checksum_type": "{{user `iso_checksum_type`}}", |
| 23 | + "iso_url": "{{user `iso_url`}}", |
| 24 | + "ssh_username": "vagrant", |
| 25 | + "ssh_password": "vagrant", |
| 26 | + "ssh_port": 22, |
| 27 | + "ssh_wait_timeout": "10000s", |
| 28 | + "shutdown_command": "sudo systemctl poweroff", |
| 29 | + "guest_additions_mode": "disable", |
| 30 | + "headless": "{{user `headless`}}", |
| 31 | + "vboxmanage": [ |
| 32 | + [ |
| 33 | + "modifyvm", |
| 34 | + "{{.Name}}", |
| 35 | + "--memory", |
| 36 | + "{{user `memory`}}" |
| 37 | + ], |
| 38 | + [ |
| 39 | + "modifyvm", |
| 40 | + "{{.Name}}", |
| 41 | + "--cpus", |
| 42 | + "{{user `cpus`}}" |
| 43 | + ] |
| 44 | + ], |
| 45 | + "boot_command": [ |
| 46 | + "<enter><wait10><wait10><wait10><wait10><wait10><enter><enter>", |
| 47 | + "curl -O 'http://{{.HTTPIP}}:{{.HTTPPort}}/install{,-chroot}.sh'<enter><wait>", |
| 48 | + "bash install.sh < install-chroot.sh && systemctl reboot<enter>" |
| 49 | + ] |
| 50 | + }, { |
| 51 | + "type": "qemu", |
| 52 | + "boot_wait": "{{user `boot_wait`}}", |
| 53 | + "http_directory": "http", |
| 54 | + "disk_size": "{{user `disk_size`}}", |
| 55 | + "iso_checksum_url": "{{user `iso_checksum_url`}}", |
| 56 | + "iso_checksum_type": "{{user `iso_checksum_type`}}", |
| 57 | + "iso_url": "{{user `iso_url`}}", |
| 58 | + "ssh_username": "vagrant", |
| 59 | + "ssh_password": "vagrant", |
| 60 | + "ssh_port": 22, |
| 61 | + "ssh_wait_timeout": "10000s", |
| 62 | + "shutdown_command": "sudo systemctl poweroff", |
| 63 | + "headless": "{{user `headless`}}", |
| 64 | + "qemuargs": [ |
| 65 | + [ |
| 66 | + "-m", |
| 67 | + "{{user `memory`}}" |
| 68 | + ], |
| 69 | + [ |
| 70 | + "-smp", |
| 71 | + "{{user `cpus`}}" |
| 72 | + ] |
| 73 | + ], |
| 74 | + "boot_command": [ |
| 75 | + "<enter><wait10><wait10><wait10><wait10><wait10><enter><enter>", |
| 76 | + "curl -O 'http://{{.HTTPIP}}:{{.HTTPPort}}/install{,-chroot}.sh'<enter><wait>", |
| 77 | + "bash install.sh < install-chroot.sh && systemctl reboot<enter>" |
| 78 | + ] |
| 79 | + }, { |
| 80 | + "type": "vmware-iso", |
| 81 | + "boot_wait": "{{user `boot_wait`}}", |
| 82 | + "http_directory": "http", |
| 83 | + "disk_size": "{{user `disk_size`}}", |
| 84 | + "iso_checksum_url": "{{user `iso_checksum_url`}}", |
| 85 | + "iso_checksum_type": "{{user `iso_checksum_type`}}", |
| 86 | + "iso_url": "{{user `iso_url`}}", |
| 87 | + "ssh_username": "vagrant", |
| 88 | + "ssh_password": "vagrant", |
| 89 | + "ssh_port": 22, |
| 90 | + "ssh_wait_timeout": "10000s", |
| 91 | + "shutdown_command": "sudo systemctl poweroff", |
| 92 | + "headless": "{{user `headless`}}", |
| 93 | + "memory": "{{user `memory`}}", |
| 94 | + "cpus": "{{user `cpus`}}", |
| 95 | + "boot_command": [ |
| 96 | + "<enter><wait10><wait10><wait10><wait10><wait10><enter><enter>", |
| 97 | + "curl -O 'http://{{.HTTPIP}}:{{.HTTPPort}}/install{,-chroot}.sh'<enter><wait>", |
| 98 | + "bash install.sh < install-chroot.sh && systemctl reboot<enter>" |
| 99 | + ] |
| 100 | + } |
12 | 101 |
|
| 102 | + ], |
| 103 | + "provisioners": [ |
| 104 | + { |
| 105 | + "type": "shell", |
| 106 | + "scripts": [ |
| 107 | + "provision/postinstall.sh", |
| 108 | + "provision/virtualbox.sh", |
| 109 | + "provision/cleanup.sh" |
| 110 | + ], |
| 111 | + "execute_command": "echo 'vagrant'|sudo -S sh '{{.Path}}'", |
| 112 | + "only": ["virtualbox-iso"] |
| 113 | + }, |
| 114 | + { |
| 115 | + "type": "shell", |
| 116 | + "scripts": [ |
| 117 | + "provision/postinstall.sh", |
| 118 | + "provision/qemu.sh", |
| 119 | + "provision/cleanup.sh" |
| 120 | + ], |
| 121 | + "execute_command": "echo 'vagrant'|sudo -S sh '{{.Path}}'", |
| 122 | + "only": ["qemu"] |
| 123 | + }, |
| 124 | + { |
| 125 | + "type": "shell", |
| 126 | + "scripts": [ |
| 127 | + "provision/postinstall.sh", |
| 128 | + "provision/vmware.sh", |
| 129 | + "provision/cleanup.sh" |
| 130 | + ], |
| 131 | + "execute_command": "echo 'vagrant'|sudo -S sh '{{.Path}}'", |
| 132 | + "only": ["vmware-iso"] |
| 133 | + }, |
| 134 | + { |
| 135 | + "type": "shell", |
| 136 | + "scripts": [ |
| 137 | + "provision/write_zeroes.sh" |
| 138 | + ], |
| 139 | + "execute_command": "if [ ! -z \"{{user `write_zeroes`}}\" ]; then echo 'vagrant'|sudo -S sh '{{.Path}}'; fi" |
| 140 | + } |
| 141 | + ], |
| 142 | + "post-processors": [ |
| 143 | + [ |
| 144 | + { |
| 145 | + "type": "vagrant", |
| 146 | + "keep_input_artifact": false, |
| 147 | + "output": "Arch-Linux-x86_64-{{ .Provider }}-{{isotime \"2006-01-02\"}}.box" |
| 148 | + } |
| 149 | + ] |
| 150 | + ] |
13 | 151 | } |
0 commit comments