chef

Vagrant: Unknown configuration section 'omnibus' but vagrant-omnibus plugin is installed

谁都会走 提交于 2019-12-10 16:58:30
问题 I've followed the instructions at: http://berkshelf.com/ after installing the latest ChefDK (from here: http://downloads.getchef.com/chef-dk/mac/#/). When I do "vagrant up", I get the error: Vagrant: * Unknown configuration section 'omnibus'. Various posts (e.g. Vagrant Install chef-client on top of base image) have suggested this means that the vagrant-omnibus plugin is not installed. In my case, I have installed it. "vagrant plugin list" displays: vagrant-berkshelf (2.0.1) - Version

How to set a timeout in deploy_revision provider?

有些话、适合烂在心里 提交于 2019-12-10 15:53:42
问题 I found a situation when chef had generated Chef::Exceptions::CommandTimeout exception in git clone command. Sometimes the time of git clone could be more than 10 minutes. How to set the timeout value for such situations in chef recipe? 回答1: Timeout for the git provider seems to be fixed now. Checkout the code at: https://github.com/opscode/chef/blob/master/lib/chef/provider/git.rb#L292 So for the git resource you can just add the timeout attribute, i.e.: git /var/www do repository

How to get a full path of the running cookbook in the RightScale chef recipe?

那年仲夏 提交于 2019-12-10 15:53:32
问题 From inside my currently executing cookbook recipe I'd like to get access to it's "current" location on my executing machine. I need this to get access to it's cached directory structure. I have a feeling it's located somewhere inside "node[]" but I can't find any documentation about its structure at all. Any advise? Thanks 回答1: Just found the solution by inspecting the "run_context" instance: ruby_block "reload_client_config" do block do puts "HERE!!!!! -> " + run_context.cookbook_collection

How can I find the disk available in a Chef recipe?

只愿长相守 提交于 2019-12-10 15:31:49
问题 While a Chef recipe is executing, I want to determine if there is sufficient free disk space available to perform an operation. How best to do this? 回答1: Ohai detects certain properties of a a node each time it is run. These properties are captured as automatic attributes and are available to you as node attributes. The attribute node['filesystem'] contains information about each of the devices on your system. To get the space available in kb, for a specific device: node['filesystem']['/dev

Chef node - check if recipe will run on it, looking inside roles as well

南笙酒味 提交于 2019-12-10 14:59:55
问题 I want to find out if a specific recipe will be run on a node from inside a different recipe. I can node.recipe?(recipe_name) method, however some of my recipies are managed by roles and recipe? does not seem to look into the roles run list. Is there an easy way to find out if my recipie[redis] is going to be run on the current node? 回答1: You're looking for the recipes method. Note the trailing s ! So: node.recipes.include?(recipe_name) Also note that there is a similar pair of methods for

Getting started with chef, and running composer install on deploy

折月煮酒 提交于 2019-12-10 13:53:34
问题 We're looking to deploy a few Laravel4 based PHP apps on amazon with OpsWorks, this requires a few things: Grab code from git Download composer.phar from getcomposer.com Run php composer.phar install Change permissions on a few specific folders I'm completely fresh with it comes to chef, so initially looking for a place to get to grips with the basics of chef, and then how to achieve the tasks above, would appreciate any pointers. 回答1: I'm no Chef guru (I usually use Puppet) but try the

How do I install the knife-ec2 plugin?

扶醉桌前 提交于 2019-12-10 13:11:33
问题 OSX, 10.9.2: $ ruby -v ruby 2.0.0p247 (2013-06-27 revision 41674) [universal.x86_64-darwin13] $ knife -v Chef: 11.10.4 When I run: $ knife ec2 server list I get: FATAL: Cannot find sub command for: 'ec2 server list' The ec2 commands were moved to plugins in Chef 0.10 You can install the plugin with `(sudo) gem install knife-ec2 I have the gem installed: sudo gem install knife-ec2 runs without error. And gem list shows that it is installed: $ sudo gem list|grep knife-ec2 knife-ec2 (0.8.0) The

Executing chef recipe only after another recipe is finished

倾然丶 夕夏残阳落幕 提交于 2019-12-10 12:26:48
问题 I have two recipes in different cookbooks. I need the first recipe to be completely finished before the second one starts execution, as it places some files that the second will need. I put the first one before the second in the run list, but it seems as if they get executed in parallel. How can I trigger the second recipe's execution when the first is done? (Note that they are in different cookbooks.) 回答1: Can you post a snippet of the code. My guess is that you're making use of LWRP

How to have Chef reload global PATH

蓝咒 提交于 2019-12-10 12:16:01
问题 I am setting up a simple Chef recipe to install a binary app. There is no package for it in Ubuntu or CentOS so I'm writing a recipe that does the following: Downloads the tar from source Extracts contents from tar Creates a bash script that adds the app_home to the global $PATH (it needs to be global) Reloads $PATH so the current logged in user can refer to it in the shell commands I am good up to step 3, but I cannot get Chef to reload $PATH. I have tried placing the new export PATH=$PATH:

chef windows_package options to check box

别来无恙 提交于 2019-12-10 12:05:07
问题 Trying to install ImageMagick on a Windows server 2008 R2 machine in a Chef recipe. Works perfectly with the following recipe windows_package 'install imagemagick' do action :install source 'http://www.imagemagick.org/download/binaries/ImageMagick-7.0.3-5-Q16-x64-dll.exe' end However I'm missing an important part. When I run the installer on the machine, I'm give some additional tasks with the install (see image below). I need the Install legacy utilities (e.g. convert) option checked. Can I