Skip to content

Templates and scripts to provide Windows and Linux machines with packer and vagrant

Notifications You must be signed in to change notification settings

papanito/packer-vagrant

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Example templates for Vagrant and Packer

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:

Structure

  • images - images for better illustration in the README.txt
  • packerfiles - hcl (variables) for packera
    • iso - os specific variables like iso name and checksum
    • scripts - scripts for provisioning machines with packer
  • scripts - script to be used for provisioning
  • unattended - preseed files for Linux and Autounattend files for Windows
    • windows - autounattended files for Windows
      • 10-ent-n-2016-LTSB - Windows 10 Enterprise Edition N2016 LTSB
      • ...
    • linux - answer files for Linux
      • Ubuntu - Ubuntu specific files
      • ...
  • vagrantfiles
    • @os version@ -

Additional information can be found in the related subfolders

Build

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@
  2. Define additional parameters

    • 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.hcl

Remark: Some characters may break the scripts e.g. using $ will break windows-base.ps1

About

Templates and scripts to provide Windows and Linux machines with packer and vagrant

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published