Provision server with chef-solo as root?

I’m using knife to bootstrap my VM with vanilla Debian 7.0 installation. In bootstrap stage I’m just setting sources.list, updating & upgrading system, then I install buil-essential, rsync and ruby1.9.1 (with rubygems). As a last step, my bootstrap template install chef as a gem. Bang! my node is in this point bootstrapped and ready to … Read more

Storing extra data in .json role/environment files for external (i.e. non-Chef) applications

I’m thinking about converting my roles to JSON syntax and storing some extra data in there for an external, non-chef application (specifically Vagrant). My idea is that if I stick to a convention in which each machine only gets a single role, I can have Vagrant iterate through my roles directory and automatically configure a … Read more

Can’t compile nginx::source

I have downloaded nginx cookbook manually today from http://community.opscode.com/cookbooks/nginx and started it with include_recipe nginx::source, using chef-solo 11.4 on Ubuntu 12.04 But I have got an error /nginx/recipes/source.rb line: 28 28>> nginx_url = node[‘nginx’][‘source’][‘url’] || “http://nginx.org/download/nginx-#{node[‘nginx’][‘source’][‘version’]}.tar.gz” and the errors are: ` [2013-05-07T18:54:38+04:00] ERROR: Running exception handlers [2013-05-07T18:54:38+04:00] ERROR: Exception handlers complete Chef Client failed. 0 … Read more

Installing nginx via chef Role is not applying my changes

I wrote a role to use the default nginx cookbook. The role is not applying any of my attributes. It keeps installing nginx 1.2.1. { “name”: “nginx”, “json_class”: “Chef::Role”, “chef_type”: “role”, “override_attributes”: { “nginx”: { “version”: “1.5.13”, “default_site_enabled”: true } }, “run_list”: [ “recipe[nginx]” ] } Any idea why this is? Answer default_site_enabled = true … Read more

Git is not working properly when installing with chef

I’m provisioning my servers with Chef. For git I’m using the community cookbook and is installing version 1.8.3.1 in Amazon Linux. However after it gets installed I don’t get any output while running git commands as git ls-remote or git clone (also it won’t clone projects). I Googled with no luck. Answer 2014-04-16 @LuisDUrraca provided … Read more

chef remote_file is throwing Encoding::UndefinedConversionError

I have the following in a chef recipe: remote_file ‘/tmp/zint-2.4.2.zip’ do source ‘https://s3.amazonaws.com/mybucket/zint-2.4.2.zip’ checksum ‘4dc28641ef79957e9d3f0904a5d56472ef1d66f8529e3deda25537d890a6f8f3’ mode ‘0664’ action :create_if_missing end On Ubuntu 14.04 with ruby1.9.1 this is throwing “Encoding::UndefinedConversionError: “\xA2″ from ASCII-8BIT to UTF-8” when I run chef-solo on boot. If I run chef-solo manually after start up, the cookbook completes successfully. This seems related … Read more

Getting particular server config from Git in Chef Solo

I don’t want to use Chef Server as for now, but rather want to leverage Chef Solo. I need to keep configs (attributes and files) of particular servers in a separate Git repo. This is needed to keep cookbooks in an open repo while hiding configs in a private repo. Is there a built-in possibility … Read more