-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathACS-ECS-RunRemoteShellScript.yml
121 lines (121 loc) · 2.91 KB
/
ACS-ECS-RunRemoteShellScript.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
FormatVersion: OOS-2019-06-01
Description:
en: Run remote shell script
zh-cn: 运行远端shell脚本
name-en: ACS-ECS-RunRemoteShellScript
name-zh-cn: 运行远端shell脚本
categories:
- run_command
Parameters:
regionId:
Label:
en: RegionId
zh-cn: 地域ID
Type: String
AssociationProperty: RegionId
Default: '{{ ACS::RegionId }}'
instanceId:
Label:
en: InstanceId
zh-cn: ECS实例
Type: String
AssociationProperty: ALIYUN::ECS::Instance::InstanceId
AssociationPropertyMetadata:
RegionId: regionId
instanceRole:
Label:
en: InstanceRole
zh-cn: 挂载到实例上的RAM角色
Type: String
fileName:
Label:
en: FileName
zh-cn: 执行的文件名
Type: String
srcUrl:
Label:
en: SrcUrl
zh-cn: 文件在OSS中的目录
Type: String
destUrl:
Label:
en: DestUrl
zh-cn: 文件复制到ECS实例中的目录
Type: String
workingDir:
Label:
en: WorkingDir
zh-cn: 在实例中运行命令的目录
Type: String
Default: /root
timeout:
Label:
en: Timeout
zh-cn: 运行命令最大超时时间
Type: Number
Default: 600
OOSAssumeRole:
Label:
en: OOSAssumeRole
zh-cn: OOS扮演的RAM角色
Type: String
Default: ''
RamRole: '{{ OOSAssumeRole }}'
Tasks:
- Name: copyOSSFileToInstance
Description:
en: Copies OSS file to linux instace
zh-cn: 复制OSS中的文件到Linux实例中
Action: 'ACS::ECS::CopyLinuxInstanceFileFromOSS'
Properties:
regionId: '{{ regionId }}'
instanceId: '{{ instanceId }}'
instanceRole: '{{ instanceRole }}'
srcUrl: '{{ srcUrl }}/{{ fileName }}'
destUrl: '{{ destUrl }}'
- Name: runCommand
Description:
en: Execute cloud assistant command
zh-cn: 执行云助手命令
Action: 'ACS::ECS::RunCommand'
Properties:
regionId: '{{ regionId }}'
commandContent: '/bin/bash {{ destUrl }}/{{ fileName }}'
instanceId: '{{ instanceId }}'
commandType: RunShellScript
workingDir: '{{ workingDir }}'
timeout: '{{ timeout }}'
Outputs:
commandOutput:
Type: String
ValueSelector: invocationOutput
Outputs:
commandOutput:
Type: String
Value: '{{ runCommand.commandOutput }}'
Metadata:
ALIYUN::OOS::Interface:
ParameterGroups:
- Parameters:
- instanceRole
- fileName
- srcUrl
- destUrl
- workingDir
- timeout
Label:
default:
zh-cn: 执行Shell脚本选型
en: Run Shell Script Options
- Parameters:
- instanceId
Label:
default:
zh-cn: 选择实例
en: Select ECS Instance
- Parameters:
- OOSAssumeRole
Label:
default:
zh-cn: 高级选项
en: Control Options