草庐IT

chef-client

全部标签

ruby - 属性上的 Chef 错误 - 字符串不匹配

我似乎无法解决处理我的attributes/default.rb文件中类似命名属性的chef错误。我有两个属性:default['test']['webservice']['https']['keyManagerPwd']='password'......default['test']['webservice']['https']['keyManagerPwd']['type']='encrypted'请注意,直到最后一个括号(['type']),名称是相同的。我在模板和配方的模板block中引用这些属性。当我去运行它时,我收到这个错误:========================

ruby - Chef - 使用同一本 Recipe 中的 Recipe

我有Recipebase和Recipemyappbase有2个配方-my_java和java_with_custom_stuff在java_with_custom_stuff中,我想使用my_java的Recipe(相同的Recipe)。像include_recipe'my_java'bash'customstuff'do...end在myapp我做include_recipe"base::java_with_custom_stuff"但它提示找不到my_java有没有办法使用同一本Recipe中的Recipe? 最佳答案 incl

ruby - Capybara-webkit、rspec 集成规范和 xvfb : webkit_server: Fatal IO error: client killed

我正在尝试使用headless(headless)gem、xvfb和用于headless(headless)测试的capybara-webkit来获得在ubuntu服务器CI盒上运行的一套集成规范。一切都在本地开发箱上运行良好,但一旦转移到CI服务器,事情就会变得有趣。在规范助手中有一些代码包装:js在headless(headless)block中启用集成规范,如下所示:config.around(:each,:js=>true)do|example|Headless.ly&exampleend就像我说的,这一切都在本地开发箱上运行良好。在CI上,它使用headless(headle

ruby - Chef 独奏示例

我们正在学习chef-solo,需要一个很好的例子来更好地理解。在网上搜索了很多,但想法很困惑。任何人都可以建议一些例子..以及如何运行它们..我们已经安装了chef-0.8.16gem但无法弄清楚如何使用它..我们正在使用windows平台..它紧急.. 最佳答案 Windows平台支持非常新(version0.8.14),因此它在Windows上配置资源的能力相当有限,直到下一个版本将为该平台添加新的资源提供程序。ChefSolo的一个很好的资源是它的pageontheWiki.您还可以从IRCchannel获得帮助和maili

ruby-on-rails - 如何使用 rest-client gem 发送 header 和 cookie

在代码中,我试图在同一个请求中发送header和cookie下面是代码@result=RestClient.post('url',{:billingSourceCode=>"code"},{:cookies=>{:session_id=>"1234"}},{:headers=>{'Content-Type'=>'application/json',"Authorization"=>"key","Accept"=>"application/json"}})我收到以下错误信息ArgumentError(wrongnumberofarguments(4for3)):

ruby - 如何在 ruby​​_block 中使用另一本 Chef Recipe 中的 Chef 助手库

AWSOpsworks:Chef11.10版,Berkshelf3.2.0版。我不知道如何在RecipeB的ruby_block中使用RecipeA中的帮助程序库。我找到了一个post讨论如何在ruby​​_block和another中包含一个方法讨论如何跨cooking书共享库,但我无法同时工作。cookbookA/libraries/helpers.rbmodulelibraryAmoduleHelpersdeflog(output)Chef::Log.info("#{cookbook_name}:#{recipe_name}:#output}")endendendcookbook

ruby-on-rails - 找不到符号 : _SSLv2_client_method (LoadError)

当我尝试运行服务器时出现以下错误/Users/brijesh/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/openssl.rb:17:in`require':dlopen(/Users/brijesh/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/x86_64-darwin12.5.0/openssl.bundle,9):Symbolnotfound:_SSLv2_client_method(LoadError)Referencedfrom:/Users/brijesh/.rvm/rubies/ruby-

ruby-on-rails - rails client_side_validations 和选择标签

gemclient_side_validations不验证未选择项目的选择标签。可能需要在模型或.erb文件中传递一些参数? 最佳答案 解决方案正在尝试验证存在。尝试验证数值/大于>0。 关于ruby-on-rails-railsclient_side_validations和选择标签,我们在StackOverflow上找到一个类似的问题: https://stackoverflow.com/questions/15845078/

ruby - 使用 google-api-ruby-client '0.9.pre3' 发送 gmail 邮件

在Rails4应用程序中使用较新的google-api-ruby-client发送gmail。require'google/apis/gmail_v1'Gmail=Google::Apis::GmailV1classMailServicedefinitialize(params)@params=paramsenddefcallmessage=Gmail::Message.newservice=Gmail::GmailService.newmessage.raw=(redacted)service.request_options.authorization=current_user.to

ruby - 如何在 Chef 的 ruby​​_block 中调用 Chef 资源?

我正在尝试调用ruby​​_block中的Chef资源。谁能告诉我这段代码有什么问题?file'/tmp/arockia/storage.txt'doendlines=`cat/tmp/arockia/storage.txt|wc-l`ruby_block'Checkforcontent'doblockdolines=`cat/tmp/arockia/storage.txt|wc-l`ifInteger(lines)==0r=Chef::Resource::Execute.new('Get-Disk-Storage',run_context)r.command'df-kh>>/tmp/