Skip to content

Commit

Permalink
Merge pull request #63 from StefanScherer/packer-fix
Browse files Browse the repository at this point in the history
Run packer fix to reformat all templates
  • Loading branch information
StefanScherer committed Dec 9, 2017
2 parents 73e4a9d + 8f416c7 commit 304705d
Show file tree
Hide file tree
Showing 22 changed files with 1,251 additions and 1,178 deletions.
7 changes: 7 additions & 0 deletions fix.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash

for template in $(ls -1 *.json); do
echo $template
packer fix $template >/tmp/$$.json
mv /tmp/$$.json $template
done
145 changes: 73 additions & 72 deletions windows_10.json
Original file line number Diff line number Diff line change
@@ -1,21 +1,9 @@
{
"builders": [
{
"type": "hyperv-iso",
"vm_name":"windows_10",
"iso_url": "{{user `iso_url`}}",
"iso_checksum_type": "{{user `iso_checksum_type`}}",
"iso_checksum": "{{user `iso_checksum`}}",
"boot_wait": "6m",
"communicator":"winrm",
"winrm_username": "vagrant",
"winrm_password": "vagrant",
"winrm_timeout" : "{{user `winrm_timeout`}}",
"ram_size": "2048",
"communicator": "winrm",
"cpu": "2",
"switch_name": "{{user `switch_name`}}",
"guest_additions_mode": "none",
"shutdown_command": "shutdown /s /t 10 /f /d p:4:1 /c \"Packer Shutdown\"",
"disk_size": "{{user `disk_size`}}",
"floppy_files": [
"{{user `autounattend`}}",
Expand All @@ -27,28 +15,26 @@
"./scripts/enable-winrm.ps1",
"./scripts/microsoft-updates.bat",
"./scripts/win-updates.ps1"
]
],
"guest_additions_mode": "none",
"iso_checksum": "{{user `iso_checksum`}}",
"iso_checksum_type": "{{user `iso_checksum_type`}}",
"iso_url": "{{user `iso_url`}}",
"ram_size": "2048",
"shutdown_command": "shutdown /s /t 10 /f /d p:4:1 /c \"Packer Shutdown\"",
"switch_name": "{{user `switch_name`}}",
"type": "hyperv-iso",
"vm_name": "windows_10",
"winrm_password": "vagrant",
"winrm_timeout": "{{user `winrm_timeout`}}",
"winrm_username": "vagrant"
},
{
"type": "vmware-iso",
"vm_name":"windows_10",
"communicator": "winrm",
"iso_url": "{{user `iso_url`}}",
"iso_checksum_type": "{{user `iso_checksum_type`}}",
"iso_checksum": "{{user `iso_checksum`}}",
"headless": "{{user `headless`}}",
"boot_wait": "6m",
"boot_command": "",
"winrm_username": "vagrant",
"winrm_password": "vagrant",
"winrm_timeout" : "{{user `winrm_timeout`}}",
"shutdown_command": "shutdown /s /t 10 /f /d p:4:1 /c \"Packer Shutdown\"",
"guest_os_type": "windows9-64",
"boot_wait": "6m",
"communicator": "winrm",
"disk_size": "{{user `disk_size`}}",
"disk_type_id": "{{user `disk_type_id`}}",
"vnc_port_min": 5900,
"vnc_port_max": 5980,
"version": 11,
"floppy_files": [
"{{user `autounattend`}}",
"./floppy/WindowsPowershell.lnk",
Expand All @@ -60,31 +46,33 @@
"./scripts/microsoft-updates.bat",
"./scripts/win-updates.ps1"
],
"vmx_remove_ethernet_interfaces": true,
"guest_os_type": "windows9-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\"",
"type": "vmware-iso",
"version": 11,
"vm_name": "windows_10",
"vmx_data": {
"RemoteDisplay.vnc.enabled": "false",
"RemoteDisplay.vnc.port": "5900",
"memsize": "2048",
"numvcpus": "2",
"scsi0.virtualDev": "lsisas1068"
}
},
"vmx_remove_ethernet_interfaces": true,
"vnc_port_max": 5980,
"vnc_port_min": 5900,
"winrm_password": "vagrant",
"winrm_timeout": "{{user `winrm_timeout`}}",
"winrm_username": "vagrant"
},
{
"type": "virtualbox-iso",
"vm_name":"windows_10",
"communicator": "winrm",
"iso_url": "{{user `iso_url`}}",
"iso_checksum_type": "{{user `iso_checksum_type`}}",
"iso_checksum": "{{user `iso_checksum`}}",
"headless": "{{user `headless`}}",
"boot_wait": "6m",
"boot_command": "",
"winrm_username": "vagrant",
"winrm_password": "vagrant",
"winrm_timeout" : "{{user `winrm_timeout`}}",
"shutdown_command": "shutdown /s /t 10 /f /d p:4:1 /c \"Packer Shutdown\"",
"guest_os_type": "Windows10_64",
"guest_additions_mode": "disable",
"boot_wait": "6m",
"communicator": "winrm",
"disk_size": "{{user `disk_size`}}",
"floppy_files": [
"{{user `autounattend`}}",
Expand All @@ -97,6 +85,14 @@
"./scripts/microsoft-updates.bat",
"./scripts/win-updates.ps1"
],
"guest_additions_mode": "disable",
"guest_os_type": "Windows10_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\"",
"type": "virtualbox-iso",
"vboxmanage": [
[
"modifyvm",
Expand All @@ -110,67 +106,72 @@
"--cpus",
"2"
]
]
],
"vm_name": "windows_10",
"winrm_password": "vagrant",
"winrm_timeout": "{{user `winrm_timeout`}}",
"winrm_username": "vagrant"
}
],
"post-processors": [
{
"keep_input_artifact": false,
"output": "windows_10_{{.Provider}}.box",
"type": "vagrant",
"vagrantfile_template": "vagrantfile-windows_10.template"
}
],
"provisioners": [
{
"type": "windows-shell",
"remote_path": "/tmp/script.bat",
"execute_command": "{{ .Vars }} cmd /c \"{{ .Path }}\"",
"remote_path": "/tmp/script.bat",
"scripts": [
"./scripts/vm-guest-tools.bat",
"./scripts/enable-rdp.bat"
]
],
"type": "windows-shell"
},
{
"type": "powershell",
"scripts": [
"./scripts/debloat-windows.ps1"
]
],
"type": "powershell"
},
{
"type": "windows-restart",
"restart_timeout": "{{user `restart_timeout`}}"
"restart_timeout": "{{user `restart_timeout`}}",
"type": "windows-restart"
},
{
"type": "powershell",
"scripts": [
"./scripts/set-powerplan.ps1",
"./scripts/docker/disable-windows-defender.ps1"
]
],
"type": "powershell"
},
{
"type": "windows-shell",
"remote_path": "/tmp/script.bat",
"execute_command": "{{ .Vars }} cmd /c \"{{ .Path }}\"",
"remote_path": "/tmp/script.bat",
"scripts": [
"./scripts/pin-powershell.bat",
"./scripts/set-winrm-automatic.bat",
"./scripts/uac-enable.bat",
"./scripts/dis-updates.bat",
"./scripts/compact.bat"
]
}
],
"post-processors": [
{
"type": "vagrant",
"keep_input_artifact": false,
"output": "windows_10_{{.Provider}}.box",
"vagrantfile_template": "vagrantfile-windows_10.template"
],
"type": "windows-shell"
}
],
"variables": {
"headless": "false",
"autounattend": "./answer_files/10/Autounattend.xml",
"disk_size": "61440",
"disk_type_id": "1",
"vhv_enable": "false",
"iso_url": "http://care.dlservice.microsoft.com/dl/download/6/5/D/65D18931-F626-4A35-AD5B-F5DA41FE6B76/16299.15.170928-1534.rs3_release_CLIENTENTERPRISEEVAL_OEMRET_x64FRE_en-us.iso",
"iso_checksum_type": "sha256",
"headless": "false",
"iso_checksum": "3d39dd9bd37db5b3c80801ae44003802a9c770a7400a1b33027ca474a1a7c691",
"autounattend": "./answer_files/10/Autounattend.xml",
"iso_checksum_type": "sha256",
"iso_url": "http://care.dlservice.microsoft.com/dl/download/6/5/D/65D18931-F626-4A35-AD5B-F5DA41FE6B76/16299.15.170928-1534.rs3_release_CLIENTENTERPRISEEVAL_OEMRET_x64FRE_en-us.iso",
"restart_timeout": "5m",
"vhv_enable": "false",
"winrm_timeout": "6h"
}
}

