chef

How to customise a tomcat recipe in Chef

北城余情 提交于 2019-11-28 14:31:40
I've been trying to customise a tomcat chef recipe but nothing I'm doing seems to change the tomcat installation. I'm using vagrant ie. vagrant destroy && vagrant up In Vagrantfile config.vm.provision :chef_solo do |chef| chef.add_recipe "apt" chef.add_recipe "nginx-app" chef.add_recipe "tomcat-app" end cookbooks/tomcat-app/recipes/default.rb # # Cookbook Name:: tomcat-app # Recipe:: default package "tomcat7" do action :install end cookbooks/tomcat-app/attributes.rb node.default["tomcat"]["port"] = 8083 <-- can't seem to make this apply Thanks, I suspect you're writing your own tomcat cookbook

Chef - how to use a list of attributes in a script

佐手、 提交于 2019-11-28 14:04:00
问题 I'm newbie in Chef and I want to execute a script to add users in my system. I have a cookbook in chef called usersinto and attributes: node.default["usersinto"]["users"] = [ " user1 user2 user3 .... userN " ] and is called in recipe by: bash "launch-add" do code <<-EOH sh /home/user/addusers.sh "#{node["usersinto"]["users"]}" EOH end I'll try a lot of things, if I use in attributes "[", the script catches "[" as argument $1, if I don't use "[ ]" the script only catches the first user. How

Configuration Management for Windows [closed]

爱⌒轻易说出口 提交于 2019-11-28 13:45:27
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 5 years ago . Are there any tools for windows like that *nix world has? I am looking for something like Chef or Puppet. I have found cfEngine but it still looks very *nix centric. Ideally it would be open source, and command line driven. The idea is to put together an automated infrastructure with windows based servers. Our

Ruby code blocks and Chef

◇◆丶佛笑我妖孽 提交于 2019-11-28 09:44:35
问题 I am an extremely new person to Ruby and Chef. I have been trying to wrap my head around the syntax and do some research, but I am sure as you all know unless one knows the terminology, it is hard to find what you are looking for. I have read up on Ruby code blocks, but the Chef code blocks still confuse me. I see something like this for example: log "a debug string" do level :debug end Which adds "a debug string" to the log. From what I have seen though, it seems to me like it should be

to_specs': Could not find chef (>= 0) amongst [] (Gem::LoadError)

瘦欲@ 提交于 2019-11-28 09:04:36
I am trying to install chef and knife ec2 plugin on my laptop to set up the workstation. Initially I use chef omnibus to install chef-client but after installing I encountered some problems, so a quick googling landed me to stackoverflow and couple of threads suggested me to install chef using gem. I am running on ruby 2.0.0-p0 and insalled chef and knife ec2 but I am getting a different issue now. I have posted the issue bleow, kindly have a look. Please help me out to fix me this issue /home/jeevan/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/site_ruby/2.0.0/rubygems/dependency.rb:247:in `to_specs':

Chef: How do I override default attributes in roles?

本秂侑毒 提交于 2019-11-28 06:21:47
I'm using the opscode nginx cookbook for configuring the nginx server on my nodes. The nginx cookbook has some default attributes I'd like to override in my role ("web_server"). These are the attributes I'd like to override: default['nginx']['version'] = "1.2.2" # in cookbooks/nginx/attributes/default.rb default['nginx']['source']['prefix'] = "/opt/nginx-#{node['nginx']['version']}" # in cookbooks/nginx/attributes/source.rb In my roles/web_server.rb file I have something like this: name "web_server" description "Setup a web server" run_list "role[base]", "recipe[nginx]" override_attributes

How do I configure Chef Solo to install Nginx on a new Vagrant box?

陌路散爱 提交于 2019-11-28 06:06:15
I'm new to Chef and the documentation (even the home page of their website) makes my head spin. I'm not even sure if I'm using it for the correct purpose. My intent is to setup a Vagrantfile that tells Chef Solo to install some software automatically when I spin up a new box. That is one of Chef Solo's intended uses, am I correct? I'm not really sure if that qualifies as one of "the hardest infrastructure challenges on the planet" , but whatever. My first goal is to get Chef Solo to install nginx for me. In my project, I've cloned the cookbook for nginx : $ git clone https://github.com/opscode

How can I put the output of a Chef 'execute resource' into a variable

时光毁灭记忆、已成空白 提交于 2019-11-28 05:53:32
I'd like to put the output of a shell command into a variable for later use in a Chef recipe. In bash I could do something like output=`tail -1 file.txt` and then I could echo $output Can an 'execute resource' do this so that I can use the result later in the recipe? Francois while Graham's solution seemed to work at first, I found out about Chef::Mixin:ShellOut ruby_block "check_curl_command_output" do block do #tricky way to load this Chef::Mixin::ShellOut utilities Chef::Resource::RubyBlock.send(:include, Chef::Mixin::ShellOut) curl_command = 'curl --write-out %{http_code} --silent --output

Copy file from chef client node to workstation

假装没事ソ 提交于 2019-11-28 05:31:34
问题 I would like to know how to transfer a file from a client node to a remote machine. I have checked whether there any resource available for doing this. The closest thing I found is remote_file , but it is fetching a file from remote location and transfer it to the client node. So I tried another option by writing a bash script which will perform an automated scp. But I cant able to copy the file, but the chef-client was running fine without showing any errors. Here is my script for copying

Difference between convergence and idempotence in Chef

筅森魡賤 提交于 2019-11-28 05:28:05
What is the basic difference between convergence and idempotence in Chef? Convergence and idempotence are not Chef-specific. They're generally attributed to configuration management theory, though have use in other fields, notably mathematics. Let's start with the more basic, idempotent. We're going to ignore the mathematic use of idempotent, and focus instead on what configuration management people mean when they talk about it. That is: "multiple applications of the same action do not have side effects on the system state." A simple example of an idempotent operation is mkdir -p : mkdir -p