SHARE
TWEET

Untitled

a guest Aug 20th, 2019 210 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. {
  2.   "variables": {
  3.     "ami-description": "Windows Server for Jenkins Slave ({{isotime \"2006-01-02-15-04-05\"}})",
  4.     "ami-name": "windows-slave-for-jenkins-{{isotime \"2006-01-02-15-04-05\"}}",
  5.     "aws_access_key": "",
  6.     "aws_secret_key": ""
  7.   },
  8.  
  9.   "builders": [
  10.     {
  11.       "ami_description": "{{user `ami-description`}}",
  12.       "ami_name": "{{user `ami-name`}}",
  13.       "ami_regions": [
  14.         "us-east-1"
  15.       ],
  16.       "ami_users": [
  17.         "XXXXXXXXXX"
  18.       ],
  19.       "ena_support": "true",
  20.       "instance_type": "t3.medium",
  21.       "region": "us-east-1",
  22.       "source_ami_filter": {
  23.         "filters": {
  24.           "name": "Windows_Server-2016-English-Full-Containers-*",
  25.           "root-device-type": "ebs",
  26.           "virtualization-type": "hvm"
  27.         },
  28.         "most_recent": true,
  29.         "owners": [
  30.           "amazon"
  31.         ]
  32.       },
  33.       "sriov_support": "true",
  34.       "user_data_file": "scripts/SetUpWinRM.ps1",
  35.       "communicator": "winrm",
  36.       "winrm_username": "Administrator",
  37.       "winrm_insecure": true,
  38.       "winrm_use_ssl": true,
  39.       "tags": {
  40.         "Name": "{{user `ami-name`}}"
  41.       },
  42.       "type": "amazon-ebs"
  43.     }
  44.   ],
  45.   "post-processors": [
  46.   {
  47.     "inline": [
  48.       "echo AMI Name {{user `ami-name`}}",
  49.       "date",
  50.       "exit 0"
  51.     ],
  52.     "type": "shell-local"
  53.   }
  54.   ],
  55.   "provisioners": [
  56.     {
  57.       "type": "powershell",
  58.       "valid_exit_codes": [ 0, 3010 ],
  59.       "scripts": [
  60.         "scripts/disable-uac.ps1",
  61.         "scripts/enable-rdp.ps1",
  62.         "install_windows.ps1"
  63.       ]
  64.     },
  65.     {
  66.       "type": "windows-restart",
  67.       "restart_check_command": "powershell -command \"& {Write-Output 'restarted.'}\""
  68.     },
  69.     {
  70.       "type": "powershell",
  71.       "inline": [
  72.         "C:\\ProgramData\\Amazon\\EC2-Windows\\Launch\\Scripts\\InitializeInstance.ps1 -Schedule",
  73.         "C:\\ProgramData\\Amazon\\EC2-Windows\\Launch\\Scripts\\SysprepInstance.ps1 -NoShutdown"
  74.       ]
  75.     }
  76.   ]
  77. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top