diff --git a/FreeNAS-11.1-U6-x64.json b/FreeNAS-11.1-U6-x64.json new file mode 100644 index 0000000..d08da5b --- /dev/null +++ b/FreeNAS-11.1-U6-x64.json @@ -0,0 +1,64 @@ +{ + "builders": + [ + { + "type": "virtualbox-iso", + "guest_os_type": "FreeBSD_64", + "iso_url": "https://download.freenas.org/11/latest/x64/FreeNAS-11.1-U6.iso", + "iso_checksum_type": "sha256", + "iso_checksum": "13bc3bf1775f6d30c6aef0102c72a1923fd7b75ca37469eb8018a2cdd97f5794", + "output_directory": "output", + "shutdown_command": "shutdown -p now", + "disk_size": 40960, + "ssh_host_port_min": 2222, + "ssh_host_port_max": 2229, + "ssh_username": "root", + "ssh_password": "freenas", + "ssh_port": 22, + "ssh_wait_timeout": "8m", + "headless": true, + "boot_command": + [ + "", + "1", + "Y", + "", + "", + "freenasfreenas", + "I", + "", + "", + "", + "", + "", + "", + "3", + "", + "", + "", + "", + "", + "9", + "bash", + "curl --verbose --silent http://localhost/account/login/ 2>&1 | tee csrfoutput.txt", + "COOKIE=$(grep -o 'Cookie:[^;]*' csrfoutput.txt)", + "TOKEN=$(grep -o 'csrfmiddlewaretoken[^/]*/' csrfoutput.txt | awk -F\"'\" '{print $3}' | head -n1 )", + "curl -X PUT -u root:freenas -H \"${COOKIE}\" -H 'Content-Type: application/json' -d \"{\\\"csrfmiddlewaretoken\\\": \\\"${TOKEN}\\\", \\\"ssh_rootlogin\\\": true}\" http://localhost/api/v1.0/services/ssh/", + "curl -X PUT -u root:freenas -H \"${COOKIE}\" -H 'Content-Type: application/json' -d \"{\\\"csrfmiddlewaretoken\\\": \\\"${TOKEN}\\\", \\\"srv_enable\\\": true}\" http://localhost/api/v1.0/services/services/ssh/", + "rm csrfoutput.txt" + ], + "vboxmanage": [ + [ "modifyvm", "{{.Name}}", "--memory", "1024" ], + [ "modifyvm", "{{.Name}}", "--nic1", "nat" ] + ] + } + ], + "post-processors":[ + { + "output": "FreeNAS-11.1-U6-x64-vbox.box", + "type": "vagrant", + "compression_level": 1, + "keep_input_artifact": false + } + ] +}