Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {
- "variables": {
- "ssh_name": "secret",
- "ssh_pass": "secret",
- "hostname": "packer-test",
- "public_key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCsN77b/ev0LxFU9cd0VHc2uDPT3ZOHBsh4ff/ydsE7x6b3OOAF9l14781tGpk2KgadN5CQQVmgGrw2kI+MF+ex5KDNDltK5etzgrX6THpQSJi66Q1nrxd/gnsHkMGg4R/YMzoocHbwuwa+twemreXDItD2eBxqvqhJKyPxIKAwI0HcmZF8+15BOuB3IIlkQ+MioVtq1mzkeyf48LDh3rERYQqP35PwHZzq8lYHcrz734JSOZe7azuEHMCaLF5FQcXW0bsGGa+QPkfykSdM9wd8+GtPdg5NTWqCQYcIINgEODxuuOuH2BgN7HxrpBWhxQ64DDgBB5NPfVintO9nApIT kuranda@kuranda"
- },
- "builders": [{
- "boot_command": [
- "<esc><wait>",
- "install <wait>",
- "preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed_wheezy.cfg <wait>",
- "debian-installer=en_US <wait>",
- "auto <wait>",
- "locale=en_US <wait>",
- "netcfg/get_hostname={{ .Name }} <wait>",
- "netcfg/get_domain=vagrantup.com <wait>",
- "netcfg/get_nameservers=8.8.8.8 <wait>",
- "fb=false <wait>",
- "debconf/frontend=noninteractive <wait>",
- "console-setup/ask_detect=false <wait>",
- "console-keymaps-at/keymap=us <wait>",
- "keyboard-configuration/xkb-keymap=us <wait>",
- "<enter><wait>"
- ],
- "disk_size": 10140,
- "guest_os_type": "Debian",
- "http_directory": "webserver_files",
- "iso_url": "http://cdimage.debian.org/debian-cd/7.6.0/i386/iso-cd/debian-7.6.0-i386-CD-1.iso",
- "iso_checksum": "bbb362be12ae9043e9aaea282274c385",
- "iso_checksum_type": "md5",
- "ssh_username": "{{user `ssh_name`}}",
- "ssh_password": "{{user `ssh_pass`}}",
- "ssh_wait_timeout": "20m",
- "shutdown_command": "echo 'halt -p' > shutdown.sh; echo {{user `ssh_pass`}} |sudo -S sh 'shutdown.sh'",
- "type": "virtualbox-iso",
- "vboxmanage": [
- [
- "modifyvm",
- "{{.Name}}",
- "--memory",
- "1024"
- ],
- [
- "modifyvm",
- "{{.Name}}",
- "--cpus",
- "1"
- ]
- ]
- }],
- "provisioners": [
- {
- "type": "shell",
- "inline": [
- "mkdir .ssh",
- "echo '{{user `public_key`}}' >> .ssh/authorized_keys"
- ]
- },
- {
- "type": "shell",
- "execute_command": "echo '{{user `ssh_pass`}}' | {{ .Vars }} sudo -E -S sh '{{ .Path }}'",
- "inline": [
- "add-apt-repository ppa:rquillo/ansible",
- "apt-get update",
- "apt-get install -y ansible",
- "echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers"
- ]
- }]
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement