Questions tagged [chef-infra]

Chef Infra (formerly just Chef) is a DevOps tool for scripting server configurations in Ruby (called cookbooks). Questions should pertain to the Ruby portions of coding. General DevOps questions may be asked on https://devops.stackexchange.com

Chef Infra (formerly just called Chef) is a systems integration framework from Chef Software (formerly Opscode) that allows you to describe the configuration of systems and infrastructure in code. It brings the benefits of configuration management to your entire infrastructure.

Chef is available as Open source and also contains solutions for both small and large scale systems, with features and pricing for the respective ranges.

Chef configuration management software written in Ruby and Erlang. It uses a pure-Ruby, domain-specific language (DSL) for writing system configuration recipes. Chef is used to streamline the task of configuring and maintaining servers, and can integrate with cloud-based platforms such as Internap, Amazon EC2, Google Cloud Platform, Oracle Cloud, OpenStack, SoftLayer, Microsoft Azure, and Rackspace to automatically provision and configure virtual machines.

Using Chef, you write cookbooks which describe the desired state of your systems and infrastructure. You then define roles, which are collections of cookbooks and attributes to be applied, and apply them to your systems.

The end result is the ability to build a system or your complete infrastructure in a fully automated fashion. To bring up a new system, you simply tell it what roles you want it to have and Chef does the rest.

Chef has 4 products that satisfies various needs of an Organisation,

  1. Chef Infra - Infrastructure automation to provision, harden and maintain configuration state.
  2. Chef InSpec - Security and Compliance automation in any environment, on any platform.
  3. Chef Habitat - Automate application dependency management to run apps at scale anywhere.
  4. Chef Automate - Provides operational visibility and organizational collaboration for everything you automate.

If you are reporting an issue, please use Chef's ticket tracker instead of StackOverflow!

Resources

Related Tags

6507 questions
36
votes
1 answer

chef install and update programs from source

I have a program that I build from source. For this I'm using the script resource. What is a good way to implement the logic for installation and update? Right now I just have installation implemented with the built-in not_if conditional. script…
m33lky
  • 7,055
  • 9
  • 41
  • 48
36
votes
2 answers

How is deployment to Production done from local VirtualBox / Vagrant development environment?

Recently I started to read about building development environments with virtualization software (I am a beginner) and it seems that 'infrastructure as a code' is a really powerful concept. I really like the workflow structure described here: The…
skanatek
  • 5,133
  • 3
  • 47
  • 75
35
votes
5 answers

How can you use a Chef recipe to set an environment variable?

How can you use a Chef recipe to set an environment variable? I need to set an environment variable using a Chef recipe. Can you provide an example of how to accomplish this?
Brandon
  • 6,832
  • 11
  • 38
  • 50
35
votes
11 answers

Chef - ERROR: RuntimeError: Please set EDITOR environment variable

I've installed successfully chef on my workstation but when i am trying to create a role using the following command knife role create startmeup I get ERROR: RuntimeError: Please set EDITOR environment variable Any idea what the problem is?
GigaPr
  • 5,206
  • 15
  • 60
  • 77
34
votes
2 answers

Change Vagrant port forwarding on a running system

I have a Vagrant system up and running and I want to apply a change to it which is as little as changing one of the forwarding rules. From this page: Forwarded ports are applied during vagrant up like any other configuration. But if you already…
Roberto Aloi
  • 30,570
  • 21
  • 75
  • 112
33
votes
1 answer

Default search path for cookbook

I am a chef Newbie and facing an issue. Every time I run any of the knife cookbook command, I have to explicitly provide the path to cookbook using -o /path/to/cookbook else it will error out saying no cookbooks found. Please find below commands: $…
slayedbylucifer
  • 22,878
  • 16
  • 94
  • 123
31
votes
3 answers

chef-solo ssl warning when provisioning

When using vagrant and chef as provisioner, I've got this warning: [web] Chef 11.12.2 Omnibus package is already installed. [web] Running provisioner: chef_solo... Generating chef JSON and uploading... Running chef-solo... stdin: is not a…
holms
  • 9,112
  • 14
  • 65
  • 95
31
votes
6 answers

Rabbit - Error: mnesia_unexpectedly_running

I am trying to cluster rabbit using chef Here is my error. I shutdown all of rabbit on the second node. rabbitmqctl join_cluster --ram rabbit@ip-10-158-xxx-xxx Error: mnesia_unexpectedly_running So..what is the deal? I tried this from…
Tampa
  • 75,446
  • 119
  • 278
  • 425
29
votes
3 answers

Chef, how to run a template that creates a init.d script before the service is created

Below is my templete for nginx. I am facing a catch 22. I need to install a init.d template. So I have a nginx erb template that I place in /etc/init.d/nginx. I Even tried t place the code on top of the recipe. The recipe is dependent on the…
Tampa
  • 75,446
  • 119
  • 278
  • 425
29
votes
3 answers

Choosing a vagrant provisioner

Question Can anyone explain why it would be better to choose the puppet or chef vagrant provisioners, rather than the shell provisioner? Background I'm in the process of getting started with Vagrant. One of the things I'm having trouble with is…
Andrew Walker
  • 40,984
  • 8
  • 62
  • 84
29
votes
1 answer

What does `Chef::Config[:file_cache_path]` do exactly?

First off, I apologize for asking such a dumb question. But the reason I ask is because I'm having a hard time finding an answer. I've tried searching Chef's docs, but I have not found a clear explanation. So what exactly…
switchflip
  • 403
  • 1
  • 5
  • 13
29
votes
1 answer

Advantages of a deployment tool such as Ansible over shell

Currently I have all of my deployment scripts in shell, which installs about 10 programs and configures them. The way I see it shell is a fantastic tool for this: Modular: Only one program per script, this way I can spread the programs across…
Jimmy
  • 12,087
  • 28
  • 102
  • 192
29
votes
4 answers

How can I change a file with Chef?

I have 7 files and 1 war. I need to change values when I deploy them. I have this: ##usuario #alfresco.user=***** alfresco.user=******** ##pass #alfresco.password=…
28
votes
2 answers

Understanding Chef only_if not_if

Im not sure I understand Chef conditional execution. I'd like to do some conditional execution based on whether or not a database exists in Postgresql So here's my example execute "add_db" do cwd "/tmp" user "dbuser" command "createdb -T…
a.m.
  • 2,108
  • 5
  • 24
  • 29
28
votes
2 answers

Which special characters need escaping in a solr query?

Update: I think this question has to do with solr syntax in general, and not Chef in particular. So while I ran into this working with Chef, I presume that anyone working with Solr will also experience this... I'm working on an application that…
hairyhenderson
  • 577
  • 1
  • 7
  • 20