Advertisement
Guest User

packer.json

a guest
Oct 5th, 2014
445
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. {
  2.     "variables": {
  3.         "ssh_name": "secret",
  4.         "ssh_pass": "secret",
  5.         "hostname": "packer-test",
  6.         "public_key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCsN77b/ev0LxFU9cd0VHc2uDPT3ZOHBsh4ff/ydsE7x6b3OOAF9l14781tGpk2KgadN5CQQVmgGrw2kI+MF+ex5KDNDltK5etzgrX6THpQSJi66Q1nrxd/gnsHkMGg4R/YMzoocHbwuwa+twemreXDItD2eBxqvqhJKyPxIKAwI0HcmZF8+15BOuB3IIlkQ+MioVtq1mzkeyf48LDh3rERYQqP35PwHZzq8lYHcrz734JSOZe7azuEHMCaLF5FQcXW0bsGGa+QPkfykSdM9wd8+GtPdg5NTWqCQYcIINgEODxuuOuH2BgN7HxrpBWhxQ64DDgBB5NPfVintO9nApIT kuranda@kuranda"
  7.     },
  8.     "builders": [{
  9.         "boot_command": [
  10.             "<esc><wait>",
  11.             "install <wait>",
  12.             "preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed_wheezy.cfg <wait>",
  13.             "debian-installer=en_US <wait>",
  14.             "auto <wait>",
  15.             "locale=en_US <wait>",
  16.             "netcfg/get_hostname={{ .Name }} <wait>",
  17.             "netcfg/get_domain=vagrantup.com <wait>",
  18.             "netcfg/get_nameservers=8.8.8.8 <wait>",
  19.             "fb=false <wait>",
  20.             "debconf/frontend=noninteractive <wait>",
  21.             "console-setup/ask_detect=false <wait>",
  22.             "console-keymaps-at/keymap=us <wait>",
  23.             "keyboard-configuration/xkb-keymap=us <wait>",
  24.             "<enter><wait>"
  25.         ],
  26.         "disk_size": 10140,
  27.         "guest_os_type": "Debian",
  28.  
  29.         "http_directory": "webserver_files",
  30.  
  31.         "iso_url": "http://cdimage.debian.org/debian-cd/7.6.0/i386/iso-cd/debian-7.6.0-i386-CD-1.iso",
  32.         "iso_checksum": "bbb362be12ae9043e9aaea282274c385",
  33.         "iso_checksum_type": "md5",
  34.  
  35.         "ssh_username": "{{user `ssh_name`}}",
  36.         "ssh_password": "{{user `ssh_pass`}}",
  37.         "ssh_wait_timeout": "20m",
  38.  
  39.         "shutdown_command": "echo 'halt -p' > shutdown.sh; echo {{user `ssh_pass`}} |sudo -S sh 'shutdown.sh'",
  40.  
  41.         "type": "virtualbox-iso",
  42.         "vboxmanage": [
  43.             [
  44.                 "modifyvm",
  45.                 "{{.Name}}",
  46.                 "--memory",
  47.                 "1024"
  48.             ],
  49.             [
  50.                 "modifyvm",
  51.                 "{{.Name}}",
  52.                 "--cpus",
  53.                 "1"
  54.             ]
  55.         ]
  56.     }],
  57.     "provisioners": [
  58.   {
  59.     "type": "shell",
  60.     "inline": [
  61.       "mkdir .ssh",
  62.       "echo '{{user `public_key`}}' >> .ssh/authorized_keys"
  63.     ]
  64.   },
  65.   {
  66.     "type": "shell",
  67.     "execute_command": "echo '{{user `ssh_pass`}}' | {{ .Vars }} sudo -E -S sh '{{ .Path }}'",
  68.     "inline": [
  69.       "add-apt-repository ppa:rquillo/ansible",
  70.       "apt-get update",
  71.       "apt-get install -y ansible",
  72.       "echo '%sudo    ALL=(ALL)  NOPASSWD:ALL' >> /etc/sudoers"
  73.     ]
  74.   }]
  75. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement