├── .gitignore ├── README.md ├── all.json ├── code-stream └── Packer-Template-Builds.yaml ├── config ├── autounattend.xml ├── centos7.cfg ├── centos8.cfg ├── ubuntu18.cfg ├── ubuntu19.cfg └── ubuntu20 │ ├── meta-data │ └── user-data ├── drivers └── pvscsi-win8 │ ├── pvscsi.cat │ ├── pvscsi.inf │ ├── pvscsi.sys │ └── txtsetup.oem ├── scripts ├── centos_7.sh ├── centos_8.sh ├── centos_update.sh ├── ssh_config.sh ├── ssh_install_autotmm_key.sh ├── ubuntu_18.sh ├── ubuntu_19.sh ├── ubuntu_20.sh ├── ubuntu_template_cleanup.sh ├── ubuntu_update.sh ├── win2016.ps1 ├── win_cloudbaseinit.ps1 └── win_vmtools.cmd ├── ssh └── id_rsa.pub └── variables.json /.gitignore: -------------------------------------------------------------------------------- 1 | packer_cache/ 2 | *.tfstate.backup 3 | *.tfstate 4 | **/.terraform 5 | variables.live.json 6 | **/terraform.plan 7 | terraform/tf.variables.sh 8 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Field Demo Packer Templates 2 | 3 | Check the push.... 4 | -------------------------------------------------------------------------------- /all.json: -------------------------------------------------------------------------------- 1 | { 2 | "builders": [{ 3 | "name": "CentOS7", 4 | "CPUs": "2", 5 | "RAM": "2048", 6 | "RAM_reserve_all": true, 7 | "boot_command": [ 8 | " text ks={{user `http_server`}}/centos7.cfg" 9 | ], 10 | "boot_order": "disk,cdrom", 11 | "cluster": "{{user `vcenter_cluster`}}", 12 | "convert_to_template": "true", 13 | "create_snapshot": "false", 14 | "datastore": "{{user `vcenter_datastore`}}", 15 | "disk_controller_type": "pvscsi", 16 | "folder": "{{user `vcenter_folder`}}", 17 | "guest_os_type": "centos7_64Guest", 18 | "host": "{{user `vcenter_host`}}", 19 | "insecure_connection": "true", 20 | "iso_checksum": "sha256:{{user `centos7_checksum`}}", 21 | "iso_paths": [ 22 | "{{user `centos7_iso`}}" 23 | ], 24 | "network_adapters": [{ 25 | "network": "{{user `vcenter_network`}}", 26 | "network_card": "vmxnet3" 27 | }], 28 | "notes": "Default SSH User: {{user `ssh_username`}}\nDefault SSH Pass: {{user `ssh_password`}}\nBuilt by Packer @ {{isotime \"2006-01-02 03:04\"}}.", 29 | "password": "{{user `vcenter_password`}}", 30 | "remove_cdrom": true, 31 | "shutdown_command": "echo '{{user `ssh_password`}}' | sudo -S -E shutdown -P now", 32 | "ssh_password": "{{user `ssh_password`}}", 33 | "ssh_username": "{{user `ssh_username`}}", 34 | "storage": [{ 35 | "disk_size": "20480", 36 | "disk_thin_provisioned": true 37 | }], 38 | "type": "vsphere-iso", 39 | "username": "{{user `vcenter_username`}}", 40 | "vcenter_server": "{{user `vcenter_server`}}", 41 | "vm_name": "{{user `centos7_vm_name`}}-{{user `buildtime`}}" 42 | }, 43 | { 44 | "name": "CentOS8", 45 | "CPUs": "2", 46 | "RAM": "2048", 47 | "RAM_reserve_all": false, 48 | "boot_command": [ 49 | " text ks={{user `http_server`}}/centos8.cfg" 50 | ], 51 | "boot_order": "disk,cdrom", 52 | "cluster": "{{user `vcenter_cluster`}}", 53 | "convert_to_template": "true", 54 | "create_snapshot": "false", 55 | "datastore": "{{user `vcenter_datastore`}}", 56 | "disk_controller_type": "pvscsi", 57 | "folder": "{{user `vcenter_folder`}}", 58 | "guest_os_type": "centos8_64Guest", 59 | "host": "{{user `vcenter_host`}}", 60 | "insecure_connection": "true", 61 | "iso_checksum": "sha256:{{user `centos8_checksum`}}", 62 | "iso_paths": [ 63 | "{{user `centos8_iso`}}" 64 | ], 65 | "network_adapters": [{ 66 | "network": "{{user `vcenter_network`}}", 67 | "network_card": "vmxnet3" 68 | }], 69 | "notes": "Default SSH User: {{user `ssh_username`}}\nDefault SSH Pass: {{user `ssh_password`}}\nBuilt by Packer @ {{isotime \"2006-01-02 03:04\"}}.", 70 | "password": "{{user `vcenter_password`}}", 71 | "remove_cdrom": "true", 72 | "shutdown_command": "echo '{{user `ssh_password`}}' | sudo -S -E shutdown -P now", 73 | "ssh_password": "{{ user `ssh_password` }}", 74 | "ssh_username": "{{ user `ssh_username` }}", 75 | "storage": [{ 76 | "disk_size": "20480", 77 | "disk_thin_provisioned": true 78 | }], 79 | "type": "vsphere-iso", 80 | "username": "{{user `vcenter_username`}}", 81 | "vcenter_server": "{{user `vcenter_server`}}", 82 | "vm_name": "{{ user `centos8_vm_name` }}-{{user `buildtime`}}" 83 | }, 84 | { 85 | "name": "Ubuntu1804", 86 | "CPUs": "2", 87 | "RAM": "2048", 88 | "RAM_reserve_all": true, 89 | "boot_command": [ 90 | "", 91 | "", 92 | "", 93 | "", 94 | "", 95 | "", 96 | "", 97 | "", 98 | "", 99 | "", 100 | "/install/vmlinuz", 101 | " initrd=/install/initrd.gz", 102 | " priority=critical", 103 | " locale=en_US", 104 | " preseed/url={{user `http_server`}}/ubuntu18.cfg", 105 | "" 106 | ], 107 | "boot_order": "disk,cdrom", 108 | "cluster": "{{user `vcenter_cluster`}}", 109 | "convert_to_template": "true", 110 | "create_snapshot": "false", 111 | "datastore": "{{user `vcenter_datastore`}}", 112 | "disk_controller_type": "pvscsi", 113 | "folder": "{{user `vcenter_folder`}}", 114 | "guest_os_type": "ubuntu64Guest", 115 | "host": "{{user `vcenter_host`}}", 116 | "insecure_connection": "true", 117 | "iso_checksum": "sha256:{{user `ubuntu1804_checksum`}}", 118 | "iso_paths": [ 119 | "{{user `ubuntu1804_iso`}}" 120 | ], 121 | "network_adapters": [{ 122 | "network": "{{user `vcenter_network`}}", 123 | "network_card": "vmxnet3" 124 | }], 125 | "notes": "Default SSH User: {{user `ssh_username`}}\nDefault SSH Pass: {{user `ssh_password`}}\nBuilt by Packer @ {{isotime \"2006-01-02 03:04\"}}.", 126 | "password": "{{user `vcenter_password`}}", 127 | "remove_cdrom": false, 128 | "ssh_password": "{{user `ssh_password`}}", 129 | "ssh_username": "{{user `ssh_username`}}", 130 | "storage": [{ 131 | "disk_size": "20480", 132 | "disk_thin_provisioned": true 133 | }], 134 | "type": "vsphere-iso", 135 | "username": "{{user `vcenter_username`}}", 136 | "vcenter_server": "{{user `vcenter_server`}}", 137 | "vm_name": "{{user `ubuntu1804_vm_name`}}-{{user `buildtime`}}" 138 | }, 139 | { 140 | "name": "Ubuntu1910", 141 | "CPUs": "2", 142 | "RAM": "2048", 143 | "RAM_reserve_all": true, 144 | "boot_command": [ 145 | "", 146 | "", 147 | "", 148 | "/install/vmlinuz", 149 | " initrd=/install/initrd.gz ", 150 | "auto=true ", 151 | "url={{user `http_server`}}/ubuntu19.cfg ", 152 | "fb=false ", 153 | "auto=true ", 154 | "language=en ", 155 | "locale=en_US ", 156 | "priority=critical ", 157 | "keymap=us ", 158 | "netcfg/get_hostname=ubuntu1910 ", 159 | "netcfg/get_domain=vm ", 160 | "debconf/frontend=noninteractive ", 161 | "console-setup/ask_detect=false ", 162 | "console-keymaps-at/keymap=us ", 163 | "" 164 | ], 165 | "boot_order": "disk,cdrom", 166 | "boot_wait": "10s", 167 | "cluster": "{{user `vcenter_cluster`}}", 168 | "convert_to_template": "true", 169 | "create_snapshot": "false", 170 | "datastore": "{{user `vcenter_datastore`}}", 171 | "disk_controller_type": "pvscsi", 172 | "folder": "{{user `vcenter_folder`}}", 173 | "guest_os_type": "ubuntu64Guest", 174 | "host": "{{user `vcenter_host`}}", 175 | "insecure_connection": "true", 176 | "iso_paths": [ 177 | "{{user `ubuntu1910_iso`}}" 178 | ], 179 | "network_adapters": [{ 180 | "network": "{{user `vcenter_network`}}", 181 | "network_card": "vmxnet3" 182 | }], 183 | "notes": "Default SSH User: {{user `ssh_username`}}\nDefault SSH Pass: {{user `ssh_password`}}\nBuilt by Packer @ {{isotime \"2006-01-02 03:04\"}}.", 184 | "password": "{{user `vcenter_password`}}", 185 | "remove_cdrom": true, 186 | "ssh_password": "{{user `ssh_password`}}", 187 | "ssh_username": "{{user `ssh_username`}}", 188 | "storage": [{ 189 | "disk_size": "20480", 190 | "disk_thin_provisioned": true 191 | }], 192 | "type": "vsphere-iso", 193 | "username": "{{user `vcenter_username`}}", 194 | "vcenter_server": "{{user `vcenter_server`}}", 195 | "vm_name": "{{user `ubuntu1910_vm_name`}}-{{user `buildtime`}}" 196 | }, 197 | { 198 | "name": "Ubuntu2004", 199 | "CPUs": "2", 200 | "RAM": "2048", 201 | "RAM_reserve_all": true, 202 | "boot_command": [ 203 | " ", 204 | "autoinstall ds=nocloud-net;s={{user `http_server`}}/ubuntu20/", 205 | "" 206 | ], 207 | "boot_order": "disk,cdrom", 208 | "cluster": "{{user `vcenter_cluster`}}", 209 | "convert_to_template": "true", 210 | "create_snapshot": "false", 211 | "datastore": "{{user `vcenter_datastore`}}", 212 | "disk_controller_type": "pvscsi", 213 | "folder": "{{user `vcenter_folder`}}", 214 | "guest_os_type": "ubuntu64Guest", 215 | "host": "{{user `vcenter_host`}}", 216 | "insecure_connection": "true", 217 | "iso_checksum": "sha256:{{user `ubuntu2004_checksum`}}", 218 | "iso_paths": [ 219 | "{{user `ubuntu2004_iso`}}" 220 | ], 221 | "network_adapters": [{ 222 | "network": "{{user `vcenter_network`}}", 223 | "network_card": "vmxnet3" 224 | }], 225 | "notes": "Default SSH User: {{user `ssh_username`}}\nDefault SSH Pass: {{user `ssh_password`}}\nBuilt by Packer @ {{isotime \"2006-01-02 03:04\"}}.", 226 | "password": "{{user `vcenter_password`}}", 227 | "remove_cdrom": true, 228 | "ssh_handshake_attempts": "20", 229 | "ssh_password": "{{user `ssh_password`}}", 230 | "ssh_username": "{{user `ssh_username`}}", 231 | "storage": [{ 232 | "disk_size": "20480", 233 | "disk_thin_provisioned": true 234 | }], 235 | "type": "vsphere-iso", 236 | "username": "{{user `vcenter_username`}}", 237 | "vcenter_server": "{{user `vcenter_server`}}", 238 | "vm_name": "{{user `ubuntu2004_vm_name`}}-{{user `buildtime`}}" 239 | }, 240 | { 241 | "name": "Windows2016", 242 | "type": "vsphere-iso", 243 | "username": "{{user `vcenter_username`}}", 244 | "vcenter_server": "{{user `vcenter_server`}}", 245 | "password": "{{user `vcenter_password`}}", 246 | "insecure_connection": "true", 247 | "cluster": "{{user `vcenter_cluster`}}", 248 | "network_adapters": [{ 249 | "network": "{{user `vcenter_network`}}" 250 | }], 251 | "datastore": "{{user `vcenter_datastore`}}", 252 | "folder": "{{user `vcenter_folder`}}", 253 | "convert_to_template": "true", 254 | 255 | "communicator": "winrm", 256 | "winrm_username": "{{user `winrm_username`}}", 257 | "winrm_password": "{{user `winrm_password`}}", 258 | "vm_name": "{{ user `windows_2016_vm_name` }}-{{user `buildtime`}}", 259 | "notes": "Default User: {{user `winrm_username`}}\nDefault Pass: {{user `winrm_password`}}\nBuilt by Packer @ {{isotime \"2006-01-02 03:04\"}}.", 260 | "guest_os_type": "windows9Server64Guest", 261 | "CPUs": "2", 262 | "RAM": "4096", 263 | "disk_controller_type": "pvscsi", 264 | "storage": [{ 265 | "disk_size": "61440", 266 | "disk_thin_provisioned": true 267 | }], 268 | "iso_paths": [ 269 | "{{user `windows_2016_iso`}}", 270 | "[] /vmimages/tools-isoimages/windows.iso" 271 | ], 272 | "shutdown_command": "shutdown /s /t 10 /f /d p:4:1 /c Packer_Provisioning_Shutdown", 273 | "floppy_files": [ 274 | "{{ template_dir }}/config/autounattend.xml", 275 | "{{ template_dir }}/drivers/pvscsi-win8/pvscsi.cat", 276 | "{{ template_dir }}/drivers/pvscsi-win8/pvscsi.inf", 277 | "{{ template_dir }}/drivers/pvscsi-win8/pvscsi.sys", 278 | "{{ template_dir }}/drivers/pvscsi-win8/txtsetup.oem", 279 | "{{ template_dir }}/scripts/win_vmtools.cmd", 280 | "{{ template_dir }}/scripts/win2016.ps1" 281 | ], 282 | "remove_cdrom": "true" 283 | } 284 | ], 285 | "provisioners": [{ 286 | "only": [ 287 | "CentOS7", 288 | "CentOS8", 289 | "Ubuntu1804", 290 | "Ubuntu1910", 291 | "Ubuntu2004" 292 | ], 293 | "destination": "/tmp/id_rsa.pub", 294 | "source": "{{ template_dir }}/ssh/id_rsa.pub", 295 | "type": "file" 296 | }, 297 | { 298 | "execute_command": "echo '{{user `ssh_password`}}' | {{ .Vars }} sudo -E -S sh '{{ .Path }}'", 299 | "only": [ 300 | "CentOS7", 301 | "CentOS8" 302 | ], 303 | "scripts": [ 304 | "{{ template_dir }}/scripts/ssh_config.sh", 305 | "{{ template_dir }}/scripts/ssh_install_autotmm_key.sh", 306 | "{{ template_dir }}/scripts/centos_update.sh" 307 | ], 308 | "type": "shell" 309 | }, 310 | { 311 | "only": [ 312 | "Ubuntu1804" 313 | ], 314 | "execute_command": "echo '{{user `ssh_password`}}' | {{ .Vars }} sudo -E -S sh '{{ .Path }}'", 315 | "scripts": [ 316 | "{{ template_dir }}/scripts/ubuntu_update.sh", 317 | "{{ template_dir }}/scripts/ssh_config.sh", 318 | "{{ template_dir }}/scripts/ssh_install_autotmm_key.sh" 319 | ], 320 | "type": "shell" 321 | }, 322 | { 323 | "execute_command": "echo '{{user `ssh_password`}}' | {{ .Vars }} sudo -E -S sh '{{ .Path }}'", 324 | "only": [ 325 | "CentOS7" 326 | ], 327 | "scripts": [ 328 | "{{ template_dir }}/scripts/centos_7.sh" 329 | ], 330 | "type": "shell" 331 | }, 332 | { 333 | "execute_command": "echo '{{user `ssh_password`}}' | {{ .Vars }} sudo -E -S sh '{{ .Path }}'", 334 | "only": [ 335 | "CentOS8" 336 | ], 337 | "scripts": [ 338 | "{{ template_dir }}/scripts/centos_8.sh" 339 | ], 340 | "type": "shell" 341 | }, 342 | { 343 | "execute_command": "echo '{{user `ssh_password`}}' | {{ .Vars }} sudo -E -S sh '{{ .Path }}'", 344 | "only": [ 345 | "Ubuntu1804" 346 | ], 347 | "scripts": [ 348 | "{{ template_dir }}/scripts/ubuntu_18.sh" 349 | ], 350 | "type": "shell" 351 | }, 352 | { 353 | "execute_command": "echo '{{user `ssh_password`}}' | {{ .Vars }} sudo -E -S sh '{{ .Path }}'", 354 | "only": [ 355 | "Ubuntu1804", 356 | "Ubuntu1910", 357 | "Ubuntu2004" 358 | ], 359 | "scripts": [ 360 | "{{ template_dir }}/scripts/ubuntu_template_cleanup.sh" 361 | ], 362 | "type": "shell" 363 | }, 364 | { 365 | "only": [ 366 | "Windows2016" 367 | ], 368 | "type": "powershell", 369 | "scripts": [ 370 | "{{ template_dir }}/scripts/win_cloudbaseinit.ps1" 371 | ] 372 | } 373 | ], 374 | "sensitive-variables": [ 375 | "vcenter_password", 376 | "ssh_password", 377 | "winrm_password" 378 | ] 379 | } -------------------------------------------------------------------------------- /code-stream/Packer-Template-Builds.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | project: Field Demo 3 | kind: PIPELINE 4 | name: Packer-Template-Builds 5 | icon: data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAyAAAAJYCAQAAAAwf0r7AAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAAmJLR0QAAKqNIzIAAAAJcEhZcwAAFUEAABVBAegIY9sAAAAHdElNRQfiAx0LBwlIQyQ5AAAdgElEQVR42u3dabDd9X3f8c9FaEGINQIcDEZIgIQAIYnFCIzANnTGWZpMO23czCSOx574gfug27SPmhk3M+1MJpnkQTvplsapE7vT1E6c2I7HJmZfba6QkITEIondgMxiFgmtfSAu1r3nShz9dM/5/f//83o99Yz5Xkn3vs9/+X3vrMBgnZNv5JP5SMbyevbWHgaYOWO1B6DzzskPsjwH8krGc08ez3ieFRLoAgFh0A4FZMK+PJcH8sM8lnV5OQdqDweUExAGbXJAJuzOk7k76/NoNuantUcESpxYewBG1LxcnsuTvJGNuTOP5ZE8md21hwKOhSsQBm36K5DJDuTlPJx7szUP5/nsqz0y0A8BYdD6CciEvXkm9+VHeSyPZGcO1h4dOBoBYdCOJSAT3snjuSsbsyGb82btLwCYnmcgNNH8rMzKHMzreTR3ZEvWZXverT0UMJkrEAat5Apksv35cX6Y+7M143kh+2t/QcAhAsKgHX9AJuzJjtyX8WzM+rzmCQnUJiAM2swFZMJb2ZI7sznrsyVv1/7yYHR5Bk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jpEb2N1bWVudDo6UGFnZXMAMaf/uy8AAAAZdEVYdFRodW1iOjpJbWFnZTo6SGVpZ2h0ADM1OTnWoXerAAAAGHRFWHRUaHVtYjo6SW1hZ2U6OldpZHRoADI0MDDSiKUNAAAAGXRFWHRUaHVtYjo6TWltZXR5cGUAaW1hZ2UvcG5nP7JWTgAAABd0RVh0VGh1bWI6Ok1UaW1lADE1MTc5MjQyODQsEnI2AAAAE3RFWHRUaHVtYjo6U2l6ZQA3NS44S0JCZMRG3wAAAEx0RVh0VGh1bWI6OlVSSQBmaWxlOi8vL29wdC9wbmdfYmF0Y2hfNC9oYXNoaWNvcnAtcGFja2VyLWxvZ28tcG5nLXRyYW5zcGFyZW50LnBuZxbl/aYAAAAASUVORK5CYII= 6 | enabled: true 7 | concurrency: 1 8 | input: 9 | __build: 'true' 10 | __debug: 'false' 11 | __test: 'true' 12 | Packer-Build-Git-Repository: https://github.com/VMwareCMBUTMM/fielddemo-packer-templates 13 | Packer-Build-Images: CentOS8,Ubuntu1804,Windows2016 14 | Packer-Build-vCenter-Cluster: ClusterName 15 | Packer-Build-vCenter-Datastore: DatastoreName 16 | Packer-Build-vCenter-Folder: FolderName 17 | Packer-Build-vCenter-Network: NetworkName 18 | Packer-Build-vCenter-Server: vCenterFQDN 19 | Packer-Build-vCenter-User: vCenterUser 20 | Packer-Build-vCenter-User-Password: vCenterPassword 21 | Packer-Build-vRA-Password: vRAPassword 22 | Packer-Build-vRA-Project: vRAProject 23 | Packer-Build-vRA-Url: vRAURL 24 | Packer-Build-vRA-Username: vRAUser 25 | Packer-Build-vRA-vSphere-Cloud-Account: vRAvSphereCloudAccount 26 | Packer-Build-SSH-User: SshUserName 27 | Packer-Build-SSH-Password: SshUserPassword 28 | _inputMeta: 29 | Packer-Build-vCenter-Network: 30 | mandatory: true 31 | description: Name of the DHCP enabled vCenter Network on which to build the VMs 32 | __build: 33 | mandatory: true 34 | description: If set to false, the Packer build will be skipped. 35 | Packer-Build-SSH-Password: 36 | mandatory: true 37 | description: SSH Password for the Packer built templates 38 | Packer-Build-vCenter-User: 39 | mandatory: true 40 | description: Name of the vCenter User that Packer will use to build 41 | Packer-Build-vRA-Username: 42 | mandatory: true 43 | description: Name of the vRealize Automation user that Code Stream will use to make API calls (username 44 | for vSphere.local, username@domain.com for AD integrated) 45 | Packer-Build-vCenter-Datastore: 46 | mandatory: true 47 | description: Name of the vCenter Datastore on which to build the VMs 48 | Packer-Build-vRA-Password: 49 | mandatory: true 50 | description: Password of the vRealize Automation user that Code Stream will use to make API calls 51 | Packer-Build-vCenter-Cluster: 52 | mandatory: true 53 | description: Name of the vCenter Cluster on which to build the VMs 54 | Packer-Build-vRA-Project: 55 | mandatory: true 56 | description: Name of the vRealize Automation Project in which the test deployments are performed 57 | __debug: 58 | mandatory: true 59 | description: If set to true, the pipeline will pause at the "debug" tasks 60 | Packer-Build-vRA-Url: 61 | mandatory: true 62 | description: Base URL of the vRealize Automation environment (e.g. https://vra.fqdn) 63 | Packer-Build-Images: 64 | mandatory: true 65 | description: Comma separated list of Packer Builder Image Names (e.g. used with the packer --only 66 | flag) 67 | Packer-Build-Git-Repository: 68 | mandatory: true 69 | description: URL of the Packer Template Repository 70 | Packer-Build-vCenter-Folder: 71 | mandatory: true 72 | description: Name of the vCenter Folder in which to build the VMs 73 | Packer-Build-vRA-vSphere-Cloud-Account: 74 | mandatory: false 75 | description: 'Name of the vSphere ' 76 | Packer-Build-SSH-User: 77 | mandatory: true 78 | description: SSH Username for the Packer built templates 79 | Packer-Build-vCenter-User-Password: 80 | mandatory: true 81 | description: Password of the vCenter User that Packer will use to build 82 | __test: 83 | mandatory: true 84 | description: If false, the test deployment of images will be skipped 85 | Packer-Build-vCenter-Server: 86 | mandatory: true 87 | description: Name of the vCenter Server that Packer will use to build 88 | workspace: 89 | endpoint: smcg-sc2-docker-host - TLS 90 | image: sammcgeown/codestream-ci-packer:latest 91 | registry: '' 92 | path: /build 93 | autoCloneForTrigger: true 94 | limits: 95 | cpu: 1.0 96 | memory: 512 97 | stageOrder: 98 | - Prepare Environment 99 | - Build 100 | - Test 101 | - Release 102 | stages: 103 | Test: 104 | taskOrder: 105 | - Create Image Profile JSON 106 | - Debug 107 | - Create Image Profile,Update Image Profile 108 | - Create Blueprint 109 | - Request Deployment 110 | - Wait For Deployment 111 | - Test Images 112 | - Delete Deployment,Delete Blueprint 113 | tasks: 114 | Request Deployment: 115 | type: REST 116 | preCondition: '"${input.__test}" == "true"' 117 | input: 118 | action: post 119 | url: ${input.Packer-Build-vRA-Url}/blueprint/api/blueprint-requests 120 | headers: 121 | Content-Type: application/json 122 | Authorization: ${Prepare Environment.Get API Token.output.responseHeaders.Authorization} 123 | payload: |- 124 | { 125 | "blueprintId": "${Test.Create Blueprint.output.responseJson.id}" 126 | } 127 | Delete Blueprint: 128 | type: REST 129 | ignoreFailure: true 130 | preCondition: '"${input.__test}" == "true"' 131 | input: 132 | action: delete 133 | url: ${input.Packer-Build-vRA-Url}/blueprint/api/blueprints/${Test.Create Blueprint.output.responseJson.id} 134 | headers: 135 | Content-Type: application/json 136 | Authorization: ${Prepare Environment.Get API Token.output.responseHeaders.Authorization} 137 | payload: '' 138 | Wait For Deployment: 139 | type: POLL 140 | preCondition: '"${input.__test}" == "true"' 141 | input: 142 | url: ${input.Packer-Build-vRA-Url}/blueprint/api/blueprint-requests/${Test.Request Deployment.output.responseJson.id} 143 | pollCount: 60 144 | pollIntervalSeconds: 60 145 | ignoreFailure: true 146 | headers: 147 | Accept: application/json 148 | Content-Type: application/json 149 | Authorization: ${Prepare Environment.Get API Token.output.responseHeaders.Authorization} 150 | exitCriteria: 151 | success: status == 'FINISHED' 152 | failure: status == 'FAILED' 153 | Test Images: 154 | type: UserOperation 155 | preCondition: '"${input.__test}" == "true"' 156 | input: 157 | approvers: 158 | - ${requestBy} 159 | approverGroups: [ 160 | ] 161 | summary: Please test the deployed images 162 | description: '' 163 | sendemail: false 164 | expiration: 3 165 | expirationUnit: DAYS 166 | pipelineName: ${name} 167 | cancelPreviousPendingUserOp: false 168 | Create Image Profile: 169 | type: REST 170 | preCondition: '"${Prepare Environment.Export Object IDs.output.exports.ImageProfileId}" == "null"' 171 | input: 172 | action: post 173 | url: ${input.Packer-Build-vRA-Url}/iaas/api/image-profiles 174 | headers: 175 | Content-Type: application/json 176 | Authorization: ${Prepare Environment.Get API Token.output.responseHeaders.Authorization} 177 | payload: ${Test.Create Image Profile JSON.output.exports.profileJson} 178 | Update Image Profile: 179 | type: REST 180 | preCondition: '"${Prepare Environment.Export Object IDs.output.exports.ImageProfileId}" != "null"' 181 | input: 182 | action: patch 183 | url: ${input.Packer-Build-vRA-Url}/iaas/api/image-profiles/${Prepare Environment.Export Object 184 | IDs.output.exports.ImageProfileId} 185 | headers: 186 | Content-Type: application/json 187 | Authorization: ${Prepare Environment.Get API Token.output.responseHeaders.Authorization} 188 | payload: ${Test.Create Image Profile JSON.output.exports.profileJson} 189 | Create Blueprint: 190 | type: REST 191 | preCondition: '"${input.__test}" == "true"' 192 | input: 193 | action: post 194 | url: ${input.Packer-Build-vRA-Url}/blueprint/api/blueprints 195 | headers: 196 | Content-Type: application/json 197 | Authorization: ${Prepare Environment.Get API Token.output.responseHeaders.Authorization} 198 | payload: ${Test.Create Image Profile JSON.output.exports.blueprintJson} 199 | Create Image Profile JSON: 200 | type: CI 201 | ignoreFailure: true 202 | input: 203 | steps: 204 | - echo '${Build.Get Images.output.responseJson}' > images.json 205 | - '' 206 | - buildImages=${input.Packer-Build-Images} 207 | - buildTime=${Prepare Environment.Configure Environment.output.exports.BUILDTIME} 208 | - regionId=${Prepare Environment.Export Object IDs.output.exports.RegionId} 209 | - projectId=${Prepare Environment.Export Object IDs.output.exports.ProjectId} 210 | - externalRegionId=${Prepare Environment.Export Object IDs.output.exports.ExternalRegionId} 211 | - imageProfileId=${Prepare Environment.Export Object IDs.output.exports.ImageProfileId} 212 | - '' 213 | - '# If there''s an existing image profile, clone it stripping out extra fields, if not, create 214 | one' 215 | - if [ "$imageProfileId" = "null" ]; then 216 | - ' jq -n --arg name vsphere-image-profile ''{"name":$name}'' > newImageProfile.json' 217 | - else 218 | - ' jq --arg externalRegionId $externalRegionId ''.content[] | select(.externalRegionId == 219 | $externalRegionId)'' imageProfiles.json | jq ''del(.. | ._links?, .osFamily?, .externalRegionId?, 220 | .isPrivate?, .externalId?, .updatedAt?, .organizationId?, .orgId?) | del(.id)'' > newImageProfile.json' 221 | - fi 222 | - '# Add in the Region ID' 223 | - echo $(jq --arg regionId $regionId '.regionId = $regionId' newImageProfile.json) > newImageProfile.json 224 | - '' 225 | - '' 226 | - for image in $(echo "$buildImages" | tr ',' ' '); do 227 | - ' templateName=$(echo "packer-$image-$buildTime" | tr ''[:upper:]'' ''[:lower:]'');' 228 | - ' templateId=$(jq -r --arg templateName $templateName ''.content[] | select( .name == $templateName) 229 | | .id'' images.json)' 230 | - ' echo $(jq ".imageMappings.mapping.\"[Packer Test] $image\".name = \"$templateName\"" 231 | newImageProfile.json) > newImageProfile.json ' 232 | - ' echo $(jq ".imageMappings.mapping.\"[Packer Test] $image\".id = \"$templateId\"" newImageProfile.json) 233 | > newImageProfile.json ' 234 | - done 235 | - '' 236 | - imageMapping=$(jq '.imageMappings.mapping' newImageProfile.json) 237 | - echo $(jq --argjson imageMapping "$imageMapping" '.imageMapping = $imageMapping' newImageProfile.json 238 | | jq 'del(.imageMappings)') > newImageProfile.json 239 | - '' 240 | - export profileJson=$(cat newImageProfile.json) 241 | - '' 242 | - '### Create Deployment JSON' 243 | - cat < new-blueprint.yaml 244 | - 'formatVersion: 1' 245 | - 'inputs: {}' 246 | - 'resources:' 247 | - EOF 248 | - '' 249 | - for image in $(echo "$buildImages" | tr ',' ' '); do 250 | - ' cat <> new-blueprint.yaml' 251 | - ' Cloud_Machine_$image:' 252 | - ' type: Cloud.Machine' 253 | - ' properties:' 254 | - ' image: ''[Packer Test] $image''' 255 | - ' flavor: small' 256 | - ' constraints:' 257 | - ' - tag: ''env:vsphere''' 258 | - EOF 259 | - done 260 | - '# Replace new lines with \n' 261 | - blueprintYAML=$(sed -e ':a' -e 'N' -e '$!ba' -e 's/\n/\\n/g' new-blueprint.yaml) 262 | - '' 263 | - cat < new-blueprint.json 264 | - '{ "projectId": "$projectId", "name": "Packer-Test-Blueprint", "description": "Blueprint to 265 | test Packer Image builds", "status": "DRAFT", "content": "$blueprintYAML" }' 266 | - EOF 267 | - '' 268 | - export blueprintJson=$(cat new-blueprint.json) 269 | - '' 270 | - '' 271 | export: 272 | - profileJson 273 | - blueprintJson 274 | artifacts: [ 275 | ] 276 | process: [ 277 | ] 278 | Debug: 279 | type: UserOperation 280 | preCondition: '"${input.__debug}" == "true"' 281 | input: 282 | approvers: 283 | - ${requestBy} 284 | approverGroups: [ 285 | ] 286 | summary: Check values 287 | description: '' 288 | sendemail: false 289 | expiration: 3 290 | expirationUnit: DAYS 291 | pipelineName: ${name} 292 | cancelPreviousPendingUserOp: false 293 | Delete Deployment: 294 | type: REST 295 | preCondition: '"${input.__test}" == "true"' 296 | input: 297 | action: delete 298 | url: ${input.Packer-Build-vRA-Url}/iaas/api/deployments/${Test.Request Deployment.output.responseJson.deploymentId} 299 | headers: 300 | Content-Type: application/json 301 | Authorization: ${Prepare Environment.Get API Token.output.responseHeaders.Authorization} 302 | payload: '' 303 | Build: 304 | taskOrder: 305 | - Build Packer Images 306 | - Trigger Image Enumeration 307 | - Wait For Enumeration 308 | - Get Images 309 | tasks: 310 | Wait For Enumeration: 311 | type: POLL 312 | preCondition: '"${input.__build}" == "true"' 313 | input: 314 | url: ${input.Packer-Build-vRA-Url}/iaas/api/request-tracker/${Build.Trigger Image Enumeration.output.responseBody.id} 315 | pollCount: 5 316 | pollIntervalSeconds: 60 317 | ignoreFailure: true 318 | headers: 319 | Accept: application/json 320 | Content-Type: application/json 321 | Authorization: ${Prepare Environment.Get API Token.output.responseHeaders.Authorization} 322 | exitCriteria: 323 | success: status == 'FINISHED' 324 | failure: status == 'FAILED' 325 | Trigger Image Enumeration: 326 | type: REST 327 | preCondition: '"${input.__build}" == "true"' 328 | input: 329 | action: post 330 | url: ${input.Packer-Build-vRA-Url}/iaas/api/cloud-accounts/${Prepare Environment.Export Object 331 | IDs.output.exports.CloudAccountId}/private-image-enumeration 332 | headers: 333 | Accept: application/json 334 | Authorization: ${Prepare Environment.Get API Token.output.responseHeaders.Authorization} 335 | payload: '' 336 | Build Packer Images: 337 | type: CI 338 | preCondition: '"${input.__build}" == "true"' 339 | input: 340 | steps: 341 | - set +x 342 | - source /build/packer.secrets 343 | - set -x 344 | - '' 345 | - cd /build/templates/ 346 | - '# Validate config' 347 | - packer validate -var-file=variables.json -only=${input.Packer-Build-Images} all.json 348 | - '# Build validated config' 349 | - packer build -force -var-file=variables.json -only=${input.Packer-Build-Images} all.json 350 | export: [ 351 | ] 352 | artifacts: [ 353 | ] 354 | process: [ 355 | ] 356 | Get Images: 357 | type: REST 358 | input: 359 | action: get 360 | url: ${input.Packer-Build-vRA-Url}/iaas/api/fabric-images?$filter=(name eq 'packer-*-${Prepare 361 | Environment.Configure Environment.output.exports.BUILDTIME}') 362 | headers: 363 | Content-Type: application/json 364 | Authorization: ${Prepare Environment.Get API Token.output.responseHeaders.Authorization} 365 | Accept: application/json 366 | payload: '' 367 | Prepare Environment: 368 | taskOrder: 369 | - Configure Environment 370 | - Get API Token 371 | - Get vSphere Cloud Accounts,Get Project,Get Image Profiles 372 | - Export Object IDs 373 | - Debug 374 | tasks: 375 | Export Object IDs: 376 | type: CI 377 | input: 378 | steps: 379 | - echo '${Prepare Environment.Get vSphere Cloud Accounts.output.responseJson}' > vSphereCloudAccounts.json 380 | - echo '${Prepare Environment.Get Project.output.responseJson}' > project.json 381 | - echo '${Prepare Environment.Get Image Profiles.output.responseJson}' > imageProfiles.json 382 | - '' 383 | - export CloudAccountId=$(jq -r '.content[] | select( .hostName == "${input.Packer-Build-vCenter-Server}") 384 | | .id' vSphereCloudAccounts.json) 385 | - export ExternalRegionId=$(jq -r '.content[] | select( .hostName == "${input.Packer-Build-vCenter-Server}") 386 | | .enabledRegionIds[0]' vSphereCloudAccounts.json) 387 | - export RegionId=$(jq -r '.content[] | select( .hostName == "${input.Packer-Build-vCenter-Server}") 388 | | ._links.regions.hrefs[0]' vSphereCloudAccounts.json | sed 's|/iaas/api/regions/||') 389 | - export ProjectId=$(jq -r '.content[0].id' project.json) 390 | - export ImageProfileId=$(jq -r --arg externalRegionId "$ExternalRegionId" '.content[] | select( 391 | .externalRegionId == $externalRegionId) | .id' imageProfiles.json) 392 | - '' 393 | export: 394 | - CloudAccountId 395 | - ProjectId 396 | - RegionId 397 | - ImageProfileId 398 | - ExternalRegionId 399 | artifacts: [ 400 | ] 401 | process: [ 402 | ] 403 | Get vSphere Cloud Accounts: 404 | type: REST 405 | input: 406 | action: get 407 | url: ${input.Packer-Build-vRA-Url}/iaas/api/cloud-accounts-vsphere 408 | headers: 409 | Accept: application/json 410 | Authorization: ${Prepare Environment.Get API Token.output.responseHeaders.Authorization} 411 | payload: '' 412 | Get Project: 413 | type: REST 414 | input: 415 | action: get 416 | url: ${input.Packer-Build-vRA-Url}/iaas/api/projects?$filter=(name eq '${input.Packer-Build-vRA-Project}') 417 | headers: 418 | Accept: application/json 419 | Authorization: ${Prepare Environment.Get API Token.output.responseHeaders.Authorization} 420 | payload: '' 421 | Get API Token: 422 | type: REST 423 | input: 424 | action: post 425 | url: ${input.Packer-Build-vRA-Url}/csp/gateway/am/idp/auth/login?access_token 426 | headers: 427 | Accept: application/json 428 | Content-Type: application/json 429 | payload: |- 430 | { 431 | "username": "${Prepare Environment.Configure Environment.output.exports.vraUser}", 432 | "password": "${input.Packer-Build-vRA-Password}", 433 | "domain": "${Prepare Environment.Configure Environment.output.exports.vraDomain}" 434 | } 435 | Get Image Profiles: 436 | type: REST 437 | input: 438 | action: get 439 | url: ${input.Packer-Build-vRA-Url}/iaas/api/image-profiles 440 | headers: 441 | Accept: application/json 442 | Authorization: ${Prepare Environment.Get API Token.output.responseHeaders.Authorization} 443 | payload: '' 444 | Configure Environment: 445 | type: CI 446 | input: 447 | steps: 448 | - export BUILDTIME="$(date "+%Y%m%d-%H%M%S")" 449 | - '#export BUILDTIME="20201113-094416"' 450 | - '# Create environment variables' 451 | - cat <> /build/packer.secrets 452 | - export VCPASS='${input.Packer-Build-vCenter-User-Password}' 453 | - export VCSERVER="${input.Packer-Build-vCenter-Server}" 454 | - export VCUSER="${input.Packer-Build-vCenter-User}" 455 | - export VCDATASTORE="${input.Packer-Build-vCenter-Datastore}" 456 | - export VCFOLDER="${input.Packer-Build-vCenter-Folder}" 457 | - export VCCLUSTER="${input.Packer-Build-vCenter-Cluster}" 458 | - export VCNETWORK="${input.Packer-Build-vCenter-Network}" 459 | - export SSHUSER="${input.Packer-Build-SSH-User}" 460 | - export SSHPASS="${input.Packer-Build-SSH-Password}" 461 | - export BUILDTIME=$BUILDTIME 462 | - EOF 463 | - '# Split the username for domain authentication' 464 | - IFS="@" read user domain <<< "${input.Packer-Build-vRA-Username}" 465 | - export vraUser=$user 466 | - export vraDomain=$domain 467 | - '# Get templates from git' 468 | - git clone ${input.Packer-Build-Git-Repository} templates 469 | - '' 470 | - '' 471 | - '' 472 | export: 473 | - BUILDTIME 474 | - vraUser 475 | - vraDomain 476 | artifacts: [ 477 | ] 478 | process: [ 479 | ] 480 | Debug: 481 | type: UserOperation 482 | preCondition: '"${input.__debug}" == "true"' 483 | input: 484 | approvers: 485 | - ${requestBy} 486 | approverGroups: [ 487 | ] 488 | summary: Check values 489 | description: '' 490 | sendemail: false 491 | expiration: 3 492 | expirationUnit: DAYS 493 | pipelineName: ${name} 494 | cancelPreviousPendingUserOp: false 495 | Release: 496 | taskOrder: 497 | - Get Image Profile 498 | - Create Image Profile JSON 499 | - Debug 500 | - Update Image Profile 501 | tasks: 502 | Get Image Profile: 503 | type: REST 504 | input: 505 | action: get 506 | url: ${input.Packer-Build-vRA-Url}/iaas/api/image-profiles 507 | headers: 508 | Accept: application/json 509 | Authorization: ${Prepare Environment.Get API Token.output.responseHeaders.Authorization} 510 | payload: '' 511 | Update Image Profile: 512 | type: REST 513 | input: 514 | action: patch 515 | url: ${input.Packer-Build-vRA-Url}/iaas/api/image-profiles/${Release.Create Image Profile JSON.output.exports.imageProfileId} 516 | headers: 517 | Content-Type: application/json 518 | Authorization: ${Prepare Environment.Get API Token.output.responseHeaders.Authorization} 519 | payload: ${Release.Create Image Profile JSON.output.exports.profileJson} 520 | Create Image Profile JSON: 521 | type: CI 522 | input: 523 | steps: 524 | - echo '${Release.Get Image Profile.output.responseJson}' > imageProfiles.json 525 | - '' 526 | - buildImages=${input.Packer-Build-Images} 527 | - buildTime=${Prepare Environment.Configure Environment.output.exports.BUILDTIME} 528 | - regionId=${Prepare Environment.Export Object IDs.output.exports.RegionId} 529 | - projectId=${Prepare Environment.Export Object IDs.output.exports.ProjectId} 530 | - externalRegionId=${Prepare Environment.Export Object IDs.output.exports.ExternalRegionId} 531 | - export imageProfileId=${Prepare Environment.Export Object IDs.output.exports.ImageProfileId} 532 | - '' 533 | - '# If there''s an existing image profile, clone it stripping out extra fields, if not, create 534 | one' 535 | - if [ "$imageProfileId" = "null" ]; then 536 | - ' jq -n --arg name packer-image-profile ''{"name":$name}'' > releaseProfile.json' 537 | - else 538 | - ' jq --arg externalRegionId $externalRegionId ''.content[] | select(.externalRegionId == 539 | $externalRegionId)'' imageProfiles.json | jq ''del(.. | ._links?, .osFamily?, .externalRegionId?, 540 | .isPrivate?, .externalId?, .updatedAt?, .organizationId?, .orgId?) | del(.id)'' > releaseProfile.json' 541 | - fi 542 | - '# Add in the Region ID' 543 | - echo $(jq --arg regionId $regionId '.regionId = $regionId' releaseProfile.json) > releaseProfile.json 544 | - '' 545 | - '' 546 | - for image in $(echo "$buildImages" | tr ',' ' '); do 547 | - ' templateName=$(echo "packer-$image-$buildTime" | tr ''[:upper:]'' ''[:lower:]'');' 548 | - ' templateId=$(jq -r --arg templateName $templateName ''.content[] | select( .name == $templateName) 549 | | .id'' images.json)' 550 | - '' 551 | - ' echo $(jq ".imageMappings.mapping.\"[Packer] $image\".name = \"$templateName\"" releaseProfile.json) 552 | > releaseProfile.json ' 553 | - ' echo $(jq ".imageMappings.mapping.\"[Packer] $image\".id = \"$templateId\"" releaseProfile.json) 554 | > releaseProfile.json ' 555 | - done 556 | - '' 557 | - imageMapping=$(jq '.imageMappings.mapping' releaseProfile.json) 558 | - echo $(jq --argjson imageMapping "$imageMapping" '.imageMapping = $imageMapping' releaseProfile.json 559 | | jq 'del(.imageMappings)') > releaseProfile.json 560 | - '' 561 | - '# Remove the Packer Test image mappings' 562 | - echo $(jq 'delpaths([paths | select(.[-1] | strings | contains("Packer Test"))])' releaseProfile.json) 563 | > releaseProfile.json 564 | - '' 565 | - export profileJson=$(cat releaseProfile.json) 566 | - '' 567 | export: 568 | - profileJson 569 | - imageProfileId 570 | artifacts: [ 571 | ] 572 | process: [ 573 | ] 574 | Debug: 575 | type: UserOperation 576 | preCondition: '"${input.__debug}" == "true"' 577 | input: 578 | approvers: 579 | - ${requestBy} 580 | approverGroups: [ 581 | ] 582 | summary: Check values 583 | description: '' 584 | sendemail: false 585 | expiration: 3 586 | expirationUnit: DAYS 587 | pipelineName: ${name} 588 | cancelPreviousPendingUserOp: false 589 | -------------------------------------------------------------------------------- /config/autounattend.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | A:\ 8 | 9 | 10 | 11 | 12 | 13 | en-US 14 | 15 | en-US 16 | en-US 17 | en-US 18 | en-US 19 | en-US 20 | 21 | 22 | 23 | 24 | 25 | 26 | Primary 27 | 1 28 | 350 29 | 30 | 31 | 2 32 | Primary 33 | true 34 | 35 | 36 | 37 | 38 | true 39 | NTFS 40 | 41 | 1 42 | 1 43 | 44 | 45 | NTFS 46 | 47 | C 48 | 2 49 | 2 50 | 51 | 52 | 0 53 | true 54 | 55 | 56 | 57 | 58 | 59 | 60 | /IMAGE/NAME 61 | Windows Server 2016 SERVERSTANDARD 62 | 63 | 64 | 65 | 0 66 | 2 67 | 68 | 69 | 70 | 71 | 72 | OnError 73 | 74 | true 75 | Technical Marketing 76 | VMware CMBU 77 | 78 | 79 | 80 | 81 | 82 | 83 | false 84 | 85 | Pacific Standard Time 86 | 87 | 88 | 89 | true 90 | 91 | 92 | false 93 | false 94 | 95 | 96 | true 97 | 98 | 99 | true 100 | 101 | 102 | 103 | 104 | 105 | 106 | VMware1! 107 | true</PlainText> 108 | </Password> 109 | <LogonCount>1</LogonCount> 110 | <Enabled>true</Enabled> 111 | <Username>administrator</Username> 112 | </AutoLogon> 113 | <FirstLogonCommands> 114 | <SynchronousCommand wcm:action="add"> 115 | <CommandLine>cmd.exe /c powershell -Command "Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Force"</CommandLine> 116 | <Description>Set Execution Policy 64 Bit</Description> 117 | <Order>1</Order> 118 | <RequiresUserInput>true</RequiresUserInput> 119 | </SynchronousCommand> 120 | <SynchronousCommand wcm:action="add"> 121 | <CommandLine>C:\Windows\SysWOW64\cmd.exe /c powershell -Command "Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Force"</CommandLine> 122 | <Description>Set Execution Policy 32 Bit</Description> 123 | <Order>2</Order> 124 | <RequiresUserInput>true</RequiresUserInput> 125 | </SynchronousCommand> 126 | <SynchronousCommand wcm:action="add"> 127 | <CommandLine>cmd.exe /c a:\win_vmtools.cmd</CommandLine> 128 | <Order>3</Order> 129 | <Description>Install VMware Tools</Description> 130 | </SynchronousCommand> 131 | <SynchronousCommand wcm:action="add"> 132 | <CommandLine>cmd.exe /c C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -File a:\win2016.ps1</CommandLine> 133 | <Description>Basic configuration</Description> 134 | <Order>99</Order> 135 | </SynchronousCommand> 136 | </FirstLogonCommands> 137 | <OOBE> 138 | <HideEULAPage>true</HideEULAPage> 139 | <HideLocalAccountScreen>true</HideLocalAccountScreen> 140 | <HideOEMRegistrationScreen>true</HideOEMRegistrationScreen> 141 | <HideOnlineAccountScreens>true</HideOnlineAccountScreens> 142 | <HideWirelessSetupInOOBE>true</HideWirelessSetupInOOBE> 143 | <NetworkLocation>Home</NetworkLocation> 144 | <ProtectYourPC>1</ProtectYourPC> 145 | </OOBE> 146 | <UserAccounts> 147 | <AdministratorPassword> 148 | <Value>VMware1!</Value> 149 | <PlainText>true</PlainText> 150 | </AdministratorPassword> 151 | </UserAccounts> 152 | <RegisteredOwner /> 153 | </component> 154 | </settings> 155 | <settings pass="offlineServicing"> 156 | <component name="Microsoft-Windows-LUA-Settings" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 157 | <EnableLUA>false</EnableLUA> 158 | </component> 159 | </settings> 160 | <cpi:offlineImage cpi:source="wim:c:/wim/install.wim#Windows Server 2016 R2 SERVERSTANDARD" xmlns:cpi="urn:schemas-microsoft-com:cpi" /> 161 | </unattend> -------------------------------------------------------------------------------- /config/centos7.cfg: -------------------------------------------------------------------------------- 1 | install 2 | cdrom 3 | lang en_GB 4 | keyboard --vckeymap=uk --xlayouts='gb' 5 | network --bootproto=dhcp --activate 6 | rootpw VMware1! ##### Set your own root password here ##### 7 | firewall --enabled --ssh 8 | selinux --permissive 9 | timezone Europe/London --isUtc 10 | bootloader --location=mbr 11 | text 12 | skipx 13 | zerombr 14 | clearpart --all --initlabel 15 | autopart --type=lvm 16 | auth --enableshadow --passalgo=sha512 --kickstart 17 | firstboot --disabled 18 | eula --agreed 19 | services --enabled=NetworkManager,sshd 20 | user --name=autotmm --plaintext --password=VMware1! --groups=wheel ##### Create a new user or users here ##### 21 | reboot 22 | 23 | %packages --ignoremissing --excludedocs 24 | @core 25 | sudo 26 | net-tools 27 | ntp 28 | ntpdate 29 | vim 30 | wget 31 | curl 32 | 33 | # unnecessary firmware 34 | -aic94xx-firmware 35 | -alsa-* 36 | -btrfs-progs* 37 | -centos-logos 38 | -dracut-config-rescue 39 | -dracut-network 40 | -microcode_ctl 41 | -NetworkManager* 42 | -ivtv-firmware 43 | -iwl*firmware 44 | -plymouth* 45 | %end 46 | 47 | %post --nochroot --logfile=/mnt/sysimage/root/ks-post.log 48 | # Disable quiet boot and splash screen 49 | sed --follow-symlinks -i "s/ rhgb quiet//" /mnt/sysimage/etc/default/grub 50 | sed --follow-symlinks -i "s/ rhgb quiet//" /mnt/sysimage/boot/grub2/grub.cfg 51 | 52 | 53 | mv /etc/motd /etc/motd-backup 54 | cat << MOTD > /etc/motd 55 | ╓╦╦╖ 56 | ╦╬╜ ╙╬╦ 57 | ╚╬╦ ╙╬╦ 58 | ╓╦╦╦╦ ╙╬╦ ╙╬╦ Built by: 59 | ╓╬╩ ╚╬╖ ╙╬╦ ╚╬╖ ____ _ _ 60 | ╓╦ └╬╦ ╙╬╦ ╙╬╦ ╙╬╦ __ _| _ \\ ___ __ _| (_)_______ 61 | ╔╬╨╙╬╦ ╚╬╖ ╙╬╦ ╚╬╖ ╙╬╦ \\ \\ / / |_) / _ \\/ _\` | | |_ / _ \\ 62 | ╦╬╜ ╙╬╦ ╙╬╦ ╙╬╦ ╙╬╦ ╙╬╦ \\ V /| _ < __/ (_| | | |/ / __/ 63 | ╔╬╙ └╩╦╖ ╙╬╦ ╙╩╦╖ ╙╬╦ ╙╬╦ \\_/ |_| \\_\\___|\\__,_|_|_/___\\___| _ _ 64 | ╚╬ ╦╬╜ ╓╬╩ ╦╬╜ ╓╬╩ ╬╩ / \\ _ _| |_ ___ _ __ ___ __ _| |_(_) ___ _ __ 65 | └╚╦╖ ╦╬╙ ╓╬╩ ┌╦╩╙ ╔╬╩ ╓╦╩╙ / _ \\| | | | __/ _ \\| '_ \` _ \\ / _\` | __| |/ _ \\| '_ \\ 66 | ╚╬╦╓╬╩╙ ╔╬╨ ╓╬╩ ╔╬╨ ╓╬╩─ / ___ \\ |_| | || (_) | | | | | | (_| | |_| | (_) | | | | 67 | ╙╩ ╦╬╜ ╓╬╩ ╦╬╜ ╓╬╩ /_/ \\_\\__,_|\\__\\___/|_| |_| |_|\\__,_|\\__|_|\\___/|_| |_| 68 | ╘╬╬ ╔╬╨ ╓╦╩ ╔╬╨ 69 | ╙╬╦╦╩╜ ╓╬╩ ╦╬╜ Code Stream Packer Build - CentOS 8 70 | ╔╬╩ ╓╦╩╙ 71 | ╩╬╖ ╓╬╩ 72 | ╙╩╩╨ 73 | MOTD 74 | 75 | # sudo 76 | echo "autotmm ALL=(ALL) NOPASSWD: ALL" >> /mnt/sysimage/etc/sudoers.d/autotmm 77 | sed -i "s/^.*requiretty/#Defaults requiretty/" /mnt/sysimage/etc/sudoers 78 | 79 | %end -------------------------------------------------------------------------------- /config/centos8.cfg: -------------------------------------------------------------------------------- 1 | install 2 | cdrom 3 | lang en_US.UTF-8 4 | keyboard us 5 | network --bootproto=dhcp 6 | rootpw VMware1! 7 | firewall --disabled 8 | selinux --permissive 9 | timezone UTC 10 | bootloader --location=mbr 11 | text 12 | skipx 13 | zerombr 14 | clearpart --all --initlabel 15 | autopart 16 | auth --enableshadow --passalgo=sha512 --kickstart 17 | firstboot --disabled 18 | eula --agreed 19 | services --enabled=NetworkManager,sshd 20 | user --name=autotmm --plaintext --password VMware1! --groups=wheel 21 | reboot 22 | 23 | %packages --ignoremissing --excludedocs 24 | @Base 25 | @Core 26 | @Development Tools 27 | openssh-clients 28 | sudo 29 | openssl-devel 30 | readline-devel 31 | zlib-devel 32 | kernel-headers 33 | kernel-devel 34 | net-tools 35 | vim 36 | wget 37 | curl 38 | rsync 39 | 40 | # unnecessary firmware 41 | -aic94xx-firmware 42 | -atmel-firmware 43 | -b43-openfwwf 44 | -bfa-firmware 45 | -ipw2100-firmware 46 | -ipw2200-firmware 47 | -ivtv-firmware 48 | -iwl100-firmware 49 | -iwl1000-firmware 50 | -iwl3945-firmware 51 | -iwl4965-firmware 52 | -iwl5000-firmware 53 | -iwl5150-firmware 54 | -iwl6000-firmware 55 | -iwl6000g2a-firmware 56 | -iwl6050-firmware 57 | -libertas-usb8388-firmware 58 | -ql2100-firmware 59 | -ql2200-firmware 60 | -ql23xx-firmware 61 | -ql2400-firmware 62 | -ql2500-firmware 63 | -rt61pci-firmware 64 | -rt73usb-firmware 65 | -xorg-x11-drv-ati-firmware 66 | -zd1211-firmware 67 | %end 68 | 69 | %post 70 | #yum update -y 71 | 72 | # update root certs 73 | wget -O/etc/pki/tls/certs/ca-bundle.crt http://curl.haxx.se/ca/cacert.pem 74 | 75 | # sudo 76 | yum install -y sudo 77 | echo "autotmm ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers.d/autotmm 78 | sed -i "s/^.*requiretty/#Defaults requiretty/" /etc/sudoers 79 | 80 | yum clean all 81 | %end -------------------------------------------------------------------------------- /config/ubuntu18.cfg: -------------------------------------------------------------------------------- 1 | # Locale and keyboard selection 2 | d-i debian-installer/locale string en_US 3 | d-i console-setup/ask_detect boolean false 4 | d-i keyboard-configuration/xkb-keymap select us 5 | 6 | # Clock and time zone setup 7 | d-i clock-setup/utc boolean true 8 | d-i time/zone string UTC 9 | 10 | # Grub and reboot message 11 | d-i finish-install/reboot_in_progress note 12 | d-i grub-installer/only_debian boolean true 13 | 14 | # Partitioning 15 | d-i partman-auto/disk string /dev/sda 16 | d-i partman-auto/method string regular 17 | d-i partman-partitioning/confirm_write_new_label boolean true 18 | d-i partman/choose_partition select finish 19 | d-i partman/confirm boolean true 20 | d-i partman/confirm_nooverwrite boolean true 21 | 22 | # User configuration 23 | d-i passwd/user-fullname string autotmm 24 | d-i passwd/username string autotmm 25 | d-i passwd/user-password-crypted password $6$i3mNhqKGx$IS9I.RGx9/4pBNbN7l/vXnEgHPHmre5.UOkpCMD9cpJFVhLU3fmvY0t8OszDyT8d7.Z55.KZ8M0daw04Vhrxn0 26 | d-i user-setup/allow-password-weak boolean true 27 | d-i user-setup/encrypt-home boolean false 28 | 29 | #Root Configuration 30 | d-i passwd/root-login boolean true 31 | d-i passwd/root-password-crypted password $6$i3mNhqKGx$IS9I.RGx9/4pBNbN7l/vXnEgHPHmre5.UOkpCMD9cpJFVhLU3fmvY0t8OszDyT8d7.Z55.KZ8M0daw04Vhrxn0 32 | 33 | # Package Configuration 34 | tasksel tasksel/first standard 35 | d-i pkgsel/include string openssh-server build-essential open-vm-tools openssh-server python3-pip cloud-init ntp 36 | d-i pkgsel/install-language-support boolean false 37 | # Disable automatic package updates 38 | d-i pkgsel/update-policy select none 39 | d-i pkgsel/upgrade select none 40 | 41 | # Add autotmm user to sudoers 42 | d-i preseed/late_command string \ 43 | echo 'autotmm ALL=(ALL) NOPASSWD: ALL' > /target/etc/sudoers.d/autotmm ; \ 44 | in-target chmod 440 /etc/sudoers.d/autotmm ; 45 | -------------------------------------------------------------------------------- /config/ubuntu19.cfg: -------------------------------------------------------------------------------- 1 | # Locale and keyboard selection 2 | d-i debian-installer/locale string en_US 3 | d-i console-setup/ask_detect boolean false 4 | d-i keyboard-configuration/xkb-keymap select us 5 | 6 | # Clock and time zone setup 7 | d-i clock-setup/utc boolean true 8 | d-i time/zone string UTC 9 | 10 | # Grub and reboot message 11 | d-i finish-install/reboot_in_progress note 12 | d-i grub-installer/only_debian boolean true 13 | 14 | # Partitioning 15 | d-i partman-auto-lvm/guided_size string max 16 | d-i partman-auto/choose_recipe select atomic 17 | d-i partman-auto/method string lvm 18 | d-i partman-lvm/confirm boolean true 19 | d-i partman-lvm/confirm boolean true 20 | d-i partman-lvm/confirm_nooverwrite boolean true 21 | d-i partman-lvm/device_remove_lvm boolean true 22 | d-i partman/choose_partition select finish 23 | d-i partman/confirm boolean true 24 | d-i partman/confirm_nooverwrite boolean true 25 | d-i partman/confirm_write_new_label boolean true 26 | 27 | # User configuration 28 | d-i passwd/user-fullname string autotmm 29 | d-i passwd/username string autotmm 30 | d-i passwd/user-password-crypted password $6$i3mNhqKGx$IS9I.RGx9/4pBNbN7l/vXnEgHPHmre5.UOkpCMD9cpJFVhLU3fmvY0t8OszDyT8d7.Z55.KZ8M0daw04Vhrxn0 31 | d-i user-setup/allow-password-weak boolean true 32 | d-i user-setup/encrypt-home boolean false 33 | 34 | #Root Configuration 35 | d-i passwd/root-login boolean true 36 | d-i passwd/root-password-crypted password $6$i3mNhqKGx$IS9I.RGx9/4pBNbN7l/vXnEgHPHmre5.UOkpCMD9cpJFVhLU3fmvY0t8OszDyT8d7.Z55.KZ8M0daw04Vhrxn0 37 | 38 | # Package Configuration 39 | tasksel tasksel/first standard 40 | d-i pkgsel/include string openssh-server build-essential open-vm-tools openssh-server ntp cloud-init 41 | d-i pkgsel/install-language-support boolean false 42 | 43 | # Disable automatic package updates 44 | d-i pkgsel/update-policy select none 45 | d-i pkgsel/upgrade select full-upgrade 46 | 47 | # Add autotmm user to sudoers 48 | d-i preseed/late_command string \ 49 | echo 'autotmm ALL=(ALL) NOPASSWD: ALL' > /target/etc/sudoers.d/autotmm ; \ 50 | in-target chmod 440 /etc/sudoers.d/autotmm ; 51 | -------------------------------------------------------------------------------- /config/ubuntu20/meta-data: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VMwareCMBUTMM/fielddemo-packer-templates/94c8bcffab740810e77398722cce591e1c6fd383/config/ubuntu20/meta-data -------------------------------------------------------------------------------- /config/ubuntu20/user-data: -------------------------------------------------------------------------------- 1 | #cloud-config 2 | autoinstall: 3 | version: 1 4 | identity: 5 | hostname: packer-ubuntu2004-template 6 | password: '$6$i3mNhqKGx$IS9I.RGx9/4pBNbN7l/vXnEgHPHmre5.UOkpCMD9cpJFVhLU3fmvY0t8OszDyT8d7.Z55.KZ8M0daw04Vhrxn0' 7 | username: autotmm 8 | network: 9 | network: 10 | version: 2 11 | ethernets: 12 | ens33: 13 | dhcp4: true 14 | dhcp-identifier: mac 15 | ssh: 16 | install-server: true 17 | late-commands: 18 | - sed -i 's/^#*\(send dhcp-client-identifier\).*$/\1 = hardware;/' /target/etc/dhcp/dhclient.conf 19 | - 'sed -i "s/dhcp4: true/&\n dhcp-identifier: mac/" /target/etc/netplan/00-installer-config.yaml' -------------------------------------------------------------------------------- /drivers/pvscsi-win8/pvscsi.cat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VMwareCMBUTMM/fielddemo-packer-templates/94c8bcffab740810e77398722cce591e1c6fd383/drivers/pvscsi-win8/pvscsi.cat -------------------------------------------------------------------------------- /drivers/pvscsi-win8/pvscsi.inf: -------------------------------------------------------------------------------- 1 | 2 | ;pvscsi.inf 3 | ;This file contains the information required to load the driver for the VMware PVSCSI Controller 4 | ; Copyright (C) 2001 - 2019, VMware, Inc. 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | [version] 52 | Signature="$Windows NT$" 53 | Class=SCSIAdapter 54 | ClassGuid={4D36E97B-E325-11CE-BFC1-08002BE10318} 55 | Provider=%VMWARE% 56 | DriverVer=08/02/2019,1.3.15.0 57 | CatalogFile=pvscsi.cat 58 | 59 | [ControlFlags] 60 | ExcludeFromSelect = * 61 | 62 | [SourceDisksNames] 63 | 1 = %DSKID1%,pvscsi.sys,, 64 | 65 | [SourceDisksFiles] 66 | pvscsi.sys = 1,, 67 | 68 | [Manufacturer] 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | %VMWARE%=pvscsi,NTamd64.6.2 77 | 78 | 79 | 80 | 81 | ; ################################################## 82 | 83 | ; Other architectures are unsupported, as are older versions of Windows on all platforms. 84 | [pvscsi] 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | [pvscsi.NTamd64.6.2] 106 | %DEVICE%=DDInstall.x64.vista, PCI\VEN_15AD&DEV_07C0 107 | 108 | 109 | 110 | ; ################################################## 111 | 112 | 113 | 114 | 115 | 116 | 117 | [DDInstall.x64.vista.NT] 118 | CopyFiles=pvscsi.x64.CopyFiles 119 | 120 | 121 | ; ################################################## 122 | 123 | [DDInstall.x64.vista.NT.HW] 124 | AddReg=enableMSI.reg 125 | Include=machine.inf 126 | Needs=PciIoSpaceNotRequired 127 | 128 | 129 | 130 | ; ################################################## 131 | 132 | [pvscsi.x64.CopyFiles] 133 | pvscsi.sys,,,2 134 | 135 | 136 | ; ################################################## 137 | 138 | [DDInstall.x64.NT.Services] 139 | AddService=pvscsi,2,Service_Install.x64,EventLog_Install 140 | 141 | [DDInstall.x64.vista.NT.Services] 142 | AddService=pvscsi,2,Service_Install.x64,EventLog_Install 143 | 144 | 145 | ; ################################################## 146 | 147 | [DestinationDirs] 148 | pvscsi.x64.CopyFiles = 12 149 | DefaultDestDir=12 150 | 151 | ; ################################################## 152 | 153 | [Service_Install.x64] 154 | DisplayName=%pvscsi.DiskName% 155 | ServiceType=1 ; %SERVICE_KERNEL_DRIVER% 156 | StartType=0 ; %SERVICE_BOOT_START% 157 | ErrorControl=1 ; %SERVICE_ERROR_NORMAL% 158 | ServiceBinary=%12%\pvscsi.sys 159 | LoadOrderGroup=SCSI Miniport 160 | 161 | ; We need to force the use of \Driver\pvscsi32 as the driver object name, 162 | ; otherwise the crash dump driver loader functions cannot find the driver. 163 | ; StartName entry defined in the INF format is supposed to facilitate that, 164 | ; but at least on win2k3sp2-32 and win2k8-datacenter-32 the driver installer 165 | ; interpretes StartName as the name of the account to start the service under, 166 | ; which is an incorrect interpretation for SERVICE_KERNEL_DRIVER type. As a 167 | ; work around ObjectName registry entry is added directly using brute-force. 168 | 169 | AddReg=busTypeSAS,pnpsafe_pci_addreg,vmware_installers_addreg 170 | DelReg=driverObjectName.del 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | ; ################################################## 180 | 181 | [busTypeSAS] 182 | HKR, "Parameters", "BusType", 0x00010001, 0x0000000A ; BusTypeSAS 183 | 184 | [enableMSI.reg] 185 | HKR, Interrupt Management,, %FLG_ADDREG_KEYONLY% 186 | HKR, Interrupt Management\MessageSignaledInterruptProperties,, %FLG_ADDREG_KEYONLY% 187 | HKR, Interrupt Management\MessageSignaledInterruptProperties, MSISupported, \ 188 | %FLG_ADDREG_TYPE_DWORD%, 1 189 | HKR, Interrupt Management\MessageSignaledInterruptProperties, MessageNumberLimit, \ 190 | %FLG_ADDREG_TYPE_DWORD%, 1 191 | 192 | [pnpsafe_pci_addreg] 193 | HKR, "Parameters\PnpInterface", "5", 0x00010001, 0x00000001 194 | 195 | [vmware_installers_addreg] 196 | HKR,, %pvscsi.installers.value.name%, %FLG_ADDREG_KEYONLY%, %pvscsi.installers.value.windows% 197 | ;; FLG_ADDREG_KEYONLY 198 | HKR,, %pvscsi.installers.value.name%, 0x00010002, %pvscsi.installers.value.windows% 199 | ;; FLG_ADDREG_NOCLOBBER | FLG_ADDREG_TYPE_MULTI_SZ 200 | 201 | [driverObjectName.del] 202 | HKR, , "ObjectName" 203 | 204 | [EventLog_Install] 205 | AddReg = EventLog_AddReg 206 | 207 | [EventLog_AddReg] 208 | HKR,,EventMessageFile,%FLG_ADDREG_TYPE_EXPAND_SZ%,"%%SystemRoot%%\System32\IoLogMsg.dll" 209 | HKR,,TypesSupported,%FLG_ADDREG_TYPE_DWORD%,7 210 | 211 | [strings] 212 | pvscsi.installers.value.name="vwdk.installers" 213 | pvscsi.installers.value.windows="Windows" 214 | pvscsi.DiskName="pvscsi Storage Controller Driver" 215 | VMWARE="VMware, Inc." 216 | DEVICE="VMware PVSCSI Controller" 217 | DSKID1="VMware PVSCSI Controller Installation Disk 1" 218 | FLG_ADDREG_KEYONLY = 0x00000010 219 | FLG_ADDREG_TYPE_DWORD = 0x00010001 220 | FLG_ADDREG_TYPE_EXPAND_SZ = 0x00020000 221 | FLG_DELREG_MULTI_SZ_DELSTRING = 0x00018002 222 | -------------------------------------------------------------------------------- /drivers/pvscsi-win8/pvscsi.sys: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VMwareCMBUTMM/fielddemo-packer-templates/94c8bcffab740810e77398722cce591e1c6fd383/drivers/pvscsi-win8/pvscsi.sys -------------------------------------------------------------------------------- /drivers/pvscsi-win8/txtsetup.oem: -------------------------------------------------------------------------------- 1 | 2 | ; txtsetup.oem file. 3 | ; Required to install the pvscsi driver at install time. 4 | 5 | [Disks] 6 | ;"directory" should specify the full-path as per the documentation, but only 7 | ; relative paths worked during testing. 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | [Defaults] 20 | SCSI = pvscsi 21 | 22 | [SCSI] 23 | pvscsi = "VMware PVSCSI Controller" 24 | 25 | [Files.SCSI.pvscsi] 26 | driver = disk,pvscsi.sys,pvscsi 27 | inf = disk,pvscsi.inf 28 | catalog = disk,pvscsi.cat 29 | 30 | [Config.pvscsi] 31 | value = Parameters\PnpInterface, 5 ,REG_DWORD, 1 32 | value = Parameters, BusType, REG_DWORD, A 33 | 34 | [HardwareIds.scsi.pvscsi] 35 | id = "PCI\VEN_15AD&DEV_07C0", "pvscsi" 36 | -------------------------------------------------------------------------------- /scripts/centos_7.sh: -------------------------------------------------------------------------------- 1 | yum install -y cloud-init perl open-vm-tools bash-completion yum-utils 2 | cloud-init clean 3 | yum clean all 4 | 5 | cat << MOTD > /etc/motd 6 | ╓╦╦╖ 7 | ╦╬╜ ╙╬╦ 8 | ╚╬╦ ╙╬╦ 9 | ╓╦╦╦╦ ╙╬╦ ╙╬╦ Built by: 10 | ╓╬╩ ╚╬╖ ╙╬╦ ╚╬╖ ____ _ _ 11 | ╓╦ └╬╦ ╙╬╦ ╙╬╦ ╙╬╦ __ _| _ \\ ___ __ _| (_)_______ 12 | ╔╬╨╙╬╦ ╚╬╖ ╙╬╦ ╚╬╖ ╙╬╦ \\ \\ / / |_) / _ \\/ _\` | | |_ / _ \\ 13 | ╦╬╜ ╙╬╦ ╙╬╦ ╙╬╦ ╙╬╦ ╙╬╦ \\ V /| _ < __/ (_| | | |/ / __/ 14 | ╔╬╙ └╩╦╖ ╙╬╦ ╙╩╦╖ ╙╬╦ ╙╬╦ \\_/ |_| \\_\\___|\\__,_|_|_/___\\___| _ _ 15 | ╚╬ ╦╬╜ ╓╬╩ ╦╬╜ ╓╬╩ ╬╩ / \\ _ _| |_ ___ _ __ ___ __ _| |_(_) ___ _ __ 16 | └╚╦╖ ╦╬╙ ╓╬╩ ┌╦╩╙ ╔╬╩ ╓╦╩╙ / _ \\| | | | __/ _ \\| '_ \` _ \\ / _\` | __| |/ _ \\| '_ \\ 17 | ╚╬╦╓╬╩╙ ╔╬╨ ╓╬╩ ╔╬╨ ╓╬╩─ / ___ \\ |_| | || (_) | | | | | | (_| | |_| | (_) | | | | 18 | ╙╩ ╦╬╜ ╓╬╩ ╦╬╜ ╓╬╩ /_/ \\_\\__,_|\\__\\___/|_| |_| |_|\\__,_|\\__|_|\\___/|_| |_| 19 | ╘╬╬ ╔╬╨ ╓╦╩ ╔╬╨ 20 | ╙╬╦╦╩╜ ╓╬╩ ╦╬╜ Code Stream Packer Build - CentOS 7 21 | ╔╬╩ ╓╦╩╙ 22 | ╩╬╖ ╓╬╩ 23 | ╙╩╩╨ 24 | MOTD 25 | -------------------------------------------------------------------------------- /scripts/centos_8.sh: -------------------------------------------------------------------------------- 1 | yum install -y cloud-init perl open-vm-tools bash-completion yum-utils 2 | cloud-init clean 3 | yum clean all 4 | 5 | cat << MOTD > /etc/motd 6 | ╓╦╦╖ 7 | ╦╬╜ ╙╬╦ 8 | ╚╬╦ ╙╬╦ 9 | ╓╦╦╦╦ ╙╬╦ ╙╬╦ Built by: 10 | ╓╬╩ ╚╬╖ ╙╬╦ ╚╬╖ ____ _ _ 11 | ╓╦ └╬╦ ╙╬╦ ╙╬╦ ╙╬╦ __ _| _ \\ ___ __ _| (_)_______ 12 | ╔╬╨╙╬╦ ╚╬╖ ╙╬╦ ╚╬╖ ╙╬╦ \\ \\ / / |_) / _ \\/ _\` | | |_ / _ \\ 13 | ╦╬╜ ╙╬╦ ╙╬╦ ╙╬╦ ╙╬╦ ╙╬╦ \\ V /| _ < __/ (_| | | |/ / __/ 14 | ╔╬╙ └╩╦╖ ╙╬╦ ╙╩╦╖ ╙╬╦ ╙╬╦ \\_/ |_| \\_\\___|\\__,_|_|_/___\\___| _ _ 15 | ╚╬ ╦╬╜ ╓╬╩ ╦╬╜ ╓╬╩ ╬╩ / \\ _ _| |_ ___ _ __ ___ __ _| |_(_) ___ _ __ 16 | └╚╦╖ ╦╬╙ ╓╬╩ ┌╦╩╙ ╔╬╩ ╓╦╩╙ / _ \\| | | | __/ _ \\| '_ \` _ \\ / _\` | __| |/ _ \\| '_ \\ 17 | ╚╬╦╓╬╩╙ ╔╬╨ ╓╬╩ ╔╬╨ ╓╬╩─ / ___ \\ |_| | || (_) | | | | | | (_| | |_| | (_) | | | | 18 | ╙╩ ╦╬╜ ╓╬╩ ╦╬╜ ╓╬╩ /_/ \\_\\__,_|\\__\\___/|_| |_| |_|\\__,_|\\__|_|\\___/|_| |_| 19 | ╘╬╬ ╔╬╨ ╓╦╩ ╔╬╨ 20 | ╙╬╦╦╩╜ ╓╬╩ ╦╬╜ Code Stream Packer Build - CentOS 8 21 | ╔╬╩ ╓╦╩╙ 22 | ╩╬╖ ╓╬╩ 23 | ╙╩╩╨ 24 | MOTD 25 | -------------------------------------------------------------------------------- /scripts/centos_update.sh: -------------------------------------------------------------------------------- 1 | yum update -y 2 | yum reinstall -y ca-certificates # Fix SSL issues... -------------------------------------------------------------------------------- /scripts/ssh_config.sh: -------------------------------------------------------------------------------- 1 | # Configure SSH 2 | sed -i '/^PermitRootLogin/s/yes/no/' /etc/ssh/sshd_config 3 | sed -i "s/.*PubkeyAuthentication.*/PubkeyAuthentication yes/g" /etc/ssh/sshd_config 4 | systemctl restart sshd -------------------------------------------------------------------------------- /scripts/ssh_install_autotmm_key.sh: -------------------------------------------------------------------------------- 1 | # Move the SSH key to Authorized Keys and ensure permissions 2 | mkdir -p /home/autotmm/.ssh 3 | chmod 700 /home/autotmm/.ssh 4 | cat /tmp/id_rsa.pub > /home/autotmm/.ssh/authorized_keys 5 | chmod 644 /home/autotmm/.ssh/authorized_keys 6 | chown -R autotmm /home/autotmm/.ssh 7 | rm -rf /tmp/id_rsa.pub -------------------------------------------------------------------------------- /scripts/ubuntu_18.sh: -------------------------------------------------------------------------------- 1 | 2 | # Remove temporary files 3 | rm -rf /tmp/* 4 | cat << MOTD > /etc/motd 5 | ╓╦╦╖ 6 | ╦╬╜ ╙╬╦ 7 | ╚╬╦ ╙╬╦ 8 | ╓╦╦╦╦ ╙╬╦ ╙╬╦ Built by: 9 | ╓╬╩ ╚╬╖ ╙╬╦ ╚╬╖ ____ _ _ 10 | ╓╦ └╬╦ ╙╬╦ ╙╬╦ ╙╬╦ __ _| _ \\ ___ __ _| (_)_______ 11 | ╔╬╨╙╬╦ ╚╬╖ ╙╬╦ ╚╬╖ ╙╬╦ \\ \\ / / |_) / _ \\/ _\` | | |_ / _ \\ 12 | ╦╬╜ ╙╬╦ ╙╬╦ ╙╬╦ ╙╬╦ ╙╬╦ \\ V /| _ < __/ (_| | | |/ / __/ 13 | ╔╬╙ └╩╦╖ ╙╬╦ ╙╩╦╖ ╙╬╦ ╙╬╦ \\_/ |_| \\_\\___|\\__,_|_|_/___\\___| _ _ 14 | ╚╬ ╦╬╜ ╓╬╩ ╦╬╜ ╓╬╩ ╬╩ / \\ _ _| |_ ___ _ __ ___ __ _| |_(_) ___ _ __ 15 | └╚╦╖ ╦╬╙ ╓╬╩ ┌╦╩╙ ╔╬╩ ╓╦╩╙ / _ \\| | | | __/ _ \\| '_ \` _ \\ / _\` | __| |/ _ \\| '_ \\ 16 | ╚╬╦╓╬╩╙ ╔╬╨ ╓╬╩ ╔╬╨ ╓╬╩─ / ___ \\ |_| | || (_) | | | | | | (_| | |_| | (_) | | | | 17 | ╙╩ ╦╬╜ ╓╬╩ ╦╬╜ ╓╬╩ /_/ \\_\\__,_|\\__\\___/|_| |_| |_|\\__,_|\\__|_|\\___/|_| |_| 18 | ╘╬╬ ╔╬╨ ╓╦╩ ╔╬╨ 19 | ╙╬╦╦╩╜ ╓╬╩ ╦╬╜ Code Stream Packer Build - Ubuntu 18.04 20 | ╔╬╩ ╓╦╩╙ 21 | ╩╬╖ ╓╬╩ 22 | ╙╩╩╨ 23 | MOTD 24 | -------------------------------------------------------------------------------- /scripts/ubuntu_19.sh: -------------------------------------------------------------------------------- 1 | 2 | # Remove temporary files 3 | rm -rf /tmp/* 4 | 5 | 6 | mv /etc/motd /etc/motd-backup 7 | cat << MOTD > /etc/motd 8 | ╓╦╦╖ 9 | ╦╬╜ ╙╬╦ 10 | ╚╬╦ ╙╬╦ 11 | ╓╦╦╦╦ ╙╬╦ ╙╬╦ Built by: 12 | ╓╬╩ ╚╬╖ ╙╬╦ ╚╬╖ ____ _ _ 13 | ╓╦ └╬╦ ╙╬╦ ╙╬╦ ╙╬╦ __ _| _ \\ ___ __ _| (_)_______ 14 | ╔╬╨╙╬╦ ╚╬╖ ╙╬╦ ╚╬╖ ╙╬╦ \\ \\ / / |_) / _ \\/ _\` | | |_ / _ \\ 15 | ╦╬╜ ╙╬╦ ╙╬╦ ╙╬╦ ╙╬╦ ╙╬╦ \\ V /| _ < __/ (_| | | |/ / __/ 16 | ╔╬╙ └╩╦╖ ╙╬╦ ╙╩╦╖ ╙╬╦ ╙╬╦ \\_/ |_| \\_\\___|\\__,_|_|_/___\\___| _ _ 17 | ╚╬ ╦╬╜ ╓╬╩ ╦╬╜ ╓╬╩ ╬╩ / \\ _ _| |_ ___ _ __ ___ __ _| |_(_) ___ _ __ 18 | └╚╦╖ ╦╬╙ ╓╬╩ ┌╦╩╙ ╔╬╩ ╓╦╩╙ / _ \\| | | | __/ _ \\| '_ \` _ \\ / _\` | __| |/ _ \\| '_ \\ 19 | ╚╬╦╓╬╩╙ ╔╬╨ ╓╬╩ ╔╬╨ ╓╬╩─ / ___ \\ |_| | || (_) | | | | | | (_| | |_| | (_) | | | | 20 | ╙╩ ╦╬╜ ╓╬╩ ╦╬╜ ╓╬╩ /_/ \\_\\__,_|\\__\\___/|_| |_| |_|\\__,_|\\__|_|\\___/|_| |_| 21 | ╘╬╬ ╔╬╨ ╓╦╩ ╔╬╨ 22 | ╙╬╦╦╩╜ ╓╬╩ ╦╬╜ Code Stream Packer Build - Ubuntu 19.10 23 | ╔╬╩ ╓╦╩╙ 24 | ╩╬╖ ╓╬╩ 25 | ╙╩╩╨ 26 | MOTD 27 | -------------------------------------------------------------------------------- /scripts/ubuntu_20.sh: -------------------------------------------------------------------------------- 1 | apt-get install cloud-init 2 | # Remove temporary files 3 | rm -rf /tmp/* 4 | 5 | 6 | mv /etc/motd /etc/motd-backup 7 | cat << MOTD > /etc/motd 8 | ╓╦╦╖ 9 | ╦╬╜ ╙╬╦ 10 | ╚╬╦ ╙╬╦ 11 | ╓╦╦╦╦ ╙╬╦ ╙╬╦ Built by: 12 | ╓╬╩ ╚╬╖ ╙╬╦ ╚╬╖ ____ _ _ 13 | ╓╦ └╬╦ ╙╬╦ ╙╬╦ ╙╬╦ __ _| _ \\ ___ __ _| (_)_______ 14 | ╔╬╨╙╬╦ ╚╬╖ ╙╬╦ ╚╬╖ ╙╬╦ \\ \\ / / |_) / _ \\/ _\` | | |_ / _ \\ 15 | ╦╬╜ ╙╬╦ ╙╬╦ ╙╬╦ ╙╬╦ ╙╬╦ \\ V /| _ < __/ (_| | | |/ / __/ 16 | ╔╬╙ └╩╦╖ ╙╬╦ ╙╩╦╖ ╙╬╦ ╙╬╦ \\_/ |_| \\_\\___|\\__,_|_|_/___\\___| _ _ 17 | ╚╬ ╦╬╜ ╓╬╩ ╦╬╜ ╓╬╩ ╬╩ / \\ _ _| |_ ___ _ __ ___ __ _| |_(_) ___ _ __ 18 | └╚╦╖ ╦╬╙ ╓╬╩ ┌╦╩╙ ╔╬╩ ╓╦╩╙ / _ \\| | | | __/ _ \\| '_ \` _ \\ / _\` | __| |/ _ \\| '_ \\ 19 | ╚╬╦╓╬╩╙ ╔╬╨ ╓╬╩ ╔╬╨ ╓╬╩─ / ___ \\ |_| | || (_) | | | | | | (_| | |_| | (_) | | | | 20 | ╙╩ ╦╬╜ ╓╬╩ ╦╬╜ ╓╬╩ /_/ \\_\\__,_|\\__\\___/|_| |_| |_|\\__,_|\\__|_|\\___/|_| |_| 21 | ╘╬╬ ╔╬╨ ╓╦╩ ╔╬╨ 22 | ╙╬╦╦╩╜ ╓╬╩ ╦╬╜ Code Stream Packer Build - Ubuntu 20.04 23 | ╔╬╩ ╓╦╩╙ 24 | ╩╬╖ ╓╬╩ 25 | ╙╩╩╨ 26 | MOTD 27 | -------------------------------------------------------------------------------- /scripts/ubuntu_template_cleanup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Configure cloud-init for OVF only 4 | echo 'datasource_list: [ OVF, None ]' | sudo -s tee /etc/cloud/cloud.cfg.d/90_dpkg.cfg 5 | 6 | # Cleanup VM for Templating 7 | # Source: https://jimangel.io/post/create-a-vm-template-ubuntu-18.04/ 8 | 9 | #Stop services for cleanup 10 | service rsyslog stop 11 | 12 | #clear audit logs 13 | if [ -f /var/log/wtmp ]; then 14 | truncate -s0 /var/log/wtmp 15 | fi 16 | if [ -f /var/log/lastlog ]; then 17 | truncate -s0 /var/log/lastlog 18 | fi 19 | 20 | #cleanup /tmp directories 21 | rm -rf /tmp/* 22 | rm -rf /var/tmp/* 23 | 24 | #cleanup current ssh keys 25 | rm -f /etc/ssh/ssh_host_* 26 | 27 | #add check for ssh keys on reboot...regenerate if neccessary 28 | cat << 'EOL' | tee /etc/rc.local 29 | #!/bin/sh -e 30 | # 31 | # rc.local 32 | # 33 | # This script is executed at the end of each multiuser runlevel. 34 | # Make sure that the script will "" on success or any other 35 | # value on error. 36 | # 37 | # In order to enable or disable this script just change the execution 38 | # bits. 39 | # 40 | # By default this script does nothing. 41 | # dynamically create hostname (optional) 42 | #if hostname | grep localhost; then 43 | # hostnamectl set-hostname "$(head /dev/urandom | tr -dc A-Za-z0-9 | head -c 13 ; echo '')" 44 | #fi 45 | test -f /etc/ssh/ssh_host_dsa_key || dpkg-reconfigure openssh-server 46 | exit 0 47 | EOL 48 | 49 | # make sure the script is executable 50 | chmod +x /etc/rc.local 51 | 52 | #reset hostname 53 | # prevent cloudconfig from preserving the original hostname 54 | sed -i 's/preserve_hostname: false/preserve_hostname: true/g' /etc/cloud/cloud.cfg 55 | truncate -s0 /etc/hostname 56 | hostnamectl set-hostname localhost 57 | 58 | # cleans out all of the cloud-init cache / logs - this is mainly cleaning out networking info 59 | cloud-init clean --logs 60 | 61 | #cleanup shell history 62 | cat /dev/null > ~/.bash_history 63 | -------------------------------------------------------------------------------- /scripts/ubuntu_update.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | apt-get -qq update 3 | apt-get -qq upgrade 4 | -------------------------------------------------------------------------------- /scripts/win2016.ps1: -------------------------------------------------------------------------------- 1 | # Basic configuration of vanilla Windows Server installation to progress Packer.io builds 2 | # @author Michael Poore 3 | # @website https://blog.v12n.io 4 | # @source https://github.com/virtualhobbit 5 | $ErrorActionPreference = "Stop" 6 | 7 | # Switch network connection to private mode 8 | # Required for WinRM firewall rules 9 | $profile = Get-NetConnectionProfile 10 | Set-NetConnectionProfile -Name $profile.Name -NetworkCategory Private 11 | 12 | # Enable WinRM service 13 | winrm quickconfig -quiet 14 | winrm set winrm/config/service '@{AllowUnencrypted="true"}' 15 | winrm set winrm/config/service/auth '@{Basic="true"}' 16 | 17 | # Reset auto logon count 18 | # https://docs.microsoft.com/en-us/windows-hardware/customize/desktop/unattend/microsoft-windows-shell-setup-autologon-logoncount#logoncount-known-issue 19 | Set-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon' -Name AutoLogonCount -Value 0 -------------------------------------------------------------------------------- /scripts/win_cloudbaseinit.ps1: -------------------------------------------------------------------------------- 1 | $downloadUri = "https://cloudbase.it/downloads/CloudbaseInitSetup_x64.msi" 2 | $installerPath = "C:\Windows\Temp\cloudbaseinit.msi" 3 | $installLog = "C:\Users\administrator\Desktop\install_cloudbase-init.log" 4 | 5 | function Get-Installer { 6 | $progressPreference = "silentlyContinue" 7 | Invoke-WebRequest -OutFile $installerPath $downloadUri 8 | } 9 | 10 | function Install-Cloudbase { 11 | $p = Start-Process -PassThru -FilePath msiexec -ArgumentList "/i $installerPath /qn /l*v $installLog /norestart REBOOT=ReallySuppress" 12 | Wait-Process -Id $p.id -Timeout 240 13 | if (($p.ExitCode -ne 0) -and ($p.ExitCode -ne 3010)) { 14 | $p.ExitCode 15 | Write-Error "ERROR: problem encountered during cloudbase-init install" 16 | } 17 | } 18 | 19 | Write-Host "BEGIN: install_cloudbase_init.ps1" 20 | Write-Host "Downloading Cloudbase-init from $downloadUri" 21 | Get-Installer 22 | Write-Host "Installing Cloudbase-init" 23 | Install-Cloudbase 24 | Write-Host "END: install_cloudbase_init.ps1" 25 | -------------------------------------------------------------------------------- /scripts/win_vmtools.cmd: -------------------------------------------------------------------------------- 1 | @rem Silent mode, basic UI, no reboot 2 | e:\setup64 /s /v "/qb REBOOT=R" -------------------------------------------------------------------------------- /ssh/id_rsa.pub: -------------------------------------------------------------------------------- 1 | ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCvABbODQHeMcKxJ5n7eurFYE1tYCoo+K4n467AhqDMNZxI5XjFXf2M4YMOpvw3fsCsU4ehBu/A98tdFMhW1ITFHkR6mTZUycK2PlNSH/KmERTwzcqcHP9FnvC+OnZZ4Wc0d4h/e7wAbMyMylNU4EjkuisLNnZcusyABa4JqEJkvSCNe68N+dImne5k+oQ2qU/OPA1gN8SFSKgSjX8hKY3Jhgf1LAvRzmUABwH8kuogWfQ0Oje8q/u3ZTg85mb3eZjVbyK9AKL6M9dMOLsFkJlYOg6wfL0DaQLsKzZ4DKy19AFQJPLzvUXqscpKY+CXImVI+/h5UNjzsoKMYsGomqgVBwlck5d9zKe9H1S8GQMkVJOJFhoXRbSSBr1Fwo/NINoWC8T3P6O/6kG4MFY1sVpnpISiLd/7eKAZCJzvgHaSire3Q7LYF2GvXoB/h8AoXKMTx7vmi2wN5Urz3C+MUoNYWCRTjmFDR6AS2XbA4KVmpFdiz5l/ToGrPIxE13geKK1/u8EF+tPFKNkkSmAdoXrmQTxfoOlVPUvcPFPXiC2XOl4r3whh1tzhP5lQWG8sXcU9ApZ3tuMzPdzMHsr18lpIJqlLiv5nIpkAkIsRMsvTHXkLAuOWos71T45y8k6UmKaCdz2enEqrDEpCt6c89NE5P90BTetoX3KoKtgL9z8GEQ== autotmm@cmbu.local 2 | -------------------------------------------------------------------------------- /variables.json: -------------------------------------------------------------------------------- 1 | { 2 | "vcenter_server": "{{ env `VCSERVER`}}", 3 | "vcenter_username": "{{ env `VCUSER`}}", 4 | "vcenter_password": "{{ env `VCPASS`}}", 5 | "vcenter_datastore": "{{ env `VCDATASTORE`}}", 6 | "vcenter_folder": "{{ env `VCFOLDER`}}", 7 | "vcenter_cluster": "{{ env `VCCLUSTER`}}", 8 | "vcenter_network": "{{ env `VCNETWORK`}}", 9 | 10 | "buildtime": "{{ env `BUILDTIME`}}", 11 | 12 | "ssh_username": "{{ env `SSHUSER`}}", 13 | "ssh_password": "{{ env `SSHPASS`}}", 14 | 15 | "winrm_username": "Administrator", 16 | "winrm_password": "{{ env `SSHPASS`}}", 17 | 18 | "http_server": "https://raw.githubusercontent.com/VMwareCMBUTMM/fielddemo-packer-templates/master/config", 19 | 20 | "ubuntu1804_vm_name": "packer-ubuntu1804", 21 | "ubuntu1804_iso": "[sc2c02vsan01] iso/ubuntu-18.04.3-server-amd64.iso", 22 | "ubuntu1804_checksum": "7d8e0055d663bffa27c1718685085626cb59346e7626ba3d3f476322271f573e", 23 | 24 | "ubuntu1910_vm_name": "packer-ubuntu1910", 25 | "ubuntu1910_iso": "[sc2c02vsan01] iso/ubuntu-19.10-server-amd64.iso", 26 | "ubuntu1910_checksum": "921fd8b271c04aa86a321cc35b40e677f9b85f7903bf2204efb2389b0f0a64c1", 27 | 28 | "ubuntu2004_vm_name": "packer-ubuntu2004", 29 | "ubuntu2004_iso": "[sc2c02vsan01] iso/ubuntu-18.04.3-server-amd64.iso", 30 | "ubuntu2004_checksum": "caf3fd69c77c439f162e2ba6040e9c320c4ff0d69aad1340a514319a9264df9f", 31 | 32 | "windows_2016_vm_name": "packer-windows2016", 33 | "windows_2016_iso": "[sc2c02vsan01] iso/Windows_Server_2016_Datacenter_EVAL_en-us_14393_refresh.ISO", 34 | "windows_2016_checksum": "1ce702a578a3cb1ac3d14873980838590f06d5b7101c5daaccbac9d73f1fb50f", 35 | 36 | "centos7_vm_name": "packer-centos7", 37 | "centos7_iso": "[sc2c02vsan01] iso/CentOS-7-x86_64-DVD-2003.iso", 38 | "centos7_checksum": "087a5743dc6fd6706d9b961b8147423ddc029451b938364c760d75440eb7be14", 39 | 40 | "centos8_vm_name": "packer-centos8", 41 | "centos8_iso": "[sc2c02vsan01] iso/CentOS-8.2.2004-x86_64-dvd1.iso", 42 | "centos8_checksum": "c87a2d81d67bbaeaf646aea5bedd70990078ec252fc52f5a7d65ff609871e255" 43 | } --------------------------------------------------------------------------------