Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[freebsd-*] Improve DRYness, correctness, & speed of FreeBSD templates. #403

Merged
merged 1 commit into from
Jul 12, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
73 changes: 42 additions & 31 deletions freebsd-10.1-amd64.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,19 @@
"mdmfs -s 100m md1 /tmp<enter><wait>",
"mdmfs -s 100m md2 /mnt<enter><wait>",
"dhclient -l /tmp/dhclient.lease.em0 em0<enter><wait>",
"fetch -o /tmp/install.sh http://{{ .HTTPIP }}:{{ .HTTPPort }}/freebsd-10.1/install.sh && chmod +x /tmp/install.sh && /tmp/install.sh {{ .Name }}<enter><wait>"
"fetch -o /tmp/install.sh http://{{ .HTTPIP }}:{{ .HTTPPort }}/{{user `install_path`}} && chmod +x /tmp/install.sh && /tmp/install.sh {{ .Name }}<enter><wait>"
],
"boot_wait": "10s",
"disk_size": 10140,
"guest_additions_path": "VBoxGuestAdditions_{{.Version}}.iso",
"guest_os_type": "FreeBSD_64",
"headless": "{{ user `headless` }}",
"http_directory": "http",
"iso_checksum": "0c3d64ce48c3ef761761d0fea07e1935e296f8c045c249118bc91a7faf053a6b",
"iso_checksum_type": "sha256",
"iso_url": "{{user `mirror`}}/releases/amd64/amd64/ISO-IMAGES/10.1/FreeBSD-10.1-RELEASE-amd64-disc1.iso",
"output_directory": "packer-freebsd-10.1-amd64-virtualbox",
"shutdown_command": "echo 'shutdown -p now' > shutdown.sh; cat 'shutdown.sh' | su -",
"iso_checksum": "{{user `iso_checksum`}}",
"iso_checksum_type": "{{user `iso_checksum_type`}}",
"iso_url": "{{user `mirror`}}/{{user `mirror_directory`}}/{{user `iso_name`}}",
"output_directory": "packer-{{user `template`}}-virtualbox",
"shutdown_command": "su -m root -c 'shutdown -p now'",
"ssh_password": "vagrant",
"ssh_port": 22,
"ssh_username": "vagrant",
Expand Down Expand Up @@ -56,18 +56,18 @@
"mdmfs -s 100m md2 /mnt<enter><wait>",
"dhclient -l /tmp/dhclient.lease.em0 em0<enter><wait>",
"<wait5>",
"fetch -o /tmp/install.sh http://{{ .HTTPIP }}:{{ .HTTPPort }}/freebsd-10.1/install.sh && chmod +x /tmp/install.sh && /tmp/install.sh {{ .Name }}<enter><wait>"
"fetch -o /tmp/install.sh http://{{ .HTTPIP }}:{{ .HTTPPort }}/{{user `install_path`}} && chmod +x /tmp/install.sh && /tmp/install.sh {{ .Name }}<enter><wait>"
],
"boot_wait": "10s",
"disk_size": 10140,
"guest_os_type": "freebsd-64",
"headless": "{{ user `headless` }}",
"http_directory": "http",
"iso_checksum": "0c3d64ce48c3ef761761d0fea07e1935e296f8c045c249118bc91a7faf053a6b",
"iso_checksum_type": "sha256",
"iso_url": "{{user `mirror`}}/releases/amd64/amd64/ISO-IMAGES/10.1/FreeBSD-10.1-RELEASE-amd64-disc1.iso",
"output_directory": "packer-freebsd-10.1-amd64-vmware",
"shutdown_command": "echo 'shutdown -p now' > shutdown.sh; cat 'shutdown.sh' | su -",
"iso_checksum": "{{user `iso_checksum`}}",
"iso_checksum_type": "{{user `iso_checksum_type`}}",
"iso_url": "{{user `mirror`}}/{{user `mirror_directory`}}/{{user `iso_name`}}",
"output_directory": "packer-{{user `template`}}-vmare",
"shutdown_command": "su -m root -c 'shutdown -p now'",
"ssh_password": "vagrant",
"ssh_port": 22,
"ssh_username": "vagrant",
Expand All @@ -91,17 +91,17 @@
"mdmfs -s 100m md1 /tmp<enter><wait>",
"mdmfs -s 100m md2 /mnt<enter><wait>",
"dhclient -l /tmp/dhclient.lease.em0 em0<enter><wait>",
"fetch -o /tmp/install.sh http://{{ .HTTPIP }}:{{ .HTTPPort }}/freebsd-10.1/install.sh && chmod +x /tmp/install.sh && /tmp/install.sh {{ .Name }}<enter><wait>"
"fetch -o /tmp/install.sh http://{{ .HTTPIP }}:{{ .HTTPPort }}/{{user `install_path`}} && chmod +x /tmp/install.sh && /tmp/install.sh {{ .Name }}<enter><wait>"
],
"boot_wait": "10s",
"boot_wait": "8s",
"disk_size": 10140,
"guest_os_type": "freebsd",
"headless": "{{ user `headless` }}",
"http_directory": "http",
"iso_checksum": "0c3d64ce48c3ef761761d0fea07e1935e296f8c045c249118bc91a7faf053a6b",
"iso_checksum_type": "sha256",
"iso_url": "{{user `mirror`}}/releases/amd64/amd64/ISO-IMAGES/10.1/FreeBSD-10.1-RELEASE-amd64-disc1.iso",
"output_directory": "packer-freebsd-10.1-amd64-parallels",
"iso_checksum": "{{user `iso_checksum`}}",
"iso_checksum_type": "{{user `iso_checksum_type`}}",
"iso_url": "{{user `mirror`}}/{{user `mirror_directory`}}/{{user `iso_name`}}",
"output_directory": "packer-{{user `template`}}-parallels",
"parallels_tools_mode": "disable",
"prlctl": [
[
Expand Down Expand Up @@ -138,7 +138,7 @@
]
],
"prlctl_version_file": ".prlctl_version",
"shutdown_command": "echo 'shutdown -p now' > shutdown.sh; cat 'shutdown.sh' | su -",
"shutdown_command": "su -m root -c 'shutdown -p now'",
"ssh_password": "vagrant",
"ssh_port": 22,
"ssh_username": "vagrant",
Expand All @@ -150,12 +150,8 @@
"post-processors": [
{
"output": "builds/{{user `box_basename`}}.{{.Provider}}.box",
"override": {
"parallels": {
"vagrantfile_template": "vagrantfile_templates/parallels/freebsd.rb"
}
},
"type": "vagrant"
"type": "vagrant",
"vagrantfile_template": "vagrantfile_templates/freebsd.rb"
}
],
"provisioners": [
Expand All @@ -165,29 +161,44 @@
"type": "file"
},
{
"environment_vars": [],
"execute_command": "export {{.Vars}} && cat {{.Path}} | su -m",
"environment_vars": [
"HOME_DIR=/home/vagrant",
"http_proxy={{user `http_proxy`}}",
"https_proxy={{user `https_proxy`}}",
"no_proxy={{user `no_proxy`}}"
],
"execute_command": "{{.Vars}} su -m root -c 'sh -eux {{.Path}}'",
"scripts": [
"scripts/common/metadata.sh",
"scripts/freebsd/update.sh",
"scripts/freebsd/postinstall.sh",
"scripts/freebsd/cleanup.sh",
"scripts/freebsd/sudoers.sh",
"scripts/common/vagrant.sh",
"scripts/freebsd/vmtools.sh",
"scripts/freebsd/cleanup.sh",
"scripts/freebsd/minimize.sh"
],
"type": "shell"
}
],
"variables": {
"arch": "64",
"box_basename": "freebsd-10.1",
"box_basename": "__unset_box_basename__",
"build_timestamp": "{{isotime \"20060102150405\"}}",
"git_revision": "__unknown_git_revision__",
"headless": "",
"http_proxy": "{{env `http_proxy`}}",
"https_proxy": "{{env `https_proxy`}}",
"install_path": "freebsd-10.1/install.sh",
"iso_checksum": "0c3d64ce48c3ef761761d0fea07e1935e296f8c045c249118bc91a7faf053a6b",
"iso_checksum_type": "sha256",
"iso_name": "FreeBSD-10.1-RELEASE-amd64-disc1.iso",
"metadata": "floppy/dummy_metadata.json",
"mirror": "http://ftp.freebsd.org/pub/FreeBSD",
"mirror_directory": "releases/amd64/amd64/ISO-IMAGES/10.1",
"name": "freebsd-10.1",
"no_proxy": "{{env `no_proxy`}}",
"template": "freebsd-10.1-amd64",
"version": "2.0.TIMESTAMP"
"version": "2.1.TIMESTAMP"
}
}

