简体   繁体   English

aws opsworks cli运行食谱并捕获食谱输出

[英]aws opsworks cli run cookbook and capture cookbook output

I am trying to execute a recipe via AWS opsworks cli it is working without any problem. 我正在尝试通过AWS opsworks cli执行配方,该配方可以正常工作。 The problem is it is returning "DeploymentId" as output. 问题是它返回“ DeploymentId”作为输出。 I am executing the following command- 我正在执行以下命令-

aws opsworks create-deployment --stack-id c7cxxxxx-efxx-xxxx-xxxx-1dexxxxxxc78 --command {"Name":"execute_recipes", "Args":{"recipes":["cookbook::recipes"]}}

Output- 输出-

{ "DeploymentId": "824749ec-7e20-42ca-89c5-6646cf0c863c" } {“ DeploymentId”:“ 824749ec-7e20-42ca-89c5-6646cf0c863c”}

I want to get the opsworks instances chef deployment output - like - 我想获取opsworks实例Chef部署输出-

[2017-03-14T00:06:50-04:00] INFO: Starting chef-zero on port 8889 with repository at repository at /opt/aws/opsworks/current
One version per cookbook
data_bags at /var/lib/aws/opsworks/data/data_bags
nodes at /var/lib/aws/opsworks/data/nodes
[2017-03-14T00:06:50-04:00] INFO: Forking chef instance to converge... [2017-03-14T00:06:50-04:00] INFO: *** Chef 11.10.4 *** [2017-03-14T00:06:50-04:00] INFO: Chef-client pid: 28634 [2017-03-14T00:06:50-04:00] INFO: Setting the run_list to ["opsworks_custom_cookbooks::load", "opsworks_custom_cookbooks::execute"] from JSON [2017-03-14T00:06:50-04:00] WARN: Run List override has been provided. [2017-03-14T00:06:50-04:00] WARN: Original Run List: [recipe[opsworks_custom_cookbooks::load], recipe[opsworks_custom_cookbooks::execute]]

Is there any way possible? 有什么办法吗? I am testing this from a Jenkins and want to capture the chef-log. 我正在从Jenkins进行测试,并想获取厨师日志。

Thanks to @Tensibai. 感谢@Tensibai。 aws opswork describe-deployment Link will give you the required help. aws opswork describe-deployment 链接将为您提供所需的帮助。 For eg- 对于例如

aws opsworks describe-commands --deployment-id axxxxxxxxx-3xxxxxxx -4xxx-8xxxxx-9xxxxxxx

This will give you the result. 这将为您提供结果。 where you can featch the result from linked s3 location. 您可以在其中链接的s3位置获取结果。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM