chef-recipe Questions

2

Solved

How can I rename a file with chef? In the chef doc I found only: create create_if_missing delete touch
Overhasty asked 23/11, 2012 at 11:41

1

Solved

I am trying to execute Ruby logic on the fly in a Chef recipe and believe that the best way to achieve this is with a block. I am having difficulty transferring variables assigned inside the block...
Federative asked 24/5, 2015 at 13:48

3

Solved

I have a chef recipe that installs packages in a loop: pkgs.each do |pkg| yum_package "tools" do package_name pkg action :install end end This recipe is however throwing the following error:...
Mitchelmitchell asked 22/5, 2014 at 12:39

1

Solved

I'm looking to automate my cloud environment fairly soon using Chef so it can automatically scale instances and add them to HAProxy. One issue I'm having is with the concept of managing multiple vi...
Stouthearted asked 30/4, 2015 at 9:24

1

Solved

Am a newbie to chef and trying out various options. If a use case is to add multiple nodes to a particular role what is the easiest way to do it? For a single node, I would execute the following c...
Astrophysics asked 17/2, 2015 at 6:52

1

Solved

I have a chef recipe that uses a template to generate and xml document. The location of that document on the file system is not important; the location simply needs to be handed to a command line t...
Sleek asked 17/12, 2014 at 12:56

1

Solved

I am following exact syntax but seeing some strange behavior while adding role to one of my nodes I am running following command which should ideally add role - webserver to do_node knife node ru...
Upcountry asked 28/10, 2014 at 18:18

1

Solved

I am attempting to create my first Chef recipe with Vagrant and have run into an issue at the very first step. The first line of my recipe is: include_recipe "apt" But when I try and vagrant pr...
Lully asked 21/9, 2014 at 7:38

1

Solved

When I create attributes in my cookbook's attributes /attributes/default.rb things work fine. If I add a recipe to my cookbook, say /recipes/dofubar.rb, I expect that attributes defined in /attrib...
Southdown asked 26/8, 2014 at 16:1

1

Solved

Quick question. How come whenever I use Berkshelf to manage my cookbook dependencies, my own cookbooks get frozen? Is there a way to unfreeze it? knife cookbook upload myNodeApp Uploading myNodeA...
Delaware asked 24/7, 2014 at 16:55

2

Solved

Trying to figure out the best approach for a large project. When is it appropriate to add recipes within a recipe by using include_recipe as opposed to adding the recipe to the run_list? Is there a...
Pappas asked 5/6, 2013 at 18:36

1

Solved

I am new to all this but I am guessing I will be using SSH keys ... but how? git '/home/vagrant/foo' do repository '[email protected]:/usr/git/app.git' reference 'master' action :sy...
Davisdavison asked 13/5, 2014 at 1:0

2

Solved

Cookbook A provides a LWRP that I would like to extend with a LWRP or HWRP in cookbook B, so that I could do something like the following, where provider_b would use the existing code/resources in ...
Abortionist asked 15/1, 2014 at 16:50

3

I have a very basic Vagrantfile, and when I call 'vagrant up' for the first time (after destroying the box) I get the error below just about every time. Any ideas why? I'm at a loss. I'm on OSX. V...
Bercy asked 15/9, 2013 at 3:4

3

I've been trying to figure out how to get the node's name (knife bootstrap -N) into a template. I've tried a dozen different ideas and haven't found anything that works yet. Does anyone know how to...
Beat asked 16/10, 2011 at 0:40

2

Solved

I have this attribute defined in my default attributes file: default['remote_machine']['user']['file_name'] = '/folder/path/file_name.html' And I am trying to reference this attribute name in a ...
Misapprehend asked 22/11, 2013 at 11:47

1

Solved

In a recipe I want to check to see if a service is installed, and if it is not notify the 3 resources needed to install it. I tried the service resource, which correctly identifies the service when...
Cobbs asked 21/11, 2013 at 20:59

1

Solved

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? do...
Perihelion asked 26/6, 2013 at 21:13

1

Solved

I am running a chef recipie to install Websphere fixpacks. The fixpack retuns and exitcode [2] which is for partial install. Its an expected behaviour, but chef is just taking it as an error. Is th...
Steele asked 7/6, 2013 at 2:22

1

Solved

Here is an example of a working recipe that loops through an array of website names and creates them in IIS using the function createIisWebsite(). def createIisWebsite(websiteName) iis_site websi...
Terrier asked 7/5, 2013 at 17:27

2

Solved

What's the best way to do a little DRY within a chef recipe? I.e. just break out little bits of the Ruby code, so I'm not copying pasting it over and over again. The following fails of course, wit...
Tamis asked 24/3, 2013 at 4:25

1

Solved

I'm using Vagrant and chef-solo to test my cookbooks, but I have one particular recipe that requires chef-server (it uses search). I'd like my default recipe to look like the following: include_re...
Arctic asked 9/3, 2013 at 0:38

1

Solved

I have templates with variables. these variables are in databags and and depend on the environment. Example: # Template address =$foo # Environment: develoment # Databag: $foo = "sdfsdf" How d...
Draft asked 18/2, 2013 at 7:22

1

How can I get IP address returned by node search in chef recipe (ruby). dbnodes = search(:node, "role:Db") Chef::Log.info(dbnodes.first["ipaddress"]) # nil Few weeks ago this code returned IP o...
Catamaran asked 12/11, 2012 at 0:52

1

Solved

How to create a data bag from a recipe and avoid the exception when that data bag already exists? The documentation shows that creating a data bag is done like this: new_databag = Chef::DataBag.n...
Anyplace asked 15/7, 2012 at 7:32

© 2022 - 2024 — McMap. All rights reserved.