テンプレート名
ACS-ECS-BulkyConfigureSoftwareFromEcsAppStore - ソフトウェアのバッチインストール
テンプレートの説明
複数の Elastic Compute Service (ECS) インスタンスに一度にソフトウェアをインストールまたはアンインストールします。
テンプレートタイプ
自動化
所有者
Alibaba Cloud
入力パラメーター
パラメーター | 説明 | タイプ | 必須 | デフォルト値 | 制限 |
targets | ターゲットインスタンス | Json | はい | ||
regionId | リージョン ID。 | String | いいえ | {{ ACS::RegionId }} | |
softwareType | ソフトウェアタイプ。 | String | いいえ | Aliyun | |
action | 操作タイプ | String | いいえ | install | |
aliyunSoftwareName | Alibaba Cloud が提供するソフトウェアの名前。 | String | いいえ | Logtail | |
communitySoftwareName | コミュニティが提供するソフトウェアの名前。 | String | いいえ | DockerCE | |
installer | インストールソース | String | いいえ | yum | |
softwareName | ソフトウェア名。 | String | いいえ | "" | |
rateControl | タスク実行の同時実行率 | Json | いいえ | {'Mode': 'Concurrency', 'MaxErrors': 0, 'Concurrency': 10} | |
OOSAssumeRole | CloudOps Orchestration Service (OOS) がアシュームする Resource Access Management (RAM) ロール。 | String | いいえ | "" |
出力パラメーター
パラメーター | 説明 | タイプ |
commandOutput | String |
テンプレートを実行するために必要な権限ポリシー
{
"Version": "1",
"Statement": [
{
"Action": [
"ecs:DescribeInstances",
"ecs:DescribeInvocationResults",
"ecs:DescribeInvocations",
"ecs:RunCommand"
],
"Resource": "*",
"Effect": "Allow"
},
{
"Action": [
"oos:GetApplicationGroup"
],
"Resource": "*",
"Effect": "Allow"
}
]
}
詳細
詳細については、「ACS-ECS-BulkyConfigureSoftwareFromEcsAppStore」をご参照ください。
テンプレートコンテンツ
FormatVersion: OOS-2019-06-01
Description:
en: Use this template to install software on ecs
zh-cn: Use this template to install software on ECS instances in batches.
ja: このテンプレートは ECS にソフトウェアをインストールするために使用します。
name-en: Bulky Configure Software
name-zh-cn: Batch Install Software
name-ja: ソフトウェアの一括設定
categories:
- run_command
- application_manage
Parameters:
regionId:
Type: String
Label:
en: RegionId
zh-cn: Region ID
ja: リージョン ID
AssociationProperty: RegionId
Default: '{{ ACS::RegionId }}'
softwareType:
Type: String
Label:
en: Software Type
zh-cn: Software Type
ja: ソフトウェアタイプ
AllowedValues:
- Aliyun
- Community
- SystemRepository
Default: Aliyun
AssociationPropertyMetadata:
LocaleKey: SoftwareType
action:
Type: String
Label:
en: Action
zh-cn: Operation Type
ja: 操作
AllowedValues:
- install
- uninstall
Default: install
AssociationPropertyMetadata:
LocaleKey: SoftwareOperationType
aliyunSoftwareName:
Type: String
Label:
en: Aliyun Software Name
zh-cn: Alibaba Cloud Software Name
ja: Alibaba Cloud ソフトウェア名
AllowedValues:
- Logtail
- CloudMonitorAgent
Default: Logtail
AssociationPropertyMetadata:
LocaleKey: AliyunSoftwareName
Visible:
Condition:
Fn::Equals:
- ${softwareType}
- Aliyun
communitySoftwareName:
Type: String
Label:
en: Community Software Name
zh-cn: Community Software Name
ja: コミュニティソフトウェア名
AllowedValues:
- DockerCE
- BaotaPanelFree
Default: DockerCE
AssociationPropertyMetadata:
LocaleKey: CommunitySoftwareName
Visible:
Condition:
Fn::Equals:
- ${softwareType}
- Community
Description:
en: Baota Panel only supports to be installed on Linux. Information can be found in execution outputs.
zh-cn: Baota Panel can be installed only on Linux operating systems. After installation, you can find access information in the execution output.
ja: Baota Panel は Linux へのインストールのみサポートしています。関連情報は実行結果で確認できます。
installer:
Type: String
Label:
en: Installer
zh-cn: Installation Source
ja: インストーラー
Default: yum
AllowedValues:
- apt-get
- yum
AssociationPropertyMetadata:
Visible:
Condition:
Fn::Equals:
- ${softwareType}
- SystemRepository
softwareName:
Type: String
Label:
en: Software Name
zh-cn: Software Name
ja: ソフトウェア名
Default: ''
AssociationPropertyMetadata:
Visible:
Condition:
Fn::Equals:
- ${softwareType}
- SystemRepository
targets:
Type: Json
Label:
en: TargetInstance
zh-cn: Target Instance
ja: ターゲットインスタンス
AssociationProperty: Targets
AssociationPropertyMetadata:
ResourceType: ALIYUN::ECS::Instance
RegionId: regionId
Status: Running
rateControl:
Label:
en: RateControl
zh-cn: Task execution concurrency rate
ja: レート制御
Type: Json
AssociationProperty: RateControl
Default:
Mode: Concurrency
MaxErrors: 0
Concurrency: 10
OOSAssumeRole:
Label:
en: OOSAssumeRole
zh-cn: RAM role assumed by OOS
ja: OOS が引き受ける RAM ロール
Type: String
Default: ''
RamRole: '{{ OOSAssumeRole }}'
Tasks:
- Name: getInstance
Description:
en: Views the ECS instances
zh-cn: Get ECS instances
ja: ECS インスタンスの表示
Action: ACS::SelectTargets
Properties:
ResourceType: ALIYUN::ECS::Instance
RegionId: '{{ regionId }}'
Filters:
- '{{ targets }}'
Outputs:
instanceIds:
Type: List
ValueSelector: Instances.Instance[].InstanceId
instanceInfos:
Type: List
ValueSelector: .Instances.Instance[] | {"osType":.OSType, "instanceId":.InstanceId}
- Name: runCommand
Action: ACS::ECS::RunCommand
Properties:
commandContent:
Fn::If:
- Fn::Equals:
- Fn::Jq:
- First
- .|map(select(.instanceId == "{{ ACS::TaskLoopItem }}").osType)[]
- '{{ getInstance.instanceInfos }}'
- linux
- Fn::If:
- Fn::Equals:
- '{{ softwareType }}'
- 'Aliyun'
- Fn::If:
- Fn::Equals:
- '{{ aliyunSoftwareName }}'
- 'Logtail'
- '{{ oos:aliyun/services/oos/commands/install_logtail_for_linux }}'
- Fn::If:
- Fn::Equals:
- '{{ aliyunSoftwareName }}'
- 'CloudMonitorAgent'
- '{{ oos:aliyun/services/oos/commands/install_CloudMonitorAgent_for_linux }}'
- |-
echo "Aliyun software ({{ aliyunSoftwareName }}) is not supported"
exit 1
- Fn::If:
- Fn::Equals:
- '{{ softwareType }}'
- 'Community'
- Fn::If:
- Fn::Equals:
- '{{ communitySoftwareName }}'
- 'DockerCE'
- '{{ oos:aliyun/services/oos/commands/install_DockerCE_for_linux }}'
- Fn::If:
- Fn::Equals:
- '{{ communitySoftwareName }}'
- 'BaotaPanelFree'
- '{{ oos:aliyun/services/oos/commands/install_BaoTaPanelFree_for_linux }}'
- |-
echo "Community software ({{ communitySoftwareName }}) is not supported"
exit 1
- '{{ oos:aliyun/services/oos/commands/install_from_linux_repository }}'
- Fn::If:
- Fn::Equals:
- '{{ softwareType }}'
- 'Aliyun'
- Fn::If:
- Fn::Equals:
- '{{ aliyunSoftwareName }}'
- 'Logtail'
- '{{ oos:aliyun/services/oos/commands/install_logtail_for_windows }}'
- Fn::If:
- Fn::Equals:
- '{{ aliyunSoftwareName }}'
- 'CloudMonitorAgent'
- '{{ oos:aliyun/services/oos/commands/install_CloudMonitorAgent_for_windows }}'
- |-
echo "Aliyun software ({{ aliyunSoftwareName }}) is not supported"
exit 1
- Fn::If:
- Fn::Equals:
- '{{ softwareType }}'
- 'Community'
- Fn::If:
- Fn::Equals:
- '{{ communitySoftwareName }}'
- 'DockerCE'
- '{{ oos:aliyun/services/oos/commands/install_DockerCE_for_windows }}'
- |-
echo "Community software ({{ communitySoftwareName }}) is not supported"
exit 1
- |-
echo "Windows system does not support SystemRepository {{ installer }}"
exit 1
instanceId: '{{ ACS::TaskLoopItem }}'
regionId: '{{ regionId }}'
commandType:
Fn::If:
- Fn::Equals:
- Fn::Jq:
- First
- .|map(select(.instanceId == "{{ ACS::TaskLoopItem }}").osType)[]
- '{{ getInstance.instanceInfos }}'
- linux
- RunShellScript
- RunPowerShellScript
enableParameter: true
parameters:
Fn::If:
- Fn::Equals:
- '{{softwareType }}'
- 'SystemRepository'
- action: '{{ action }}'
installer: '{{ installer }}'
softwareName: '{{ softwareName }}'
- action: '{{ action }}'
Loop:
Items: '{{ getInstance.instanceIds }}'
RateControl: '{{ rateControl }}'
Outputs:
commandOutputs:
AggregateType: Fn::ListJoin
AggregateField: commandOutput
Outputs:
commandOutput:
Type: String
ValueSelector: invocationOutput
Outputs:
commandOutput:
Type: String
Value: '{{ runCommand.commandOutputs }}'
Metadata:
ALIYUN::OOS::Interface:
ParameterGroups:
- Parameters:
- softwareType
- aliyunSoftwareName
- communitySoftwareName
- installer
- softwareName
- action
Label:
default:
zh-cn: Configure Software Parameters
en: Configure Software Parameters
ja: ソフトウェアパラメーターの設定
- Parameters:
- regionId
- targets
Label:
default:
zh-cn: Select Instances
en: Select Ecs Instances
ja: ECS インスタンスの選択
- Parameters:
- rateControl
- OOSAssumeRole
Label:
default:
zh-cn: Advanced Options
en: Control Options
ja: 制御オプション