cookbook

How to query cookbook versions on a node?

橙三吉。 提交于 2019-12-03 10:18:44
Usage case: The DevOps team launched a node sometime ago, and my team would like to know what's the version(s) of one/several cookbook(s) being used in the run_list. Our DevOps team is firefighting so we'd like to find a way to be self-sufficient. Commands Tried: knife cookbook show COOKBOOK give all possible versions, but does not specify which one being used. knife node show NODE shows all cookbooks, but there's no version info attached. Question: Is there a command (something similar to knife search , ohai ) to query the chef-server for the versions deployed on the node? Tejay Cardon If you

Chef Ruby loop over attributes in an .erb template file

不打扰是莪最后的温柔 提交于 2019-12-03 08:19:23
So this might be a little confusing but bear with me. In short I want to loop over all attributes with a certain key value and then insert them into a template if the values are not empty. Here is my code: ATTRIBUTES: # === Default file Configurations # default['elasticsearch']['default']['ES_USER'] = '' default['elasticsearch']['default']['ES_GROUP'] = '' default['elasticsearch']['default']['ES_HEAP_SIZE'] = '' default['elasticsearch']['default']['MAX_OPEN_FILES'] = '' default['elasticsearch']['default']['MAX_LOCKED_MEMORY'] = 'unlimited' default['elasticsearch']['default']['MAX_MAP_COUNT'] =

How run cookbook with dependencies in chef?

a 夏天 提交于 2019-12-02 08:16:02
问题 I have configured workstation up this step in get started (OS redhat 6.5). I have launched a node. I modified a cookbook like that: myCookbook/metadata.rb name 'myCookbook' maintainer 'YOUR_COMPANY_NAME' maintainer_email 'YOUR_EMAIL' license 'All rights reserved' description 'Installs/Configures myCookbook' long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) version '0.1.0' depends 'maven' E.g. only depends 'maven' string was added after knife cookbook create myCookbook

How run cookbook with dependencies in chef?

空扰寡人 提交于 2019-12-02 05:13:41
I have configured workstation up this step in get started (OS redhat 6.5). I have launched a node. I modified a cookbook like that: myCookbook/metadata.rb name 'myCookbook' maintainer 'YOUR_COMPANY_NAME' maintainer_email 'YOUR_EMAIL' license 'All rights reserved' description 'Installs/Configures myCookbook' long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) version '0.1.0' depends 'maven' E.g. only depends 'maven' string was added after knife cookbook create myCookbook was executed. myCookbook/recipes/default.rb maven 'spring-context' do group_id 'org.springframework'

how to require my library in chef ruby_block

本秂侑毒 提交于 2019-11-30 11:29:37
I'm developing a cookbook to deploy a simple ROR application. I write an app_helper.rb and put it into the libraries directory of my cookbook, here is the content: module AppHelper def self.find_gem if File.exists?("/usr/local/rvm/bin/rvm") return `/usr/local/rvm/bin/rvm default exec which gem`.chomp else return "/usr/bin/gem" end end end In the recipes/default.rb, I mix in the above module into Chef::Recipe class class Chef::Recipe include AppHelper end As you know, the find_gem function can be called from anywhere of the recipe. when I'm trying to use the find_gem function in my ruby_block

How can I use my sql knowledge with Cloudant/CouchDB?

巧了我就是萌 提交于 2019-11-27 04:07:24
Some developers who have a good knowledge of querying SQL databases struggle to implement the equivalent query patterns in Cloudant/CouchDB. How can these developers translate their SQL knowledge to Cloudant/CouchDB? Chris Snow This community wiki page provides links to some SQL patterns showing how they may be implemented in Cloudant. As this is a community wiki feel free to add new Q&A links here. General database queries Joining two documents by key? How do I do the SQL equivalent of “DISTINCT” in CouchDB? How do I do a triple join in CouchDB? Inner joining by document field? How do I do

How can I use my sql knowledge with Cloudant/CouchDB?

我们两清 提交于 2019-11-26 11:03:24
问题 Some developers who have a good knowledge of querying SQL databases struggle to implement the equivalent query patterns in Cloudant/CouchDB. How can these developers translate their SQL knowledge to Cloudant/CouchDB? 回答1: This community wiki page provides links to some SQL patterns showing how they may be implemented in Cloudant. As this is a community wiki feel free to add new Q&A links here. General database queries Joining two documents by key? How do I do the SQL equivalent of “DISTINCT”