73 changes: 42 additions & 31 deletions freebsd-10.1-i386.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,19 @@
"mdmfs -s 100m md1 /tmp<enter><wait>",
"mdmfs -s 100m md2 /mnt<enter><wait>",
"dhclient -l /tmp/dhclient.lease.em0 em0<enter><wait>",
"fetch -o /tmp/install.sh http://{{ .HTTPIP }}:{{ .HTTPPort }}/freebsd-10.1/install.sh && chmod +x /tmp/install.sh && /tmp/install.sh {{ .Name }}<enter><wait>"
"fetch -o /tmp/install.sh http://{{ .HTTPIP }}:{{ .HTTPPort }}/{{user `install_path`}} && chmod +x /tmp/install.sh && /tmp/install.sh {{ .Name }}<enter><wait>"
],
"boot_wait": "10s",
"disk_size": 10140,
"guest_additions_path": "VBoxGuestAdditions_{{.Version}}.iso",
"guest_os_type": "FreeBSD",
"headless": "{{ user `headless` }}",
"http_directory": "http",
"iso_checksum": "fe31790b762b01c99791d33e7fd9ab97323654785ce21f588116c8b4eb381cd0",
"iso_checksum_type": "sha256",
"iso_url": "{{user `mirror`}}/releases/i386/i386/ISO-IMAGES/10.1/FreeBSD-10.1-RELEASE-i386-disc1.iso",
"output_directory": "packer-freebsd-10.1-i386-virtualbox",
"shutdown_command": "echo 'shutdown -p now' > shutdown.sh; cat 'shutdown.sh' | su -",
"iso_checksum": "{{user `iso_checksum`}}",
"iso_checksum_type": "{{user `iso_checksum_type`}}",
"iso_url": "{{user `mirror`}}/{{user `mirror_directory`}}/{{user `iso_name`}}",
"output_directory": "packer-{{user `template`}}-virtualbox",
"shutdown_command": "su -m root -c 'shutdown -p now'",
"ssh_password": "vagrant",
"ssh_port": 22,
"ssh_username": "vagrant",
Expand Down Expand Up @@ -56,18 +56,18 @@
"mdmfs -s 100m md2 /mnt<enter><wait>",
"dhclient -l /tmp/dhclient.lease.em0 em0<enter><wait>",
"<wait5>",
"fetch -o /tmp/install.sh http://{{ .HTTPIP }}:{{ .HTTPPort }}/freebsd-10.1/install.sh && chmod +x /tmp/install.sh && /tmp/install.sh {{ .Name }}<enter><wait>"
"fetch -o /tmp/install.sh http://{{ .HTTPIP }}:{{ .HTTPPort }}/{{user `install_path`}} && chmod +x /tmp/install.sh && /tmp/install.sh {{ .Name }}<enter><wait>"
],
"boot_wait": "10s",
"disk_size": 10140,
"guest_os_type": "freebsd",
"headless": "{{ user `headless` }}",
"http_directory": "http",
"iso_checksum": "fe31790b762b01c99791d33e7fd9ab97323654785ce21f588116c8b4eb381cd0",
"iso_checksum_type": "sha256",
"iso_url": "{{user `mirror`}}/releases/i386/i386/ISO-IMAGES/10.1/FreeBSD-10.1-RELEASE-i386-disc1.iso",
"output_directory": "packer-freebsd-10.1-i386-vmware",
"shutdown_command": "echo 'shutdown -p now' > shutdown.sh; cat 'shutdown.sh' | su -",
"iso_checksum": "{{user `iso_checksum`}}",
"iso_checksum_type": "{{user `iso_checksum_type`}}",
"iso_url": "{{user `mirror`}}/{{user `mirror_directory`}}/{{user `iso_name`}}",
"output_directory": "packer-{{user `template`}}-vmare",
"shutdown_command": "su -m root -c 'shutdown -p now'",
"ssh_password": "vagrant",
"ssh_port": 22,
"ssh_username": "vagrant",
Expand All @@ -91,17 +91,17 @@
"mdmfs -s 100m md1 /tmp<enter><wait>",
"mdmfs -s 100m md2 /mnt<enter><wait>",
"dhclient -l /tmp/dhclient.lease.em0 em0<enter><wait>",
"fetch -o /tmp/install.sh http://{{ .HTTPIP }}:{{ .HTTPPort }}/freebsd-10.1/install.sh && chmod +x /tmp/install.sh && /tmp/install.sh {{ .Name }}<enter><wait>"
"fetch -o /tmp/install.sh http://{{ .HTTPIP }}:{{ .HTTPPort }}/{{user `install_path`}} && chmod +x /tmp/install.sh && /tmp/install.sh {{ .Name }}<enter><wait>"
],
"boot_wait": "10s",
"boot_wait": "8s",
"disk_size": 10140,
"guest_os_type": "freebsd",
"headless": "{{ user `headless` }}",
"http_directory": "http",
"iso_checksum": "fe31790b762b01c99791d33e7fd9ab97323654785ce21f588116c8b4eb381cd0",
"iso_checksum_type": "sha256",
"iso_url": "{{user `mirror`}}/releases/i386/i386/ISO-IMAGES/10.1/FreeBSD-10.1-RELEASE-i386-disc1.iso",
"output_directory": "packer-freebsd-10.1-i386-parallels",
"iso_checksum": "{{user `iso_checksum`}}",
"iso_checksum_type": "{{user `iso_checksum_type`}}",
"iso_url": "{{user `mirror`}}/{{user `mirror_directory`}}/{{user `iso_name`}}",
"output_directory": "packer-{{user `template`}}-parallels",
"parallels_tools_mode": "disable",
"prlctl": [
[
Expand Down Expand Up @@ -138,7 +138,7 @@
]
],
"prlctl_version_file": ".prlctl_version",
"shutdown_command": "echo 'shutdown -p now' > shutdown.sh; cat 'shutdown.sh' | su -",
"shutdown_command": "su -m root -c 'shutdown -p now'",
"ssh_password": "vagrant",
"ssh_port": 22,
"ssh_username": "vagrant",
Expand All @@ -150,12 +150,8 @@
"post-processors": [
{
"output": "builds/{{user `box_basename`}}.{{.Provider}}.box",
"override": {
"parallels": {
"vagrantfile_template": "vagrantfile_templates/parallels/freebsd.rb"
}
},
"type": "vagrant"
"type": "vagrant",
"vagrantfile_template": "vagrantfile_templates/freebsd.rb"
}
],
"provisioners": [
Expand All @@ -165,29 +161,44 @@
"type": "file"
},
{
"environment_vars": [],
"execute_command": "export {{.Vars}} && cat {{.Path}} | su -m",
"environment_vars": [
"HOME_DIR=/home/vagrant",
"http_proxy={{user `http_proxy`}}",
"https_proxy={{user `https_proxy`}}",
"no_proxy={{user `no_proxy`}}"
],
"execute_command": "{{.Vars}} su -m root -c 'sh -eux {{.Path}}'",
"scripts": [
"scripts/common/metadata.sh",
"scripts/freebsd/update.sh",
"scripts/freebsd/postinstall.sh",
"scripts/freebsd/cleanup.sh",
"scripts/freebsd/sudoers.sh",
"scripts/common/vagrant.sh",
"scripts/freebsd/vmtools.sh",
"scripts/freebsd/cleanup.sh",
"scripts/freebsd/minimize.sh"
],
"type": "shell"
}
],
"variables": {
"arch": "32",
"box_basename": "freebsd-10.1-i386",
"box_basename": "__unset_box_basename__",
"build_timestamp": "{{isotime \"20060102150405\"}}",
"git_revision": "__unknown_git_revision__",
"headless": "",
"http_proxy": "{{env `http_proxy`}}",
"https_proxy": "{{env `https_proxy`}}",
"install_path": "freebsd-10.1/install.sh",
"iso_checksum": "fe31790b762b01c99791d33e7fd9ab97323654785ce21f588116c8b4eb381cd0",
"iso_checksum_type": "sha256",
"iso_name": "FreeBSD-10.1-RELEASE-i386-disc1.iso",
"metadata": "floppy/dummy_metadata.json",
"mirror": "http://ftp.freebsd.org/pub/FreeBSD",
"mirror_directory": "releases/i386/i386/ISO-IMAGES/10.1",
"name": "freebsd-10.1-i386",
"no_proxy": "{{env `no_proxy`}}",
"template": "freebsd-10.1-i386",
"version": "2.0.TIMESTAMP"
"version": "2.1.TIMESTAMP"
}
}

Loading