テンプレート名
ACS-ECS-ApplyAnsiblePlayBooks
テンプレートの説明
Elastic Compute Service (ECS) インスタンスで Ansible プレイブックを実行します。CentOS、Alibaba Cloud Linux、および Ubuntu をサポートする Ansible プレイブックのみがサポートされています。
テンプレートタイプ
自動化
所有者
Alibaba Cloud
入力パラメーター
パラメーター | 説明 | タイプ | 必須 | デフォルト値 | 制限 | |
targets | Ansible プレイブックを実行する ECS インスタンス。 | Json | はい | |||
sourceType | プレイブックのストレージタイプ。 | 文字列 | はい | |||
sourcePath | プレイブックの URL。 | 文字列 | はい | |||
playbookFile | プレイブックの名前。 | 文字列 | はい | |||
regionId | リージョン ID。 | 文字列 | いいえ | {{ ACS::RegionId }} | ||
tokenInfo | プレイブックのダウンロードに使用するトークン。 | 文字列 | いいえ | "" | ||
hosts | プレイブックを実行するために使用されるホスト。 | 文字列 | いいえ | /etc/ansible/hosts | ||
installDependencies | CloudOps Orchestration Service (OOS) を使用して、Python Package Index (PyPI) リポジトリから Ansible とその依存関係をインストールするかどうかを指定します。 | ブール値 | いいえ | True | ||
workingDir | プレイブックが実行されるディレクトリ。 | 文字列 | いいえ | /root/ansible-workspace | ||
check | Ansible の実行を確認するかどうかを指定します。 | ブール値 | いいえ | True | ||
extraVariables | プレイブックの実行時に Ansible に渡される追加の変数。 | 文字列 | いいえ | color=red | 文字列検証の正規表現: ^$ | ^\w+=\S+(\s\w+=\S+)*$ |
verbose | プレイブックの実行中のプロセスを記録するために使用される冗長レベル。 | 文字列 | いいえ | -v | ||
rateControl | レート制御設定。 | Json | いいえ | {'Mode': 'Concurrency', 'MaxErrors': 0, 'Concurrency': 10} | ||
OOSAssumeRole | OOS によって引き受けられる Resource Access Management (RAM) ロール。 | 文字列 | いいえ | "" |
出力パラメーター
パラメーター | 説明 | タイプ |
commandOutput | 文字列 |
テンプレートを実行するために必要な権限ポリシー
{
"Version": "1",
"Statement": [
{
"Action": [
"ecs:DescribeInstances",
"ecs:DescribeInvocationResults",
"ecs:DescribeInvocations",
"ecs:RunCommand"
],
"Resource": "*",
"Effect": "Allow"
}
]
}
参照
詳細については、GitHub の ACS-ECS-ApplyAnsiblePlayBooks.yml をご参照ください。
テンプレートコンテンツ
FormatVersion: OOS-2019-06-01
Description:
en: 'Use this template to run Ansible playbook on ECS Instance.Only supports CentOS, Alibaba Cloud Linux and Ubuntu.'
zh-cn: the description in Chinese
name-en: ACS-ECS-ApplyAnsiblePlayBooks
name-zh-cn: the description in Chinese
categories:
- run_command
Parameters:
regionId:
Type: String
Label:
en: RegionId
zh-cn: the description in Chinese
AssociationProperty: RegionId
Default: '{{ ACS::RegionId }}'
targets:
Label:
en: TargetInstance
zh-cn: the description in Chinese
Type: Json
AssociationProperty: Targets
AssociationPropertyMetadata:
ResourceType: 'ALIYUN::ECS::Instance'
RegionId: regionId
sourceType:
Type: String
Label:
en: SourceType
zh-cn: the description in Chinese
AllowedValues:
- oss
- https
- github
sourcePath:
Type: String
Label:
en: SourcePath
zh-cn: the description in Chinese
Description:
en: 'You can specify the URL in the following formats: https://example.com/playbook.yml'
zh-cn: the description in Chinese
playbookFile:
Label:
en: PlaybookFile
zh-cn: the description in Chinese
Description:
en: ' For example: example.yml'
zh-cn: the description in Chinese
Type: String
tokenInfo:
Type: String
Label:
en: TokenInfo
zh-cn: the description in Chinese
Description:
en: 'It is only required when downloading palybook from GitHub'
zh-cn: the description in Chinese
Default: ""
hosts:
Type: String
Label:
en: Hosts
zh-cn: the description in Chinese
Default: /etc/ansible/hosts
installDependencies:
Label:
en: InstallDependencies
zh-cn: the description in Chinese
Description:
en: 'If set to True,