Questions tagged [chef-recipe]

A recipe is the most fundamental configuration element in Chef. Recipes specify which resources to manage and the order in which those resources will be applied.

A recipe is the fundamental configuration element in the Chef configuration-management tool. Recipes specify which resources to manage and the order in which those resources will be applied. A recipe:

  • Is authored using Ruby, which is a programming language designed to read and behave in a predictable manner
  • Is mostly a collection of resources in a Ruby syntax with some helper code around it
  • Must define everything that is required to configure part of a system
  • Must be stored in a cookbook
  • May be included in a recipe
  • May use the results of a search query and read the contents of a data bag (including an encrypted data bag)
  • May have a dependency on one (or more) recipes
  • May be tagged to facilitate the creation of arbitrary groupings that exist outside of the normal naming conventions an organization may have
  • Must be added to a run-list before it can be used by the chef-client Is always executed in the same order as listed in a run-list
1255 questions
-1
votes
1 answer

How to run shell built in command like ( source, history) using chef recipe

I want to run shell built in command like ( source , history ) in my chef recipe but its not getting executed and also there is no debug message. I have tried the below, but not successful. #script 'run_full_bldsys' do # interpreter "csh" # code…
NiteshM
  • 17
  • 2
-1
votes
1 answer

Why do I get "unexpected tIDENTIFIER" syntax error in Chef recipe?

This cookbook recipe has a syntax error, but I don't understand why. I cannot upload the cookbook. #below reference information we saw in ohai if node[“platform”] == “ubuntu” execute “apt-get update” do command “apt-get update” …
ficestat
  • 313
  • 1
  • 4
  • 13
-1
votes
1 answer

Chef install package to non default location

I am using chef resource package to install, it always get installed to the default location. Say for example, the code below will install in /etc/httpd package "httpd" do action :install end If I want to have it installed to a custom…
-1
votes
1 answer

chef deployment suggestions/scenerio

quick one .How would you suggest to deploy chef system . Basically we are 3 engineers in our team. We are looking to deploy chef to manage a combination of both ubuntu and redhat servers. Chef-server is setup and running. I am a bit confused on the…
felli fel
  • 53
  • 5
-1
votes
1 answer

Multiple workstation for one chef-server/org

I have a chef server running with a few nodes registered on it . At the moment i have just ONE workstation managing and controlling the nodes with cookbooks written in my chef-repo dir. I have two other engineers i want them to be able to manage the…
felli fel
  • 53
  • 5
-1
votes
1 answer

Running cookbook on a client node

I have a windows node configured . I am using hosted server from opscode.com. I have to run few cookbooks to chef client node. What is the procedure to this cookbook. I am a newbie to this and not finding a proper link also. Please help me with…
user1907849
  • 960
  • 4
  • 19
  • 42
-1
votes
1 answer

Iterate through nodes in Chef

Could someone please help me with documentations or suggestions on how I can iterate through the servers in the nodes folder. I would like to create hosts,hostgroup files etc for nagios using this.
-2
votes
1 answer

How to fix this implicit error in my Ruby code

In this line I am getting error node.default['aem_dispatcher_cookbook']['ip_address'] = nodes.first('ipaddress').to_i getting this error Recipe Compile Error in…
-2
votes
1 answer

AWS Windows CHEF client and Hosted CHEF server connectivity

We have CHEF windows client running(as a Windows service) in AWS Window 2012 server (old version of chef client is already installed and we don't want to change this chef client) In hosted CHEF ,we have an organization and using the validator key…
-2
votes
1 answer

could not find recipe default for cookbook compat_resource

When I run Chef Client, the following exception is thrown: Starting Chef Client, version 12.17.44 resolving cookbooks for run list: ["compat_resource", "tomcat"] Synchronizing Cookbooks: - compat_resource (12.16.3) - tomcat (2.3.4) Installing…
-2
votes
1 answer

chef ruby syntax error while converting hash to yaml

I'm using the mongodb3 cookbook (took from chef supermarket) in my environment. When ever we pass input for mongos template like [10.10.0.10,127.0.0.1] , the output file is created with improper syntax: PFB out put - net: port: 27017 bindIp: !…
-2
votes
1 answer

Chef error after upgrading to Amazon Linux 2016

Ever since I upgraded to Amazon Linux 2016, I get a Chef error where it says it can't find the repository. I haven't changed anything else and on my other instance where I am connecting to the same repository but haven't upgraded the OS, everything…
cubsker
  • 470
  • 5
  • 6
-2
votes
3 answers

How do I comment a line in /etc/sudoers file using Chef Recipe?

I want to comment "Defaults requiretty" line present in /etc/sudoers file using Chef. If it is already commented, the ruby code should skip commenting it. I'm using CentOS 6.7 operating system. So far I have done this in my recipe: files =…
-2
votes
1 answer

How can I write a chef recipe to create a new user and password in the Nodes automatically?

I'm new to chef. Kindly help! I have tried this user "newuser" do password: xyz end and user 'newuser' do comment 'A random user' uid '1234567' gid '1234567' home '/home/saxuser' shell '/bin/bash' password 'newpassword' end
-2
votes
1 answer

Opscode Chef Server / Workstation force commands from server

Background : Chef Server Version 12 and a Windows workstation SDK 0.10 targeting windows nodes I've created recipes and bootstrapped local windows servers into the Chef manager and applied recipes so the very basics are all working. Question : when…
David
  • 21
  • 3
1 2 3
83
84