Questions tagged [cookbook]

A cookbook is the fundamental unit of configuration and policy distribution in Chef.

510 questions
0
votes
2 answers

Using a script that requires user input with chef cookbook with vagrant

I'm writing a custom Asterisk chef cookbook where I need to run this script bash 'create asterisk keys' do user 'root' cwd File.dirname(source_path) code <<-EOH cd asterisk-#{node.version}* ./contrib/scripts/ast_tls_cert -C…
jeremywoertink
  • 2,281
  • 1
  • 23
  • 29
0
votes
1 answer

Apache cookbook fail to start

I have followed the steps from Opscode Youtube video to create apache cookbook. ~/chef-repo/cookbooks/apache/recipes/default.rb package "apache2" do action :install end service "apache2" do action [:enable, :start] end cookbook_file…
user4136080
  • 165
  • 1
  • 6
  • 21
0
votes
1 answer

RubyMine does not version two of my project folders

So I have a project that also uses Vagrant, which installs cookbooks into my project. Under the cookbooks folder I have various cookbooks like one for PostgreSQL and etc.. Now I am versioning that cookbook folder also to my repository. But there is…
Kaspar
  • 1,600
  • 4
  • 24
  • 46
0
votes
3 answers

How to pass hash password from ruby-block to user resource

I am trying to implement a cookbook which would create users by reading passwords from attributes file ( non hash password ex: root@123) And for this, my cookbook is as follows : Contents of attributes file ( attributes/attr.rb…
0
votes
2 answers

LWRP pure ruby code vs other cookbook resources execution order

I'm having troubles trying to understand what's going on, why pure ruby code is executed first despite that the code is put last, this is a part of what the action :install contains: action :install do ... windows_package…
JGutierrezC
  • 4,398
  • 5
  • 25
  • 42
0
votes
1 answer

Dynamic resource grouping together recipe actions

I have a set of related operations which I would like to group inside a dynamic resource. Something like this: # ... somewhere inside my_cookbook/recipes/foo.rb resource "Initialize git repo inside /etc" do not_if { File.exists?('/etc/.git') } …
SystematicFrank
  • 16,555
  • 7
  • 56
  • 102
0
votes
1 answer

How are Chef attributes stored internally

I know where all we can define the chef attributes, attribute types and also their precendence levels. I just want to understand how they are stored internally. Suppose I declare an attribute default[:app][:install] = "/etc/app" 1) How is it…
sun_dare
  • 1,146
  • 2
  • 13
  • 33
0
votes
1 answer

Chef set DocumentRoot in httpd recipe

Using https://community.opscode.com/cookbooks/httpd/versions/0.1.5 Does anyone know how to set DocumentRoot ? Property ? I'm currently using httpd_service "default" do listen_ports ['81'] action :create end which produces ServerName…
MikePatel
  • 2,593
  • 2
  • 24
  • 38
0
votes
2 answers

Getting recipe list through chef server api

I want to get the recipes that a cookbook contains, through chef-server-api. Following is the code I'm using for getting the cookbook list, individual cookbook details through the api : require 'rubygems' require 'chef/config' require…
tortuga
  • 737
  • 2
  • 13
  • 34
0
votes
1 answer

chef-jira cookbook - Cookbook apache2 not found

I have downloaded the cookbook "chef-jira" and now I am trying to run it using chef-solo/vagrant on Ubuntu 12.04. After a lot of googling and stackoverflow support i was able to get the json file picked up which defines the run lists. But the below…
Liora Milbaum
  • 99
  • 1
  • 1
  • 7
0
votes
1 answer

Cookbook to run .bat file with parameters

I have a .bat script for a deployment task. I it is needed to run with some parameters for the correct work, smthg like this: script.bat -x=param1 -b=param2 -c=param3 ( this is how it looks in cmd on windows ) How do I correctly specify the cookbook…
SilliS
  • 175
  • 2
  • 12
0
votes
2 answers

Installing Tomcat6 using Opscode cookbook on CentOS 5.10

I'm trying to install tomcat6 using opscode chef cookbook. I get following error. Recipe: tomcat::default * package[tomcat6] action install * No version specified, and no candidate version available for…
TechCrunch
  • 2,924
  • 5
  • 45
  • 79
0
votes
1 answer

How to manage redundancy in Chef-repo and berkshelf cookbooks

I am using Chef for automation. I have a chef-repo cookbook that has custom cookbooks as well as cookbooks from the opscode site. As few cookbooks have dependency on other cookbooks I have installed those dependencies using berks utility. Now my…
user3086014
  • 4,241
  • 5
  • 27
  • 56
0
votes
3 answers

Chef tutorial doesn't need apache2 cookbook?

In the Chef legacy Apache tutorial there is no reference to any dependency on the apache2 cookbook, yet the tutorial seems to work and install Apache without it. When learning Chef, I found this to be confusing because when I went to create my…
Ken Liu
  • 22,503
  • 19
  • 75
  • 98
0
votes
1 answer

How to install pytest using chef

I have downloaded the python cookbook from opscode using the knife cookbook download site command. I ran it with chef-solo on ubuntu and it works perfectly fine. I also need pytest installed. I don't seem to find a cookbook for pytest on opscode.…