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
38 changed files
with
612 additions
and
607 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
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 |
---|---|---|
@@ -1,49 +1,50 @@ | ||
# Example templates for Vagrant and Packer | ||
## Example templates for Vagrant and Packer | ||
|
||
## Intro | ||
### Intro | ||
|
||
There are already some existing GitHub projects providing templates to create machines with Packer. However I created this project for learning purposes . In addition to the packer documentation I also took some inspiration from these great projects: | ||
|
||
* https://github.com/kaorimatz/packer-templates | ||
* https://github.com/mwrock/packer-templates | ||
* https://github.com/MattHodge/PackerTemplates | ||
* https://github.com/jacqinthebox/packer-templates | ||
|
||
## Structure | ||
|
||
* [images](https://github.com/papanito/packer-vagrant/tree/master/images) - images for better illustration in the README.txt | ||
* [packerfiles](https://github.com/papanito/packer-vagrant/tree/master/packerfiles) - json and cfg (variables) for packera | ||
* [iso](https://github.com/papanito/packer-vagrant/tree/master/packerfiles/iso) - os specific variables like iso name and checksum | ||
* [scripts](https://github.com/papanito/packer-vagrant/tree/master/packerfiles/scripts) - scripts for provisioning machines with packer | ||
* [scripts](https://github.com/papanito/packer-vagrant/tree/master/scripts) - script to be used for provisioning | ||
* [unattended](https://github.com/papanito/packer-vagrant/tree/master/unattended) - preseed files for Linux and Autounattend files for Windows | ||
* [windows](https://github.com/papanito/packer-vagrant/tree/master/unattended/windows) - autounattended files for Windows | ||
* [kaorimatz: packer-templates](https://github.com/kaorimatz/packer-templates) | ||
* [mwrock: packer-templates](https://github.com/mwrock/packer-templates) | ||
* [MattHodge: PackerTemplates](https://github.com/MattHodge/PackerTemplates) | ||
* [jacqinthebox: packer-templates](https://github.com/jacqinthebox/packer-templates) | ||
* [chef-bento: packer-templates](https://github.com/chef/bento/tree/master/packer_templates) | ||
|
||
### Structure | ||
|
||
* [images](./images) - images for better illustration in the README.txt | ||
* [packerfiles](./packerfiles) - hcl (variables) for packera | ||
* [iso](./packerfiles/iso) - os specific variables like iso name and checksum | ||
* [scripts](./packerfiles/scripts) - scripts for provisioning machines with packer | ||
* [scripts](./scripts) - script to be used for provisioning | ||
* [unattended](./unattended) - preseed files for Linux and Autounattend files for Windows | ||
* [windows](./unattended/windows) - autounattended files for Windows | ||
* 10-ent-n-2016-LTSB - Windows 10 Enterprise Edition N2016 LTSB | ||
* ... | ||
* [linux](https://github.com/papanito/packer-vagrant/tree/master/unattended/linux) - answer files for Linux | ||
* [linux](./unattended/linux) - answer files for Linux | ||
* Ubuntu - Ubuntu specific files | ||
* ... | ||
* [vagrantfiles](https://github.com/papanito/packer-vagrant/tree/master/vagrantfiles) | ||
* [vagrantfiles](./vagrantfiles) | ||
* @os version@ - | ||
|
||
Additional information can be found in the related subfolders | ||
|
||
## Build | ||
### Build | ||
|
||
In order to build VMs with packer you can use the gradle script ```build.gradle``` as follows | ||
In order to build VMs with packer you can use the gradle script `build.gradle` as follows | ||
|
||
1. Add a gradle.properties file and define the following values. The values represent tokens which will be replaced in respective answer and packer files | ||
|
||
* ```username=@username for user account to be created@``` | ||
* ```password=@password for user account 'username'@``` | ||
* ```rootpassword=@password for root/Administrator account@``` | ||
* `username=@username for user account to be created@` | ||
* `password=@password for user account 'username'@` | ||
* `rootpassword=@password for root/Administrator account@` | ||
|
||
2. Define additional parameters | ||
|
||
* ```builders=@packer builders to execute e.g. virtualbox-iso@``` | ||
* `builders=@packer builders to execute e.g. virtualbox-iso@` | ||
|
||
3. Build machines by calling either `gradle buildLinux -PconfigFile=xxx` or `gradle buildWindows -PconfigFile=xxx`. You have to submit a config file (name form `packerfiles/iso` folder) which defines which distro / windows version to build | ||
|
||
```gradle clean buildWindows -PconfigFile=windows_server_2016_standard_x64.cfg``` | ||
`gradle clean buildWindows -PconfigFile=windows_server_2016_standard_x64.hcl` | ||
|
||
**Remark: Some characters may break the scripts e.g. using `$` will break `windows-base.ps1`** |
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
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
This file was deleted.
Oops, something went wrong.
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 @@ | ||
iso_name = "ubuntu-20.04.2.0-desktop-amd64.iso" | ||
iso_checksum = "sha256:93bdab204067321ff131f560879db46bee3b994bf24836bb78538640f689e58f" | ||
iso_mirror" = "http://releases.ubuntu.com/20.04/" |
This file was deleted.
Oops, something went wrong.
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 @@ | ||
iso_name = "ubuntu-20.04.2-live-server-amd64.iso" | ||
iso_checksum = "sha256:d1f2bf834bbe9bb43faf16f9be992a6f3935e65be0edece1dee2aa6eb1767423" | ||
iso_mirror = "http://releases.ubuntu.com/20.04/" |
This file was deleted.
Oops, something went wrong.
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 @@ | ||
iso_name = "ubuntu-21.04-desktop-amd64.iso" | ||
iso_checksum = "sha256:fa95fb748b34d470a7cfa5e3c1c8fa1163e2dc340cd5a60f7ece9dc963ecdf88" | ||
iso_mirror = "http://releases.ubuntu.com/21.04/" |
This file was deleted.
Oops, something went wrong.
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 @@ | ||
iso_name = "ubuntu-21.04-live-server-amd64.iso" | ||
iso_checksum = "sha256:e4089c47104375b59951bad6c7b3ee5d9f6d80bfac4597e43a716bb8f5c1f3b0" | ||
iso_mirror = "http://releases.ubuntu.com/21.04/" |
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,6 @@ | ||
iso_name = "Win10_20H2_v2_German_x64.iso" | ||
iso_checksum = "sha256:EC1BDCEA7CC1CDD5C31D1D73E3E8708A8E117767FC03F7123AE65A418035224E" | ||
license_key = "XXXXX-XXXXX-XXXXX-XXXXX-XXXX" | ||
guest_os_type = "Windows10_64" | ||
winversion = "10-20h2" | ||
output = "win10-20h2-x64-de" |
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,6 @@ | ||
iso_name = "win10_20H2_v2_EnglishInternational_x64.iso" | ||
iso_checksum = "sha256:BD9E41BDF9E23DCF5A0592F3BFE794584C80F1415727ED234E8929F656221836" | ||
license_key = "XXXXX-XXXXX-XXXXX-XXXXX-XXXX" | ||
guest_os_type = "Windows10_64" | ||
winversion = "10-20h2" | ||
output = "win10-20h2-x64" |
This file was deleted.
Oops, something went wrong.
6 changes: 6 additions & 0 deletions
6
packerfiles/iso/windows_10_enterprise_2016_ltsb_en_x64.pkrvars.hcl
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,6 @@ | ||
iso_name = "en_windows_10_enterprise_2016_ltsb_x64_dvd_9059483.iso" | ||
iso_checksum = "sha1:031ED6ACDC47B8F582C781B039F501D83997A1CF" | ||
license_key = "WC2BQ-8NRM3-FDDYY-2BFGV-KHKQY" | ||
guest_os_type = "Windows10_64" | ||
winversion = "10-ent-n-2016-ltsb" | ||
output = "windows-10-enterprise-ltsb-x64" |
This file was deleted.
Oops, something went wrong.
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,7 @@ | ||
iso_name = "en_windows_server_2016_x64_dvd_9327751" | ||
iso_checksum = "sha256:91d7b2ebcff099b3557570af7a8a5cd6" | ||
iso_checksum_type = "md5" | ||
license_key = "WC2BQ-8NRM3-FDDYY-2BFGV-KHKQY", | ||
guest_os_type = "Windows10_64" | ||
winversion = "server-2016-std" | ||
output = "windows-server-2016-standard-x64" |
This file was deleted.
Oops, something went wrong.
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,7 @@ | ||
iso_name = "en_windows_storage_server_2016_x64_dvd_9327790" | ||
iso_checksum = "sha256:" | ||
iso_checksum_type = " | ||
license_key = " | ||
guest_os_type = "Windows10_64" | ||
winversion = "server-2016-storage" | ||
output = "windows-server-2016-storage-x64" |
Oops, something went wrong.