cookbook

understand how opsworks and custom cookbooks work together

无人久伴 提交于 2019-12-12 03:58:35
问题 I have my stack on opsworks and app is deploying fine (cake php). Now I have to configure some things like chmod, php versions, etc etc... I'm reading about this but don't know exactly whats the best way to do this. Question 1 - Should I do this with custom deploy JSON or via custom cookbooks? Question 2 - Whats the correctly way to work with custom cookbooks? Fork original AWS repositories, update recipes and then use it in my stack? 回答1: depends on what you would like to achieve, you may

Chef: reading attribute value from shell environment variables

会有一股神秘感。 提交于 2019-12-11 16:41:05
问题 I am trying to read value of an environment variable in attributes file of chef cookbook. Many posts have described that i can use ENV[] of ruby to achieve what i want. My attributes file looks something like this default['some_object']['some_attribute'] = ENV['SOME_ENV_VAR'] While running recipe, it seems to result in empty string. Any pointers? 回答1: assume that what you describe is the right way to do so (which is not), note that you need to set the environment variable on the node where

Installing SQL Server 2014 using chef community cookbook (sql_server)

◇◆丶佛笑我妖孽 提交于 2019-12-11 04:00:02
问题 I've had a look at the chef community cookbook for installing sql server and it appears that it's tailored for installing SQL express, but I can't seem to work out how to install a standard or developer edition. The README on the GitHub page (https://github.com/chef-cookbooks/sql_server) says you can just point it to any installation package, however I can't see how you would do this for an ISO (or even the extracted contents of an ISO) given that there's no single EXE package on the ISO

How to query cookbook versions on a node?

老子叫甜甜 提交于 2019-12-09 08:04:04
问题 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

Installing a gem after native extension packages during chef execution

孤者浪人 提交于 2019-12-06 03:44:04
问题 I am trying to install the fog gem in a chef recipe though the gem installation occurs before the native packages are being installed so the gem installation fails package "libxslt-dev" package "libxml2-dev" chef_gem "fog" This is the output [Thu, 14 Mar 2013 13:04:30 +0000] INFO: Processing chef_gem[fog] action install (ebs4000::update_volumes line 23) [Thu, 14 Mar 2013 13:04:52 +0000] ERROR: Running exception handlers [Thu, 14 Mar 2013 13:04:52 +0000] FATAL: Saving node information to /var

Vagrant - how to print Chef's command output to stdout?

旧时模样 提交于 2019-12-06 02:26:05
问题 If we have in Chef cookbook code like: if !File.exists?('/vagrant/project/target/project/WEB-INF") || node[:compile_project] bash "build project" do user "vagrant" cwd "/vagrant/project" code <<-EOH mvn clean mvn db-migration:migrate mvn package EOH end end When run vagrant up we can see only brief information that 'build project' is executed. However wen we run 'mvn package' command from terminal we can see full command output. How to tell Vagrant/Chef to show full output? EDIT: I've tried

chef rewind cookbook_file definition from a wrapper cookbook recipe

佐手、 提交于 2019-12-04 21:33:01
I am using an cookbook github.com opscode-cookbooks/openldap. I wrote an wrapper cookbook "lab_openldap" that includes "openldap::server" recipe. The server.rb recipe uses following clausule to upload the PEM file from cookbooks files/ssl/*.pem to server to the location node['openldap']['ssl_cert']. if node['openldap']['tls_enabled'] && node['openldap']['manage_ssl'] cookbook_file node['openldap']['ssl_cert'] do source "ssl/#{node['openldap']['server']}.pem" mode 00644 owner "root" group "root" end end The PEM is tried to be read from "openldap" cookbook file/ssl/#{node['openldap']['server']}

Chef Ruby loop over attributes in an .erb template file

我的梦境 提交于 2019-12-04 14:01:29
问题 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

Vagrant - how to print Chef's command output to stdout?

大兔子大兔子 提交于 2019-12-04 08:40:51
If we have in Chef cookbook code like: if !File.exists?('/vagrant/project/target/project/WEB-INF") || node[:compile_project] bash "build project" do user "vagrant" cwd "/vagrant/project" code <<-EOH mvn clean mvn db-migration:migrate mvn package EOH end end When run vagrant up we can see only brief information that 'build project' is executed. However wen we run 'mvn package' command from terminal we can see full command output. How to tell Vagrant/Chef to show full output? EDIT: I've tried this but nothing has changed in output. config.vm.provision :chef_solo do |chef| chef.log_level = :debug

Installing a gem after native extension packages during chef execution

天大地大妈咪最大 提交于 2019-12-04 07:25:50
I am trying to install the fog gem in a chef recipe though the gem installation occurs before the native packages are being installed so the gem installation fails package "libxslt-dev" package "libxml2-dev" chef_gem "fog" This is the output [Thu, 14 Mar 2013 13:04:30 +0000] INFO: Processing chef_gem[fog] action install (ebs4000::update_volumes line 23) [Thu, 14 Mar 2013 13:04:52 +0000] ERROR: Running exception handlers [Thu, 14 Mar 2013 13:04:52 +0000] FATAL: Saving node information to /var/cache/chef/failed-run-data.json [Thu, 14 Mar 2013 13:04:52 +0000] ERROR: Exception handlers complete