简体   繁体   English

从 AWS Opsworks Stacks Chef 11 迁移到 Chef 12 - 堆栈属性问题

[英]Migrating from AWS Opsworks Stacks Chef 11 to Chef 12 - stack attributes question

2 questions. 2个问题。 I'm striking out on the AWS docs and forum threads here...我在这里的 AWS 文档和论坛主题中脱颖而出......

When you migrate to opsworks stacks chef12 attributes is no longer available from the node object当您迁移到 opsworks 堆栈时,节点 object 不再提供chef12 属性

"Stack settings are no longer available as Chef attributes, so stack settings can no longer be accessed through the Chef node object. For more information, see the AWS OpsWorks Stacks Data Bag Reference." “堆栈设置不再作为 Chef 属性提供,因此无法再通过 Chef 节点 object 访问堆栈设置。有关更多信息,请参阅 AWS OpsWorks Stacks 数据包参考。” as per the official docs.根据官方文档。

The problem is.问题是。 How can i get at those top level attributes stored in the layers-general settings-custom json?我怎样才能获得存储在层-常规设置-自定义 json 中的那些顶级属性? I know these get passed to the instance b/ci can find that json in /var/chef/runs/{randomstring}/attrib.json BUT that is a level above the databags directory.我知道这些被传递给实例 b/ci 可以在 /var/chef/runs/{randomstring}/attrib.json 中找到 json 但它比 databags 目录高一级。 i can't see anyway to access that as a variable in opsworks/chef.我无论如何都看不到将其作为 opsworks/chef 中的变量进行访问。

Second question, is there any way to access that random chef run directory as a variable in opsworks/chef?第二个问题,有没有办法将随机厨师运行目录作为 opsworks/chef 中的变量访问? if so I can go grab that data easily.如果是这样,我可以 go 轻松获取该数据。

I have seen this: Get Custom JSON from Stack Settings in AWS OpsWorks with Chef 12 but based on my experimenting I can't seem to access those #{node... values in chef12 opsworks stacks.我已经看到了: Get Custom JSON from Stack Settings in AWS OpsWorks with Chef 12但根据我的实验,我似乎无法访问 chef12 opsworks 堆栈中的那些 #{node... 值。

@coderanger you are probably my only hope here. @coderanger 你可能是我在这里唯一的希望。

ps.附言。 is it just me or is opsworks TERRIBLE.是只有我还是 opsworks 很糟糕。 that is all.就这些。

OK.好的。 after continuing to dig - apparently despite what the official Docs say in one place - you CAN still access that top level custom JSON with the original syntax #{node['whateveryourkeyis']}...etc.在继续挖掘之后——显然尽管官方文档在一个地方说了什么——你仍然可以使用原始语法 #{node['whateveryourkeyis']}...等访问顶级自定义 JSON。 The errors I was getting when trying that turned out to be unrelated so, there you go, fwiw you can sill grab that custom json but not the other attributes of applications - those have moved on to the databags.我在尝试时遇到的错误结果是不相关的,所以,go,fwiw 你可以抓住自定义 json 但不是应用程序的其他属性 - 那些已经转移到数据包。

oh, and to answer the other question - yes i'm still pretty sure opsworks IS terrible.哦,回答另一个问题 - 是的,我仍然很确定 opsworks 很糟糕。 change my mind.改变主意。

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

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