Skip to content

Commit

Permalink
Merge pull request StefanScherer#129 from LM3CORP/my
Browse files Browse the repository at this point in the history
add windows 2016 core image and remove vm guest tool installation
  • Loading branch information
StefanScherer authored Sep 18, 2018
2 parents bfa60db + 65ab64f commit 26f295d
Show file tree
Hide file tree
Showing 3 changed files with 105 additions and 2 deletions.
1 change: 1 addition & 0 deletions README-ami.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ the amazon import service https://docs.aws.amazon.com/vm-import/latest/userguide
* Packer 1.2.3+. https://www.packer.io/downloads.html
* S3 Bucket with the necessary permissions. Set the `AWS_S3_BUCKET` environment variable.
* If you use SAML authentication make sure you set `profile` in the amazon-import post-processor.
* `vm-guest-tools` provisioner is removed.
4 changes: 2 additions & 2 deletions windows_2016_ami.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,20 +56,20 @@
"access_key": "",
"secret_key": "",
"region": "",
"ami_name": "packer_windows_2016",
"s3_bucket_name": "{{user `aws_s3_bucket_name`}}",
"keep_input_artifact": false,
"license_type": "BYOL",
"tags":
{
"Description": "packer-windows amazon-import {{timestamp}}"
"Description": "packer-windows 2016 amazon-import {{timestamp}}"
}
}
],
"provisioners": [
{
"execute_command": "{{ .Vars }} cmd /c \"{{ .Path }}\"",
"scripts": [
"./scripts/vm-guest-tools.bat",
"./scripts/enable-rdp.bat"
],
"type": "windows-shell"
Expand Down
102 changes: 102 additions & 0 deletions windows_2016_core_ami.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
{
"builders": [
{
"boot_wait": "2m",
"communicator": "winrm",
"disk_size": "{{user `disk_size`}}",
"floppy_files": [
"{{user `autounattend`}}",
"./scripts/disable-screensaver.ps1",
"./scripts/disable-winrm.ps1",
"./scripts/enable-winrm.ps1",
"./scripts/microsoft-updates.bat",
"./scripts/win-updates.ps1"
],
"guest_additions_mode": "disable",
"guest_os_type": "Windows2016_64",
"headless": "{{user `headless`}}",
"iso_checksum": "{{user `iso_checksum`}}",
"iso_checksum_type": "{{user `iso_checksum_type`}}",
"iso_url": "{{user `iso_url`}}",
"shutdown_command": "shutdown /s /t 10 /f /d p:4:1 /c \"Packer Shutdown\"",
"format": "ova",
"type": "virtualbox-iso",
"vboxmanage": [
[
"modifyvm",
"{{.Name}}",
"--memory",
"2048"
],
[
"modifyvm",
"{{.Name}}",
"--cpus",
"2"
]
],
"winrm_password": "vagrant",
"winrm_timeout": "{{user `winrm_timeout`}}",
"winrm_username": "vagrant"
}
],
"post-processors": [
{
"keep_input_artifact": false,
"output": "windows_2016_core_{{.Provider}}.box",
"type": "vagrant",
"vagrantfile_template": "vagrantfile-windows_2016_core.template"
},
{
"type": "amazon-import",
"only": ["virtualbox-iso"],
"access_key": "",
"secret_key": "",
"region": "",
"ami_name": "packer_windows_2016_core",
"s3_bucket_name": "{{user `aws_s3_bucket_name`}}",
"keep_input_artifact": false,
"license_type": "BYOL",
"tags":
{
"Description": "packer-windows 2016 core amazon-import {{timestamp}}"
}
}
],
"provisioners": [
{
"scripts": [
"./scripts/enable-rdp.bat"
],
"type": "windows-shell"
},
{
"scripts": [
"./scripts/debloat-windows.ps1"
],
"type": "powershell"
},
{
"scripts": [
"./scripts/set-winrm-automatic.bat",
"./scripts/uac-enable.bat",
"./scripts/compile-dotnet-assemblies.bat",
"./scripts/dis-updates.bat",
"./scripts/compact.bat"
],
"type": "windows-shell"
}
],
"variables": {
"autounattend": "./answer_files/2016_core/Autounattend.xml",
"disk_size": "61440",
"disk_type_id": "1",
"headless": "false",
"iso_checksum": "70721288BBCDFE3239D8F8C0FAE55F1F",
"iso_checksum_type": "md5",
"iso_url": "https://software-download.microsoft.com/download/pr/Windows_Server_2016_Datacenter_EVAL_en-us_14393_refresh.ISO",
"winrm_timeout": "6h",
"aws_s3_bucket_name": "{{env `AWS_S3_BUCKET`}}"
}
}

0 comments on commit 26f295d

Please sign in to comment.