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
1
vote
1 answer

Chef shell script interaction

I have a recipe in Chef that uses execute commands to connect to a repository and install a daemon, then configure and start it. Whenapt-get install runs, it requires user confirmation (Y/N input) to continue after it determines how much space is…
caroline
  • 291
  • 5
  • 12
1
vote
0 answers

Knife command output in human readable format

So I am trying to get filesystem sizes using a knife command as below. As is, I can see the sizes in kb; is there a way I can convert them to human readable values (Mb or Gb) in knife commands itself? Or may be parse and then convert? My First…
maverick
  • 266
  • 4
  • 18
1
vote
0 answers

Chef Inspec - How to Read Custom Properties in Files

I'm currently using Chef Inspec and want to read the content within some of my SH files. How can I get ChefInspec to read some of the properties contained within them: Ex: ex_sh_file = location/ex_file.sh' describe bash(ex_sh_file) do it { should…
Dodkm
  • 11
  • 2
1
vote
2 answers

in ruby/chef, what is the difference between "end if" and only_if"?

In chef (therefor, ruby), I've seen two ways of declaring conditionals resource 'foo' do echo "Ubuntu" end if node['platform'] == 'ubuntu' and resource 'foo' do echo "Ubuntu" only_if node['platform'] == 'ubuntu' end Don't these effectively…
Evan R.
  • 1,210
  • 1
  • 27
  • 42
1
vote
1 answer

How to dynamically feed hash array object to Chef ERB template resource

Trying to configure multiple yum repos using an array as the source in Chef using the Template resource. Some repos have includpkgs or exclude parameters. Some are targeting mirrors most target a single baseurl. In short, the repos definitions are…
1
vote
0 answers

How does one install a gem that a chef library (not a recipe) requires?

I have a cookbook foo that provides functionality as a library (and has no recipes). This functionality requires rest-client (which used to be built-in to earlier Chef versions, but was removed). The obvious answer is to add a gem 'rest-client' to…
cbmanica
  • 3,502
  • 7
  • 36
  • 54
1
vote
2 answers

Chef - ERROR: RuntimeError: Please set EDITOR environment variable--while create role in chef

I'm new to Chef. Today, while study role in chef, I created a test role rb file -- name "reposerver" description "repo server for sles12.4,12.5" run_list "recipe[e]" Then I run knife command to create this role, but failed with…
EisenWang
  • 189
  • 1
  • 10
1
vote
1 answer

how to pass parameters to template in chef?

I just started to study chef. These days, I'm testing the sample of templates on -- https://docs.chef.io/resources/template/ But I failed all the times ... Here's my code -- I created a cookbook named sample, and created a recipe named…
EisenWang
  • 189
  • 1
  • 10
1
vote
1 answer

Refer to method from containing scope in resource in chef recipe

In a chef recipe I define a helper method like: def my_service_config(description, args="") { Unit: { Description: description, }, Service: { Type: 'simple', ExecStart: "/usr/sbin/my-service-script #{args}", …
Thayne
  • 6,619
  • 2
  • 42
  • 67
1
vote
0 answers

unable to run a cookbook chef

I'm trying to run my cookbook "example" but I'm not able to. I'm testing it before running it on my node machines and I'm getting this error below. Here is my list of dependecy which I believe should be correct. I have a cookbook example and a…
cber11
  • 35
  • 3
1
vote
0 answers

Knife bootstrap pass environment variable

I want to pass environment variables to the remote system I am bootstrapping but I am unable to do so. Usecase: Recipes which I am using needs artifactory username and password to download the artifacts. Example : curl -u…
1
vote
1 answer

Can we automate updating the chef node attributes?

I have a node with the following json in chef nodes: { "name": "app-node-01", "chef_environment": "dev", "run_list": [ "recipe[hello-world]" ], "normal": { "app_version": "1.0.0", "tags": [ ] } } I am trying to look for a…
user3379502
  • 223
  • 4
  • 22
1
vote
0 answers

Chef apt_repository started failing with SSL verification errors for "'apt_repository[openjdk-r-ppa]'"

I'm using chef for Jenkins slaves and chef-client execution is failing on apt_repository resource. using java cookbook from marketplace version 3.1.2 Chef-client version: 12.17.44 OS: Ubuntu 16.04 See below error from chef-client execution. Recipe:…
Garry
  • 11
  • 2
1
vote
1 answer

Access F12 key function on keyboard that does not have this key

I have a question related to a bloetooth keyboard I bought, and I would be very grateful if anyone can help me. This keyboard doesn't have the F12 key, so I was wondering if it's possible to access the same function as the F12 through some…
1
vote
1 answer

symbolic link not working with chef recipe

I want to create symbolic link only if its not present I have written below recipe link '/home/user1/veera' do to '/usr/local/veera-10.0' only_if {test -L /home/user1/veera} end I tried below condition in recipe only_if {test -L…
AWS_Lernar
  • 627
  • 2
  • 9
  • 26
1 2 3
99
100