简体   繁体   中英

Issue regarding chef-solo

I have been trying to learn chef-solo. I am new to this automation thing and the tutorials available are quite confusing. The main doubt I have is about the work-flow of chef-solo.

Though I was able to run it with vagrant. But as the documentation says "chef-solo is an open source version of the chef-client that allows using cookbooks with nodes without requiring access to a server", meaning I should be able to run chef-cookbooks on an already provisioned machine. The idea is I have a running VM, I want to install chef-solo on it and run the cookbooks on "this machine" only. Is is possible? Or do I need to provision a VM? Please help.

I'm afraid you are not making a lot of sense.

If mean by "provisioning a VM" consists of:

  • allocating the resources to run the virtual, and

  • booting it from a boot image or from an installation media.

These things are the responsibility of your virtualization platform; eg xen, kvm, vmware or hyper-v. (Vagrant is a particular case that is built on top of other virtualization providers ... such as the above.)

On the other hand, once you have gotten your virtual machine booted into Linux (or whatever), you can use Chef for "provisioning" (if you want to call it that) other software.


So to try to answer your question:

The idea is I have a running VM, I want to install chef-solo on it and run the cookbooks on "this machine" only. Is this possible? Or do I need to provision a VM?

(It sounds like you mean "provisioning" in the first sense; see previous.)

The answer is that if you have an existing VM you don't need to "provision" another VM in order to use Chef (in either Solo or Server mode). You can install Chef on your existing VM, copy your cookbooks from somewhere, and then use "chef-solo" to run them.

On the other hand, a Vagrant VM is really a transitory thing. It is useful for doing experiments / testing / trying things out ... but it is not designed for building production systems. So in that sense, if your "existing VM" is a Vagrant instance, then you may indeed need to provision a new VM if you are going to build a system "for real". But that's not because of Chef! On the contrary, Chef works just fine on Vagrant.

Chef is a provisioner that can be used by Vagrant. So running chef-solo is the provisioning (maybe you think more of "making a VM available as provisioning?). I guess you don't have to worry as much as you do.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM