All Products
Search
Document Center

CloudOps Orchestration Service:ACS::ECS::ApplyAnsiblePlayBook

Last Updated:Jul 31, 2024

Description

Runs an Ansible playbook on an Elastic Compute Service (ECS) instance. Only ECS instances that run CentOS, Alibaba Cloud Linux, or Ubuntu are supported.

Syntax

Action: ACS::ECS::ApplyAnsiblePlayBook
Properties:
 regionId: String
 instanceId: String
 sourceType: String
 sourcePath: String
 playbookFile: String
 tokenInfo: String
 hosts: String
 installDependencies: Boolean
 workingDir: String
 check: Boolean
 extraVariables: String
 verbose: String

Attributes

Attribute

Description

Type

Required

Default Value

Limit

regionId

The region ID.

String

No

{{ ACS::RegionId }}

instanceId

The ID of the ECS instance.

String

Yes

sourceType

The storage type of the playbook.

String

Yes

sourcePath

The URL of the playbook. You can specify the URL in the following format: https://example.com/playbook.yml.

String

Yes

playbookFile

The name of the playbook to be run. Example: example.yml.

String

Yes

tokenInfo

The token that is used to download the playbook. A token is required only if you download the playbook from GitHub.

String

No

hosts

The hosts that are used to run the playbook.

String

No

/etc/ansible/hosts

installDependencies

Specifies whether to install dependencies. If you set this attribute to True, CloudOps Orchestration Service (OOS) installs Ansible and its dependencies, including Python, from the Python Package Index (PyPI) repository. If you set this attribute to False, OOS checks whether Ansible and its dependencies are installed on the ECS instance.

Boolean

No

True

workingDir

The directory in which the playbook is run.

String

No

/root/ansible-workspace

check

Specifies whether to perform a dry run of the Ansible playbook in check mode.

Boolean

No

True

extraVariables

The extra variables that are passed to Ansible at runtime. Specify the variables as a list of key-value pairs separated with spaces. Example: color = red flavour = lim.

String

No

color=red

Regular expression for string verification: ^$

verbose

The verbosity level that is used to record the process during which the playbook is run. A value of -v specifies a low level, a value of -vv or -vvv specifies a medium level, and a value of -vvvv specifies a debug level.

String

No

-v

Output

Output item

Description

Type

commandOutput

String

References

For more information, see ACS::ECS::ApplyAnsiblePlayBook.yml at GitHub.