53 changes: 27 additions & 26 deletions windows_10_docker.json
Original file line number Diff line number Diff line change
@@ -1,41 +1,48 @@
{
"builders": [
{
"type": "vmware-vmx",
"vm_name": "windows_10_docker",
"boot_command": "",
"boot_wait": "5s",
"communicator": "winrm",
"source_path": "{{user `source_path`}}",
"headless": false,
"boot_wait": "5s",
"boot_command": "",
"winrm_username": "vagrant",
"winrm_password": "vagrant",
"winrm_timeout": "15m",
"shutdown_command": "shutdown /s /t 10 /f /d p:4:1 /c \"Packer Shutdown\"",
"vnc_port_min": 5900,
"vnc_port_max": 5980,
"vmx_remove_ethernet_interfaces": true,
"source_path": "{{user `source_path`}}",
"type": "vmware-vmx",
"vm_name": "windows_10_docker",
"vmx_data": {
"RemoteDisplay.vnc.enabled": "false",
"RemoteDisplay.vnc.port": "5900",
"memsize": "2048",
"numvcpus": "2",
"scsi0.virtualDev": "lsisas1068"
}
},
"vmx_remove_ethernet_interfaces": true,
"vnc_port_max": 5980,
"vnc_port_min": 5900,
"winrm_password": "vagrant",
"winrm_timeout": "15m",
"winrm_username": "vagrant"
}
],
"post-processors": [
{
"keep_input_artifact": false,
"output": "windows_10_docker_{{.Provider}}.box",
"type": "vagrant",
"vagrantfile_template": "vagrantfile-windows_10.template"
}
],
"provisioners": [
{
"type": "powershell",
"scripts": [
"./scripts/docker/10/install-containers-feature.ps1"
]
],
"type": "powershell"
},
{
"type": "windows-restart"
},
{
"type": "powershell",
"scripts": [
"./scripts/docker/add-docker-group.ps1",
"./scripts/docker/10/install-docker.ps1",
Expand All @@ -44,26 +51,20 @@
"./scripts/docker/open-docker-swarm-ports.ps1",
"./scripts/docker/remove-docker-key-json.ps1",
"./scripts/docker/disable-windows-defender.ps1"
]
],
"type": "powershell"
},
{
"type": "windows-shell",
"scripts": [
"./scripts/uac-enable.bat",
"./scripts/set-winrm-automatic.bat",
"./scripts/compact.bat"
]
}
],
"post-processors": [
{
"type": "vagrant",
"keep_input_artifact": false,
"output": "windows_10_docker_{{.Provider}}.box",
"vagrantfile_template": "vagrantfile-windows_10.template"
],
"type": "windows-shell"
}
],
"variables": {
"source_path": "path-to.vmx"
}
}

Loading

0 comments on commit 304705d

Please sign in to comment.