forked from aliyun/ros-templates
-
Notifications
You must be signed in to change notification settings - Fork 1
/
simple-windows-instance-with-sharepoint.yml
362 lines (362 loc) · 14.5 KB
/
simple-windows-instance-with-sharepoint.yml
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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
ROSTemplateFormatVersion: '2015-09-01'
Description:
en: Create an ECS instance with SharePoint Foundation 2013.
zh-cn: 创建一个ECS实例并安装SharePoint Foundation 2013。
Parameters:
VpcCidrBlock:
Type: String
Label:
en: VPC CIDR Block
zh-cn: 专有网络网段
Description:
en: 'The IP address range of the VPC in the CIDR Block form; <br>you can use
the following IP address ranges: <br><font color=''green''>[10.0.0.0/8]</font><br><font
color=''green''>[172.16.0.0/12]</font><br><font color=''green''>[192.168.0.0/16]</font>'
zh-cn: 专有网络IP地址段范围,<br>您可以使用以下的IP地址段:<br><font color='green'>[10.0.0.0/8]</font><br><font
color='green'>[172.16.0.0/12]</font><br><font color='green'>[192.168.0.0/16]</font>
Default: 192.168.0.0/16
AllowedValues:
- 192.168.0.0/16
- 172.16.0.0/12
- 10.0.0.0/8
VSwitchCidrBlock:
Type: String
Label:
en: VSwitch CIDR Block
zh-cn: 交换机网段
Description:
en: Subnet of the created virtual switch,must be a sub-network segment of the
proprietary network and is not occupied by other VSwitches.
zh-cn: 创建的虚拟交换机的子网,必须是所属专有网络的子网段,并且没有被其他交换机占用。
Default: 192.168.0.0/16
ZoneId:
Type: String
Label:
en: VSwitch Available Zone
zh-cn: 交换机可用区
Description:
en: Availability zone ID,<br><b>note: <font color='blue'>Before selecting, please
confirm that the Availability Zone supports the specification of creating
ECS resources</font></b>
zh-cn: 可用区ID,<br><b>注: <font color='blue'>选择可用区前请确认该可用区是否支持创建ECS资源的规格</font></b>
AssociationProperty: ALIYUN::ECS::Instance:ZoneId
ImageId:
Type: String
Label:
en: Image ID
zh-cn: 镜像
Description:
en: 'Image ID, About SharePoint Foundation2013 system requirements, see detail:
<a href=''https://learn.microsoft.com/en-us/sharepoint/install/hardware-software-requirements-2013''
target=''_blank''><b><font color=''blue''>SharePoint Foundation2013 system
requirements</b></font></a>'
zh-cn: 镜像ID,关于SharePoint Foundation2013系统要求,详见: <a href='https://learn.microsoft.com/zh-cn/sharepoint/install/hardware-software-requirements-2013'
target='_blank'><b><font color='blue'>SharePoint Foundation2013系统要求</b></font></a>
Default: win2008r2_sp1_x64_ent_zh-cn_40G_alibase_20200116.vhd
SharePointDownloadPath:
Type: String
Label:
en: SharePoint Image Download Path
zh-cn: SharePoint镜像下载路径
Description:
en: 'SharePoint Foundation2013 image download path, see detail: <a href=''https://docs.microsoft.com/en-us/OfficeUpdates/sharepoint-updates''
target=''_blank''><b><font color=''blue''>SharePoint Foundation2013 image
download path</b></font></a>'
zh-cn: SharePoint Foundation2013镜像下载路径,详见: <a href='https://docs.microsoft.com/zh-cn/OfficeUpdates/sharepoint-updates'
target='_blank'><b><font color='blue'>SharePoint Foundation2013镜像下载路径</b></font></a>
Default: https://download.microsoft.com/download/0/B/3/0B358219-C503-4890-A46F-14FD6C7686CF/sharepoint.exe
InstanceType:
Type: String
Label:
en: Instance Type
zh-cn: 实例规格
Description:
en: 'Fill in the specifications that can be used under the VSwitch availability
zone;</b></font><br>general specifications:<font color=''red''><b>ecs.c5.large</b></font><br>note:
a few zones do not support general specifications<br>see detail: <a href=''https://www.alibabacloud.com/help/en/doc-detail/25378.html''
target=''_blank''><b><font color=''blue''>Instance Specification Family</font></a></b>'
zh-cn: 填写VSwitch可用区下可使用的规格;<br>通用规格:<font color='red'><b>ecs.c5.large</b></font><br>注:可用区可能不支持通用规格<br>规格详见:<a
href='https://help.aliyun.com/document_detail/25378.html' target='_blank'><b><font
color='blue'>实例规格族</font></a></b>
AssociationProperty: ALIYUN::ECS::Instance::InstanceType
AssociationPropertyMetadata:
ZoneId: ZoneId
Password:
Type: String
Label:
en: Instance Password
zh-cn: 实例密码
Description:
en: Server login password, Length 8-30, must contain three(Capital letters,
lowercase letters, numbers, ()`~!@#$%^&*_-+=|{}[]:;'<>,.?/ Special symbol
in).
zh-cn: 服务器登录密码,长度8-30,必须包含三项(大写字母、小写字母、数字、 ()`~!@#$%^&*_-+=|{}[]:;'<>,.?/ 中的特殊符号)。
ConstraintDescription:
en: Length 8-30, must contain three(Capital letters, lowercase letters, numbers,
()`~!@#$%^&*_-+=|{}[]:;'<>,.?/ Special symbol in).
zh-cn: 长度8-30,必须包含三项(大写字母、小写字母、数字、 ()`~!@#$%^&*_-+=|{}[]:;'<>,.?/ 中的特殊符号)。
AllowedPattern: '[0-9A-Za-z\_\-\&:;''<>,=%`~!@#\(\)\$\^\*\+\|\{\}\[\]\.\?\/]+$'
MinLength: 8
MaxLength: 30
NoEcho: true
Resources:
EcsVpc:
Type: ALIYUN::ECS::VPC
Properties:
CidrBlock:
Ref: VpcCidrBlock
VpcName: Vpc-sharepoint
Metadata:
ALIYUN::ROS::Designer:
id: 4dfdcadf-d55e-4085-af95-79d40005c3da
EcsSecurityGroup:
Type: ALIYUN::ECS::SecurityGroup
Properties:
VpcId:
Ref: EcsVpc
SecurityGroupIngress:
- IpProtocol: tcp
NicType: intranet
PortRange: 3389/3389
Priority: 1
SourceCidrIp: 0.0.0.0/0
Metadata:
ALIYUN::ROS::Designer:
id: f1c13fc6-e74d-477c-be14-9e24fd583b55
EcsVswitch:
Type: ALIYUN::ECS::VSwitch
Properties:
ZoneId:
Ref: ZoneId
VpcId:
Ref: EcsVpc
CidrBlock:
Ref: VSwitchCidrBlock
Metadata:
ALIYUN::ROS::Designer:
id: 3f1d6b20-25eb-4a1c-a40f-1f764b157bd6
RosWaitConditionHandle:
Type: ALIYUN::ROS::WaitConditionHandle
Properties: {}
Metadata:
ALIYUN::ROS::Designer:
id: d3d24118-a044-4f1d-9684-758480e50a31
RosWaitCondition:
Type: ALIYUN::ROS::WaitCondition
Properties:
Count: 2
Handle:
Ref: RosWaitConditionHandle
Timeout: 2700
Metadata:
ALIYUN::ROS::Designer:
id: 47058b03-d345-4071-bcdb-9bc2888899be
SharePointServer:
Type: ALIYUN::ECS::Instance
Properties:
VpcId:
Ref: EcsVpc
VSwitchId:
Ref: EcsVswitch
SecurityGroupId:
Ref: EcsSecurityGroup
ImageId:
Ref: ImageId
InstanceType:
Ref: InstanceType
Password:
Ref: Password
UserData:
Fn::Replace:
- ros-notify:
Fn::GetAtt:
- RosWaitConditionHandle
- PowerShellCurlCli
- Fn::Join:
- ''
- - "[powershell]\r\n"
- "New-Item -Path \"C:\\Install_dir\" -Force -type directory \r\n"
- "$ossName = 'ros-template-resources' \r\n"
- "$client = new-object System.Net.WebClient \r\n"
- $client.DownloadFile("
- Ref: SharePointDownloadPath
- "\", 'C:\\Install_dir\\SharePoint.exe') \r\n"
- "$client.DownloadFile(\"https://$ossName.oss-cn-beijing.aliyuncs.com/SharePoint/AppFabric1.1-RTM-KB2671763-x64-ENU.exe\"\
, 'C:\\Install_dir\\AppFabric1.1-RTM-KB2671763-x64-ENU.exe')\r\n"
- "$client.DownloadFile(\"https://$ossName.oss-cn-beijing.aliyuncs.com/SharePoint/MicrosoftIdentityExtensions-64.msi\"\
, 'C:\\Install_dir\\MicrosoftIdentityExtensions-64.msi')\r\n"
- "$client.DownloadFile(\"https://$ossName.oss-cn-beijing.aliyuncs.com/SharePoint/setup_msipc_x64.msi\"\
, 'C:\\Install_dir\\setup_msipc_x64.msi')\r\n"
- "$client.DownloadFile(\"https://$ossName.oss-cn-beijing.aliyuncs.com/SharePoint/sqlncli.msi\"\
, 'C:\\Install_dir\\sqlncli.msi')\r\n"
- "$client.DownloadFile(\"https://$ossName.oss-cn-beijing.aliyuncs.com/SharePoint/Synchronization.msi\"\
, 'C:\\Install_dir\\Synchronization.msi')\r\n"
- "$client.DownloadFile(\"https://$ossName.oss-cn-beijing.aliyuncs.com/SharePoint/WcfDataServices.exe\"\
, 'C:\\Install_dir\\WcfDataServices.exe')\r\n"
- "$client.DownloadFile(\"https://$ossName.oss-cn-beijing.aliyuncs.com/SharePoint/Windows6.1-KB974405-x64.msu\"\
, 'C:\\Install_dir\\Windows6.1-KB974405-x64.msu')\r\n"
- "$client.DownloadFile(\"https://$ossName.oss-cn-beijing.aliyuncs.com/SharePoint/WindowsServerAppFabricSetup_x64.exe\"\
, 'C:\\Install_dir\\WindowsServerAppFabricSetup_x64.exe')\r\n"
- "cd C:\\Install_dir \r\n"
- "New-Item \"install_sharepoint.bat\" -type File \r\n"
- "Add-Content install_sharepoint.bat \"C:\" \r\n"
- "Add-Content install_sharepoint.bat 'powershell.exe C:\\Install_dir\\\
Install_SharePoint.ps1' \r\n"
- "New-Item \"Install_SharePoint.ps1\" -type File \r\n"
- "Add-Content Install_SharePoint.ps1 'if(Test-Path \"C:\\Install_dir\\\
finished.log\"){' \r\n"
- "Add-Content Install_SharePoint.ps1 \"cd C:\\Install_dir \" \r\n"
- "Add-Content Install_SharePoint.ps1 \"}else{ \" \r\n"
- "Add-Content Install_SharePoint.ps1 'Start-Process C:\\Install_dir\\\
2013\\Setup.exe -args \"/config C:\\Install_dir\\2013\\Files\\SetupSilent\\\
config.xml\" -Wait'\r\n"
- "Add-Content Install_SharePoint.ps1 'cd C:\\Install_dir'\r\n"
- "Add-Content Install_SharePoint.ps1 'New-Item \"finish.log\" -type File'\r\
\n"
- "Add-Content Install_SharePoint.ps1 'Remove-Item \"C:\\Install_dir\\\
SharePoint.exe\"' \r\n"
- "Add-Content Install_SharePoint.ps1 'Remove-Item \"C:\\Install_dir\\\
2013\\*\" -recurse' \r\n"
- "Add-Content Install_SharePoint.ps1 'schtasks /delete /TN \"install_sharepoint\"\
\ /f'\r\n"
- "Add-Content Install_SharePoint.ps1 'ros-notify'\r\n"
- "Add-Content Install_SharePoint.ps1 \"}\" \r\n"
- "Start-Process C:\\Install_dir\\SharePoint.exe -args \"/extract:C:\\\
Install_dir\\2013 /quiet\" -Wait \r\n"
- "Start-Process C:\\Install_dir\\2013\\prerequisiteinstaller.exe -args\
\ \"/continue /unattended\" -Wait \r\n"
- "Start-Process C:\\Install_dir\\2013\\prerequisiteinstaller.exe -args\
\ \"/SQLNCli:C:\\Install_dir\\sqlncli.msi /continue /unattended\" -Wait\r\
\n"
- "Start-Process C:\\Install_dir\\2013\\prerequisiteinstaller.exe -args\
\ \"/IDFX:C:\\Install_dir\\Windows6.1-KB974405-x64.msu /continue /unattended\"\
\ -Wait\r\n"
- "Start-Process C:\\Install_dir\\2013\\prerequisiteinstaller.exe -args\
\ \"/Sync:C:\\Install_dir\\Synchronization.msi /continue /unattended\"\
\ -Wait\r\n"
- "Start-Process C:\\Install_dir\\2013\\prerequisiteinstaller.exe -args\
\ \"/AppFabric:C:\\Install_dir\\WindowsServerAppFabricSetup_x64.exe\
\ /continue /unattended\" -Wait \r\n"
- "Start-Process C:\\Install_dir\\MicrosoftIdentityExtensions-64.msi -args\
\ \"/quiet\" -Wait \r\n"
- "Start-Process C:\\Install_dir\\2013\\prerequisiteinstaller.exe -args\
\ \"/continue /unattended\" -Wait \r\n"
- "Start-Process C:\\Install_dir\\2013\\prerequisiteinstaller.exe -args\
\ \"/WCFDataServices:C:\\Install_dir\\WcfDataServices.exe /continue\
\ /unattended\" -Wait \r\n"
- "Start-Process C:\\Install_dir\\2013\\prerequisiteinstaller.exe -args\
\ \"/KB2671763:C:\\Install_dir\\AppFabric1.1-RTM-KB2671763-x64-ENU.exe\
\ /continue /unattended\" -Wait\r\n"
- schtasks /create /TN "install_sharepoint" /RU administrator /RP "
- Ref: Password
- "\" /SC ONSTART /TR \"C:\\Install_dir\\install_sharepoint.bat\" \r\n"
- "ros-notify \r\n"
- "shutdown /r /f /t 1 \r\n"
Metadata:
ALIYUN::ROS::Designer:
id: 62ed3480-152b-40d3-946d-4d19c0de7530
Outputs:
InstanceId:
Value:
Fn::GetAtt:
- SharePointServer
- InstanceId
PublicIp:
Value:
Fn::GetAtt:
- SharePointServer
- PublicIp
SecurityGroupId:
Value:
Fn::GetAtt:
- EcsSecurityGroup
- SecurityGroupId
VpcName:
Value:
Fn::GetAtt:
- EcsVpc
- VpcId
Metadata:
ALIYUN::ROS::Interface:
ParameterGroups:
- Parameters:
- VpcCidrBlock
- VSwitchCidrBlock
Label:
default: VPC
- Parameters:
- ZoneId
- ImageId
- SharePointDownloadPath
- InstanceType
- Password
Label:
default: ECS
TemplateTags:
- acs:example:Windows应用服务:创建一个SharePoint2013的windows实例
ALIYUN::ROS::Designer:
3f1d6b20-25eb-4a1c-a40f-1f764b157bd6:
embeds:
- 62ed3480-152b-40d3-946d-4d19c0de7530
position:
x: 405
y: 435
size:
height: 157
width: 157
z: 1
47058b03-d345-4071-bcdb-9bc2888899be:
position:
x: 614
y: 482
size:
height: 60
width: 60
z: 0
4dfdcadf-d55e-4085-af95-79d40005c3da:
embeds:
- 3f1d6b20-25eb-4a1c-a40f-1f764b157bd6
- f1c13fc6-e74d-477c-be14-9e24fd583b55
position:
x: 314
y: 278
size:
height: 336
width: 272
z: 0
62ed3480-152b-40d3-946d-4d19c0de7530:
position:
x: 455
y: 484
size:
height: 60
width: 60
z: 2
76cda828-772d-4aa3-90f6-26fa687bdb89:
source:
id: 47058b03-d345-4071-bcdb-9bc2888899be
target:
id: d3d24118-a044-4f1d-9684-758480e50a31
z: 1
d3d24118-a044-4f1d-9684-758480e50a31:
position:
x: 614
y: 315
size:
height: 60
width: 60
z: 0
f1c13fc6-e74d-477c-be14-9e24fd583b55:
position:
x: 455
y: 319
size:
height: 60
width: 60
z: 1
fdcc91f9-b9f0-4290-a83c-885a99104dcb:
source:
id: 62ed3480-152b-40d3-946d-4d19c0de7530
target:
id: f1c13fc6-e74d-477c-be14-9e24fd583b55
z: 1