-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
143 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
output-virtualbox-iso/ | ||
packer_cache/ | ||
*.box |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
--- | ||
- hosts: all | ||
become: true | ||
tasks: | ||
|
||
- name: Install provisioners | ||
apt: name={{ item }} state=present | ||
with_items: | ||
- puppet | ||
- chef | ||
|
||
- name: Vagrant insecure key | ||
authorized_key: user=vagrant key=https://raw.githubusercontent.com/mitchellh/vagrant/master/keys/vagrant.pub | ||
|
||
- name: Insert "UseDNS no" into sshd_config | ||
blockinfile: | ||
dest: /etc/ssh/sshd_config | ||
block: | | ||
UseDNS no |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
d-i time/zone string UTC | ||
d-i debian-installer/locale string en_US | ||
d-i keyboard-configuration/xkb-keymap select us | ||
|
||
d-i partman-auto/method string regular | ||
d-i partman-auto/choose_recipe select atomic | ||
d-i partman/choose_partition select finish | ||
d-i partman/confirm boolean true | ||
d-i partman/confirm_nooverwrite boolean true | ||
|
||
d-i passwd/root-password-again password vagrant | ||
d-i passwd/root-password password vagrant | ||
d-i passwd/user-fullname string vagrant | ||
d-i passwd/username string vagrant | ||
d-i passwd/user-password password vagrant | ||
d-i passwd/user-password-again password vagrant | ||
d-i user-setup/allow-password-weak boolean true | ||
|
||
d-i netcfg/hostname string xenial64 | ||
|
||
d-i pkgsel/include string openssh-server sudo | ||
|
||
d-i preseed/late_command string \ | ||
echo 'vagrant ALL=(ALL) NOPASSWD: ALL' > /target/etc/sudoers.d/vagrant; \ | ||
in-target chmod 440 /etc/sudoers.d/vagrant; | ||
|
||
d-i finish-install/reboot_in_progress note |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#!/usr/bin/env bash | ||
|
||
export DEBIAN_FRONTEND=noninteractive | ||
sudo apt update | ||
sudo apt install -y ansible linux-headers-$(uname -r) build-essential dkms | ||
|
||
sudo mkdir /media/VBoxGuestAdditions | ||
sudo mount -o loop,ro /home/vagrant/VBoxGuestAdditions.iso /media/VBoxGuestAdditions | ||
sudo sh /media/VBoxGuestAdditions/VBoxLinuxAdditions.run | ||
sudo umount /media/VBoxGuestAdditions | ||
sudo rmdir /media/VBoxGuestAdditions | ||
rm /home/vagrant/VBoxGuestAdditions.iso |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
{ | ||
"builders": [ | ||
{ | ||
"type": "virtualbox-iso", | ||
"guest_os_type": "Ubuntu_64", | ||
"iso_url": "http://releases.ubuntu.com/16.04/ubuntu-16.04-beta2-server-amd64.iso", | ||
"iso_checksum": "0f948fea5a587a62a873d2c001948a6ffbda20b67b05a468006caf9dfd41bcd7", | ||
"iso_checksum_type": "sha256", | ||
"vm_name": "packer-ubuntu-16.04-amd64", | ||
"disk_size": "{{ user `disk_size` }}", | ||
"headless": "{{ user `headless` }}", | ||
"boot_wait": "5s", | ||
"http_directory": "http", | ||
"boot_command": [ | ||
"<enter><wait>", | ||
"<f6><esc>", | ||
"<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>", | ||
"<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>", | ||
"<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>", | ||
"<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>", | ||
"<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>", | ||
"<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>", | ||
"<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>", | ||
"<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>", | ||
"<bs><bs><bs>", | ||
"/install/vmlinuz ", | ||
"initrd=/install/initrd.gz ", | ||
"auto=true ", | ||
"priority=critical ", | ||
"url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed.cfg", | ||
"<wait><enter>" | ||
], | ||
"ssh_wait_timeout": "30m", | ||
"ssh_username": "vagrant", | ||
"ssh_password": "vagrant", | ||
"shutdown_command": "sudo systemctl poweroff", | ||
"vboxmanage": [ | ||
["modifyvm", "{{ .Name }}", "--memory", "{{ user `memory` }}"], | ||
["modifyvm", "{{ .Name }}", "--cpus", "{{ user `cpus` }}"] | ||
] | ||
} | ||
], | ||
"provisioners": [ | ||
{ | ||
"type": "shell", | ||
"scripts": "scripts/install.sh" | ||
}, | ||
{ | ||
"type": "ansible-local", | ||
"playbook_file": "ansible/playbook.yml", | ||
"playbook_dir": "ansible" | ||
} | ||
], | ||
"post-processors": [ | ||
[ | ||
{ | ||
"type": "vagrant", | ||
"compression_level": 9, | ||
"output": "ubuntu-16.04-amd64.box", | ||
"keep_input_artifact": false | ||
}, | ||
{ | ||
"type": "atlas", | ||
"artifact": "s12v/xenial64", | ||
"artifact_type": "vagrant.box", | ||
"metadata": { | ||
"version": "20160401", | ||
"description": "**Ubuntu 16.04 beta 2**. Baked with https://github.com/s12v/xenial\n - Ansible, Puppet, Chef\n - VBoxGuestAdditions 5.0.x\n - 80G disk", | ||
"created_at": "{{timestamp}}", | ||
"provider": "virtualbox" | ||
} | ||
} | ||
] | ||
], | ||
"variables": { | ||
"cpus": "1", | ||
"memory": "512", | ||
"hostname": "xenial", | ||
"headless": "false", | ||
"disk_size": "81920" | ||
} | ||
} |