Skip to content

Commit

Permalink
Ubuntu Bionic preparation
Browse files Browse the repository at this point in the history
Packer template for ubuntu-desktop changed to match the server version of the template
  • Loading branch information
ruzickap committed Apr 10, 2018
1 parent 062967e commit c0a0bd3
Show file tree
Hide file tree
Showing 8 changed files with 58 additions and 34 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -164,4 +164,4 @@ NAME=my_windows-10-enterprise-x64-eval WINDOWS_VERSION=10 VIRTIO_WIN_ISO=/var/tm
* `build.sh` - build single image specified on command line
* `build_all.sh` - builds all images
* `build_all_remote_ssh.sh` - connects to remote Ubuntu server, install the necessary packages for building images and execute `build_all.sh`
* `vagrant_init_destroy_boxes.sh` - tests all *.box images in the current directory using `vagrant add/up/ssh/winrm/destroy`
* `vagrant_init_destroy_boxes.sh` - tests all `*.box` images in the current directory using `vagrant add/up/ssh/winrm/destroy`
11 changes: 9 additions & 2 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,12 @@ List of all supported builds:
* windows-10 (libvirt, virtualbox)
* windows-2016 (libvirt, virtualbox)
* windows-2012_r2 (libvirt, virtualbox)
* ubuntu-desktop-18.04 (libvirt)
* ubuntu-desktop-17.10 (libvirt)
* ubuntu-server-18.04 (libvirt)
* ubuntu-server-16.04 (libvirt)
* ubuntu-server-14.04 (libvirt)
* my_ubuntu-server-18.04 (libvirt)
* my_ubuntu-server-16.04 (libvirt)
* my_ubuntu-server-14.04 (libvirt)
* my_centos-7 (libvirt)
Expand All @@ -43,8 +46,12 @@ Build Windows 10 Enterprise Evaluation, Windows Server 2016 Evaluation and Windo
$PROGNAME my_windows-10:libvirt windows-10:libvirt windows-2016:libvirt windows-2012_r2:libvirt
Build Ubuntu Desktop 17.10, Ubuntu Server 16.04, 14.04, My Ubuntu Server 16.04, 14.04 and My CentOS 7 for libvirt:
$PROGNAME ubuntu-desktop-17.10:libvirt ubuntu-server-16.04:libvirt ubuntu-server-14.04:libvirt my_ubuntu-server-16.04:libvirt my_ubuntu-server-14.04:libvirt my_centos-7:libvirt
Build Ubuntu Desktop 18.04, 17.10; Ubuntu Server 18.04, 16.04, 14.04; My Ubuntu Server 18.04, 16.04, 14.04; My CentOS 7 for libvirt:
$PROGNAME \\
ubuntu-desktop-18.04:libvirt ubuntu-desktop-17.10:libvirt \\
ubuntu-server-18.04:libvirt ubuntu-server-16.04:libvirt ubuntu-server-14.04:libvirt \\
my_ubuntu-server-18.04:libvirt my_ubuntu-server-16.04:libvirt my_ubuntu-server-14.04:libvirt \\
my_centos-7:libvirt
EOF
}

Expand Down
2 changes: 1 addition & 1 deletion build_all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ LOGFILE="/tmp/build_all.log"
date

for PACKER_VAGRANT_PROVIDER in libvirt; do
for BUILD in ubuntu-desktop-17.10 ubuntu-server-16.04 ubuntu-server-14.04 my_ubuntu-server-16.04 my_ubuntu-server-14.04 my_centos-7; do
for BUILD in ubuntu-desktop-18.04 ubuntu-desktop-17.10 ubuntu-server-18.04 ubuntu-server-16.04 ubuntu-server-14.04 my_ubuntu-server-18.04 my_ubuntu-server-16.04 my_ubuntu-server-14.04 my_centos-7; do
./build.sh $BUILD:$PACKER_VAGRANT_PROVIDER
done
done
Expand Down
7 changes: 3 additions & 4 deletions build_remote_ssh.sh
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
#!/bin/bash -eux

