I was trying to migrate a private chef server from ubuntu 12.04 to ubuntu 14.04 . I thought that it would be great to use Alternate Names in the certificate that I would be issuing. The certificate would be self signed but one of the issues I have faced was that ssl verification failed from the client and as reported by knife ssl check.
As I mentioned in previous posts I have been using vagrant to develop and test chef cookbooks. A couple of days ago I have upgraded chefdk from version 0.8.0 to 0.9.0 which also upgrades berkshelf from version 3.3.0 to 4.0.1 . So when I tried to launch a vagrant box as usual with executing
Till now I have been testing my chef cookbooks using kitchen on my laptop, which means that it’s done with vagrant and virtualbox as its provider. One of the things I wanted to try is to add jenkins in the whole process. I can only have a jenkins server as a KVM guest so this means that I can not have virtualbox as vagrant’s provider since VirtualBox can not run inside KVM.
I have been curious to see how chef attibutes priority is working. So I decided to do a simple experiment. I have been using wrapper cookbooks after I read this amazing post from Jamie Winsor http://blog.vialstudios.com/the-environment-cookbook-pattern/ and this post from Doug Ireton http://dougireton.com/blog/2013/02/16/chef-cookbook-anti-patterns/.
Today I decided to test the chef development kit. Chef released chefdk 0.3.6 version on 2015/01/20. Till now I used to install and upgrade chef manually installing all required gems. What I found out is that knife ec2 plugin is not bundled with chefdk so you ‘ll have to install it yourself which is not very difficult. You only need to execute the following command
$ /opt/chefdk/embedded/bin/gem install knife-ec2
Recently I have been trying to cut off expanses in one of the projects I ve been working. So we decided to move two of the t1.micro ec2 AWS instances to our dedicated server,which was already hosting VMS for other projects, as one KVM guest. First instance was the production MySQL DB server for the project while the other was the webserver(apache) hosting our php application. I thought it would be great to have the whole migration automated with chef in case we need to migrate later back to AWS or to another dedicated server.
Let’s say you wish to set the memcached CACHESIZE variable based on your system’s(node) memory.
By default CACHESIZE is defined as 64MB. You get the nodes total memory using the node[‘memory’][‘total’] which will return the memory in KB for example 1019492kB In this case you need to divide it with 1024 to get the size in MB. If you want to assign 10% of your total memory to memcached CACHESIZE then you ll have 1019492kB * 0.1 / 1024 = 99.559MB. You can remove the .559 using ruby’s to_i method.
So you can put the following in your cookbook to set your memcached cachesize. The only dependency is opscode memcached cookbook
node.set['memcached']['memory'] = (node['memory']['total'].to_i * 0.1 / 1024).to_i include_recipe 'memcached'