-
Notifications
You must be signed in to change notification settings - Fork 6
/
win2016-jenkins-slave.json
85 lines (83 loc) · 2.69 KB
/
win2016-jenkins-slave.json
1
2
3
4
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
{
"variables": {
"name-base": "WINDOWS-2016-JENKINS-SLAVE",
"build-region": "us-west-2",
"build-vpc": "<yourvpchere>",
"build-subnet": "subnet-<yoursubnethere>",
"build-secgrp": "sg-<yoursecuritygrouphere>",
"build-time": "{{isotime \"2006-01-02\"}}",
"aws_ami_region": "us-west-2"
},
"builders": [
{
"name": "{{user `name-base`}}-{{user `build-time`}}",
"ami_description": "{{user `name-base`}}",
"type": "amazon-ebs",
"encrypt_boot": "true",
"region": "{{user `build-region`}}",
"region_kms_key_ids": {
"us-west-2": "alias/aws/ebs"
},
"ami_regions": "{{user `aws_ami_region`}}",
"instance_type": "t3.medium",
"ami_name": "{{user `name-base`}}-{{user `build-time`}}",
"vpc_id": "{{user `build-vpc`}}",
"subnet_id": "{{user `build-subnet`}}",
"security_group_ids": "{{user `build-secgrp`}}",
"source_ami_filter": {
"filters": {
"virtualization-type": "hvm",
"architecture": "x86_64",
"name": "Windows_Server-2016-English-Full-Base-20*",
"block-device-mapping.volume-type": "gp2",
"root-device-type": "ebs"
},
"owners": ["amazon"],
"most_recent": true
},
"user_data_file": "./EC2Bootstrap.ps1",
"associate_public_ip_address": false,
"communicator": "winrm",
"winrm_username": "Administrator",
"winrm_timeout": "40m",
"windows_password_timeout": "30m",
"winrm_insecure": true,
"tags": {
"OS_Version": "{{user `name-base`}}",
"User": "Packer",
"Encrypted_AMI": "True",
"Created": "{{user `build-time`}}"
},
"launch_block_device_mappings": [
{
"device_name": "/dev/sda1",
"volume_size": 50,
"delete_on_termination": true,
"volume_type": "standard"
}
]
}
],
"provisioners": [
{
"type": "powershell",
"scripts": [
"./Enable_smb.ps1",
]
},
{
"type": "file",
"source": "launch-config.json",
"destination":
"C:\\ProgramData\\Amazon\\EC2-Windows\\Launch\\Config\\LaunchConfig.json"
},
{
"type": "powershell",
"inline": "C:\\ProgramData\\Amazon\\EC2-Windows\\Launch\\Scripts\\InitializeInstance.ps1 -Schedule"
},
{
"type": "powershell",
"inline": "C:\\ProgramData\\Amazon\\EC2-Windows\\Launch\\Scripts\\SysprepInstance.ps1"
}
]
}