REMOTE_IP="192.168.121.70"
REMOTE_USER="root"
REMOTE_USER="vagrant"

# Build ALL images (this takes several hours)
ansible-playbook -i "$REMOTE_IP," --user $REMOTE_USER ansible/build_remote_ssh.yml

# Build single image - windows_10:virtualbox
#ansible-playbook -i "$REMOTE_IP," --user $REMOTE_USER --extra-vars 'run_script="./build.sh windows_10:virtualbox"' ansible/build_remote_ssh.yml

# Build multiple images - windows_10 (virtualbox, libvirt) and ubuntu-server-16.04 (libvirt)
#ansible-playbook -i "$REMOTE_IP," --user $REMOTE_USER --extra-vars 'run_script="./build.sh windows_10:virtualbox windows_10:libvirt ubuntu-server-16.04:libvirt"' ansible/build_remote_ssh.yml

# Build multiple images - windows_10 (virtualbox, libvirt) and ubuntu-server-18.04 (libvirt)
#ansible-playbook -i "$REMOTE_IP," --user $REMOTE_USER --extra-vars 'run_script="./build.sh windows_10:virtualbox windows_10:libvirt ubuntu-server-18.04:libvirt"' ansible/build_remote_ssh.yml
7 changes: 5 additions & 2 deletions my_ubuntu-server.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
{
"_comment": ["NAME=my_ubuntu-16.04.4-server-amd64 UBUNTU_VERSION=16.04.4 UBUNTU_TYPE=server UBUNTU_ARCH=amd64 packer build my_ubuntu-server.json"],
"_comment": [
"NAME=my_ubuntu-16.04-server-amd64 UBUNTU_VERSION=16.04.4 UBUNTU_TYPE=server UBUNTU_ARCH=amd64 packer build my_ubuntu-server.json",
"NAME=my_ubuntu-14.04-server-amd64 UBUNTU_VERSION=14.04.5 UBUNTU_TYPE=server UBUNTU_ARCH=amd64 packer build my_ubuntu-server.json"
],
"variables": {
"name": "{{ env `NAME` }}",
"cpus": "2",
Expand Down Expand Up @@ -35,7 +38,7 @@
"boot_wait": "2s",
"boot_command":
[
"<enter><wait><f6><esc><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
"<enter><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>",
Expand Down
21 changes: 15 additions & 6 deletions ubuntu-desktop.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
{
"_comment": ["NAME=ubuntu-17.10-desktop-amd64 UBUNTU_TYPE=desktop packer build ubuntu-desktop.json"],
"_comment_": "I'm using server iso because desktop iso doesn't support preseed: https://askubuntu.com/questions/796145/cant-preseed-ubuntu-desktop-installation",
"_comment": [
"NAME=ubuntu-17.10-desktop-amd64 UBUNTU_VERSION=17.10.1 UBUNTU_TYPE=desktop UBUNTU_ARCH=amd64 packer build ubuntu-desktop.json"
],
"variables": {
"name": "{{ env `NAME` }}",
"cpus": "2",
"memory": "4096",
"iso_name": "ubuntu-{{ env `UBUNTU_VERSION` }}-server-{{ env `UBUNTU_ARCH` }}",
"ubuntu_type": "{{ env `UBUNTU_TYPE` }}",
"iso_checksum": "05db73efd450156d81a519d35bc7b8109101e12d7ee8d49da695778df568cb36",
"ubuntu_version": "{{ env `UBUNTU_VERSION` }}",
"ubuntu_mirror": "http://releases.ubuntu.com/",
"ssh_username": "vagrant",
"ssh_password": "vagrant",
"preseed_file_name": "preseed.cfg",
Expand All @@ -19,8 +24,8 @@
"vm_name": "{{ user `name` }}",
"type": "qemu",
"iso_checksum_type": "sha256",
"iso_checksum": "{{ user `iso_checksum` }}",
"iso_urls": [ "http://archive.ubuntu.com/ubuntu/dists/artful/main/installer-amd64/current/images/netboot/mini.iso" ],
"iso_checksum_url": "{{ user `ubuntu_mirror` }}{{ user `ubuntu_version` }}/SHA256SUMS",
"iso_urls": [ "{{ user `ubuntu_mirror` }}{{ user `ubuntu_version` }}/{{ user `iso_name` }}.iso" ],
"ssh_username": "{{ user `ssh_username` }}",
"ssh_password": "{{ user `ssh_password` }}",
"ssh_wait_timeout": "60m",
Expand All @@ -33,8 +38,12 @@
"boot_wait": "2s",
"boot_command":
[
"<esc>",
"linux initrd=initrd.gz ",
"<enter><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 ",
"url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/ubuntu-{{ user `ubuntu_type` }}/{{ user `preseed_file_name` }} ",
"auto=true ",
"net.ifnames=0 ",
Expand Down
7 changes: 5 additions & 2 deletions ubuntu-server.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
{
"_comment": ["NAME=ubuntu-16.04.4-server-amd64 UBUNTU_VERSION=16.04.4 UBUNTU_TYPE=server UBUNTU_ARCH=amd64 packer build ubuntu-server.json"],
"_comment": [
"NAME=ubuntu-16.04-server-amd64 UBUNTU_VERSION=16.04.4 UBUNTU_TYPE=server UBUNTU_ARCH=amd64 packer build ubuntu-server.json",
"NAME=ubuntu-14.04-server-amd64 UBUNTU_VERSION=14.04.5 UBUNTU_TYPE=server UBUNTU_ARCH=amd64 packer build ubuntu-server.json"
],
"variables": {
"name": "{{ env `NAME` }}",
"cpus": "2",
Expand Down Expand Up @@ -35,7 +38,7 @@
"boot_wait": "2s",
"boot_command":
[
"<enter><wait><f6><esc><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
"<enter><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>",
Expand Down
35 changes: 19 additions & 16 deletions upload_box_to_vagrantup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,25 @@ This script can upload Packer box images to Vagrant Cloud.
You need to define the "VAGRANTUP_ACCESS_TOKEN" variable with proper access token.
Box names:
* my_centos-7-x86_64-libvirt.box
* my_ubuntu-14.04-server-amd64-libvirt.box
* my_ubuntu-16.04-server-amd64-libvirt.box
* ubuntu-14.04-server-amd64-libvirt.box
* ubuntu-16.04-server-amd64-libvirt.box
* ubuntu-17.10-desktop-amd64-libvirt.box
* windows-10-enterprise-x64-eval-libvirt.box
* windows-10-enterprise-x64-eval-virtualbox.box
* my_windows-10-enterprise-x64-eval-libvirt.box
* my_windows-10-enterprise-x64-eval-virtualbox.box
* windows-server-2012-r2-standard-x64-eval-libvirt.box
* windows-server-2012-r2-standard-x64-eval-virtualbox.box
* windows-server-2016-standard-x64-eval-libvirt.box
* windows-server-2016-standard-x64-eval-virtualbox.box
Box names with user:
* peru@my_centos-7-x86_64-libvirt.box
* peru@my_ubuntu-14.04-server-amd64-libvirt.box
* peru@my_ubuntu-16.04-server-amd64-libvirt.box
* peru@my_ubuntu-18.04-server-amd64-libvirt.box
* [email protected]
* [email protected]
* [email protected]
* [email protected]
* [email protected]
* [email protected]
* [email protected]
* peru@my_windows-10-enterprise-x64-eval-libvirt.box
* peru@my_windows-10-enterprise-x64-eval-virtualbox.box
* [email protected]
* [email protected]
* [email protected]
* [email protected]
Examples:
Expand Down

0 comments on commit c0a0bd3

Please sign in to comment.