Tag: chef

chef-solo not applying recipe changes

I’m trying to vagrant up, edit ..\default.rb then run sudo chef-solo and have my new recipe version be run by chef. This is not working for me. After my initial vagrant run, chef does not apply updates to recipes. I can modify ..\default.rb all I want, but chef-solo runs the original version. vagrant setup script […]

Chef-Client fails to get the ruby gem during chef provisioning

I am following the chef blog: https://www.chef.io/blog/2014/11/12/chef-provisioning-infrastructure-as-code/ On trying the command chef-client -z <myenv>.rb, it fails with the following exception Running handlers: [2015-05-12T08:58:25-07:00] ERROR: Running exception handlers Running handlers complete [2015-05-12T08:58:25-07:00] ERROR: Exception handlers complete [2015-05-12T08:58:25-07:00] FATAL: Stacktrace dumped to /scratch/ChefWorkstation/.chef/local-mode-cache/cache/chef-stacktrace.out Chef Client failed. 0 resources updated in 1.536536008 seconds [2015-05-12T08:58:25-07:00] ERROR: cannot load such […]

Unable to activate chef-provisioning-docker-0.6 because chef-provisioning-1.1.1 conflicts with chef-provisioning (~> 0.9)

I have the following code in my Vagrantfile config.vm.provision “chef_zero” do |chef| chef.add_recipe ‘docker’ chef.add_recipe ‘chef-provisioning’ chef.add_recipe ‘chef-provisioning::docker’ This fails with a recipe compile error Gem::ConflictError. Console shows ==> default: Gem::ConflictError ==> default: —————— ==> default: Unable to activate chef-provisioning-docker-0.6, because chef-provisioning-1.1.1 conflicts with chef-provisioning (~> 0.9) ==> default: ==> default: ==> default: Cookbook Trace: […]

How to run multiple supporting apps (tomcat) on my local mac which I don't modify?

I work on app A. In order for me to work in app A, I depend on multiple apps B, C and D. (All of them runs on tomcat). I had to build and run my app A, but not necessarily apps B, C & D. So is there a easy way to spin up […]

CHEF provisioning: SystemStackError: stack level too deep

I’m making a node provisioner with CHEF, I want to create and configure Docker containers inside it. Currently I get a CHEF node with Chefdk and chef-provisioner-docker, but when I trigger the recipe to create containers (machine) I get a Stack level too deep withc I dont understand why. Stacktrace: [2016-02-16T11:12:21-05:00] INFO: Forking chef instance […]

Kitchen doesn't recognise docker

The problem is quite simple: $ kitchen converge —–> Starting Kitchen (v1.6.0) >>>>>> ——Exception——- >>>>>> Class: Kitchen::UserError >>>>>> Message: You must first install the Docker CLI tool http://www.docker.io/gettingstarted/ >>>>>> ———————- >>>>>> Please see .kitchen/logs/kitchen.log for more details >>>>>> Also try running `kitchen diagnose –all` for configuration In the log: Message: Expected process to exit with […]

Dynamically Pull Docker Image using chef recipe

What Chef-Recipe should do- 1- Install Docker service. 2- Dynamically Pull Docker Image; Count depends on User request. 3- Dynamically Run Docker Containers; Count depends on User request. What below Chef-recipe is doing- 1- Install Docker service. 2- Pull Docker Image; 3- Run Docker Containers; Chef-docker recipe- # # Cookbook Name:: chef-docker # Recipe:: default […]

kitchen-docker: How to run a shell command before kitchen converge

When using vagrant machines with test-kitchen the pre_create_command allows you to specify a command which is run locally before the vagrant machine is being created. With kitchen-docker no such configuration option seems to exist, and bending chef_omnibus_url as suggested here isn’t an option. The script specified as pre_create_command for the testing vagrants generates a local […]

How to we login to docker hub(private registry) using chef recipe?

I’m using docker_registry with user name and password in the recipe but I’m unable to get connected successfully. Code: docker_registry ‘https://hub.docker.com/’ do username ‘XXXXXX’ password ‘XXXXXX’ end

VBoxManage (LockMachine): Docker machine created by chef

I want to create default machine for Docker with Chef. I am using command: docker-machine create –driver=virtualbox –virtualbox-host-dns-resolver=true default My problem is that when I run it inside Chef (with execute resource, but I’ve also tried batch and powershell_script) it runs perfectly fine (machine is added inside Docker), but it does not work inside VBox […]

Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.