|
| 1 | +{ |
| 2 | + "builders": [ |
| 3 | + { |
| 4 | + "type": "virtualbox-iso", |
| 5 | + "iso_checksum": "8acd2f56bfcba2f7ac74a7e4a5e565ce68c024c38525c0285573e41c86ae90c0", |
| 6 | + "iso_checksum_type": "sha256", |
| 7 | + "iso_url": "http://releases.ubuntu.com/trusty/ubuntu-14.04.2-server-amd64.iso", |
| 8 | + "ssh_username": "vagrant", |
| 9 | + "boot_command": [ |
| 10 | + "<esc><esc><enter><wait>", |
| 11 | + "/install/vmlinuz noapic preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed.cfg ", |
| 12 | + "debian-installer=en_US auto locale=en_US kbd-chooser/method=us hostname={{ .Name }} ", |
| 13 | + "fb=false debconf/frontend=noninteractive console-setup/ask_detect=false ", |
| 14 | + "keyboard-configuration/layoutcode=us keyboard-configuration/modelcode=pc104 ", |
| 15 | + "initrd=/install/initrd.gz -- <enter>" |
| 16 | + ], |
| 17 | + "boot_wait": "3s", |
| 18 | + "disk_size": "40000", |
| 19 | + "guest_os_type": "Ubuntu_64", |
| 20 | + "http_directory": "http", |
| 21 | + "shutdown_command": "/bin/echo 'vagrant' | /usr/bin/sudo -S /sbin/shutdown -P now", |
| 22 | + "ssh_password": "vagrant", |
| 23 | + "vboxmanage": [ |
| 24 | + ["modifyvm", "{{.Name}}", "--cpus", "2"], |
| 25 | + ["modifyvm", "{{.Name}}", "--memory", "4096"] |
| 26 | + ], |
| 27 | + "vm_name": "midas-server-{{timestamp}}" |
| 28 | + }, |
| 29 | + { |
| 30 | + "type": "vmware-iso", |
| 31 | + "iso_checksum": "8acd2f56bfcba2f7ac74a7e4a5e565ce68c024c38525c0285573e41c86ae90c0", |
| 32 | + "iso_checksum_type": "sha256", |
| 33 | + "iso_url": "http://releases.ubuntu.com/trusty/ubuntu-14.04.2-server-amd64.iso", |
| 34 | + "ssh_username": "vagrant", |
| 35 | + "boot_command": [ |
| 36 | + "<esc><esc><enter><wait>", |
| 37 | + "/install/vmlinuz noapic preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed.cfg ", |
| 38 | + "debian-installer=en_US auto locale=en_US kbd-chooser/method=us hostname={{ .Name }} ", |
| 39 | + "fb=false debconf/frontend=noninteractive console-setup/ask_detect=false ", |
| 40 | + "keyboard-configuration/layoutcode=us keyboard-configuration/modelcode=pc104 ", |
| 41 | + "initrd=/install/initrd.gz -- <enter>" |
| 42 | + ], |
| 43 | + "boot_wait": "3s", |
| 44 | + "disk_size": "40000", |
| 45 | + "guest_os_type": "ubuntu-64", |
| 46 | + "http_directory": "http", |
| 47 | + "shutdown_command": "/bin/echo 'vagrant' | /usr/bin/sudo -S /sbin/shutdown -P now", |
| 48 | + "ssh_password": "vagrant", |
| 49 | + "tools_upload_flavor": "linux", |
| 50 | + "vm_name": "midas-server-{{timestamp}}", |
| 51 | + "vmdk_name": "midas-server-{{timestamp}}", |
| 52 | + "vmx_data": { |
| 53 | + "memsize": "4096", |
| 54 | + "numvcpus": "2" |
| 55 | + } |
| 56 | + } |
| 57 | + ], |
| 58 | + "provisioners": [ |
| 59 | + { |
| 60 | + "type": "shell", |
| 61 | + "inline": [ |
| 62 | + "/bin/echo %vagrant ALL=NOPASSWD:ALL > /etc/sudoers.d/vagrant", |
| 63 | + "/bin/chmod 0440 /etc/sudoers.d/vagrant" |
| 64 | + ], |
| 65 | + "execute_command": "/bin/echo 'vagrant' | {{.Vars}} /usr/bin/sudo -E -S /bin/bash '{{.Path}}'" |
| 66 | + }, |
| 67 | + { |
| 68 | + "type": "shell", |
| 69 | + "inline": [ |
| 70 | + "/usr/bin/apt-get -qq update", |
| 71 | + "/usr/bin/apt-get -q -y -o Dpkg::Options::=--force-confdef -o DPkg::Options::=--force-confnew dist-upgrade", |
| 72 | + "/usr/bin/apt-get -q -y -o Dpkg::Options::=--force-confdef -o DPkg::Options::=--force-confnew install git nfs-common ntp software-properties-common", |
| 73 | + "/usr/bin/apt-add-repository -y ppa:ansible/ansible", |
| 74 | + "/usr/bin/apt-get -qq update", |
| 75 | + "/usr/bin/apt-get -q -y -o Dpkg::Options::=--force-confdef -o DPkg::Options::=--force-confnew install ansible", |
| 76 | + "/usr/bin/git clone https://github.com/midasplatform/Midas.git /vagrant", |
| 77 | + "/bin/chown -R vagrant:vagrant /vagrant" |
| 78 | + ], |
| 79 | + "execute_command": "{{.Vars}} /usr/bin/sudo -E /bin/bash '{{.Path}}'" |
| 80 | + }, |
| 81 | + { |
| 82 | + "type": "shell", |
| 83 | + "inline": [ |
| 84 | + "/usr/bin/apt-get -q -y -o Dpkg::Options::=--force-confdef -o DPkg::Options::=--force-confnew install dkms", |
| 85 | + "/bin/mount -o loop /home/vagrant/VBoxGuestAdditions.iso /mnt", |
| 86 | + "/usr/bin/yes | /bin/bash /mnt/VBoxLinuxAdditions.run", |
| 87 | + "/bin/umount /mnt", |
| 88 | + "/bin/rm -f /home/vagrant/VBoxGuestAdditions.iso" |
| 89 | + ], |
| 90 | + "execute_command": "{{.Vars}} /usr/bin/sudo -E /bin/bash '{{.Path}}'", |
| 91 | + "only": ["virtualbox-iso"] |
| 92 | + }, |
| 93 | + { |
| 94 | + "type": "shell", |
| 95 | + "inline": [ |
| 96 | + "/usr/bin/apt-get -q -y -o Dpkg::Options::=--force-confdef -o DPkg::Options::=--force-confnew install build-essential linux-headers-$(/bin/uname -r)", |
| 97 | + "/bin/mount -o loop /home/vagrant/linux.iso /mnt", |
| 98 | + "/bin/tar -xf /mnt/VMwareTools-*.tar.gz -C /tmp", |
| 99 | + "/bin/bash /tmp/vmware-tools-distrib/vmware-install.pl -d", |
| 100 | + "/bin/umount /mnt", |
| 101 | + "/bin/rm -rf /tmp/vmware-tools-distrib", |
| 102 | + "/bin/rm -f /home/vagrant/linux.iso" |
| 103 | + ], |
| 104 | + "execute_command": "{{.Vars}} /usr/bin/sudo -E /bin/bash '{{.Path}}'", |
| 105 | + "only": ["vmware-iso"] |
| 106 | + }, |
| 107 | + { |
| 108 | + "type": "ansible-local", |
| 109 | + "playbook_file": "../ansible/site.yml", |
| 110 | + "playbook_dir": "../ansible" |
| 111 | + }, |
| 112 | + { |
| 113 | + "type": "shell", |
| 114 | + "inline": [ |
| 115 | + "/usr/bin/apt-get -q -y autoremove", |
| 116 | + "/usr/bin/apt-get -q -y clean" |
| 117 | + ], |
| 118 | + "execute_command": "{{.Vars}} /usr/bin/sudo -E /bin/bash '{{.Path}}'" |
| 119 | + } |
| 120 | + ] |
| 121 | +} |
0 commit comments