简体   繁体   English

关于厨师独奏的问题

[英]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. 但是正如文档所述:“ chef-solo是Chef-client的开放源代码版本,允许在不访问服务器的情况下使用带有节点的菜谱”,这意味着我应该能够在已配置的机器上运行Chef-cookbook。 The idea is I have a running VM, I want to install chef-solo on it and run the cookbooks on "this machine" only. 我的想法是我有一个正在运行的VM,我想在其上安装chef-solo并仅在“这台机器”上运行这些菜谱。 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: 如果用“配置VM”来表示,则包括:

  • 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. 例如xen,kvm,vmware或hyper-v。 (Vagrant is a particular case that is built on top of other virtualization providers ... such as the above.) (Vagrant是一种特殊情况,它建立在其他虚拟化提供程序之上……)

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. 另一方面,一旦您将虚拟机引导到Linux(或其他任何版本)中,就可以使用Chef来“配置”其他软件(如果要称呼它)。


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. 我的想法是我有一个正在运行的VM,我想在其上安装chef-solo并仅在“这台机器”上运行这些菜谱。 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). 答案是,如果您已有虚拟机,则无需“配置” 另一个虚拟机即可使用Chef(在Solo或Server模式下)。 You can install Chef on your existing VM, copy your cookbooks from somewhere, and then use "chef-solo" to run them. 您可以在现有VM上安装Chef,从某处复制您的食谱,然后使用“ chef-solo”运行它们。

On the other hand, a Vagrant VM is really a transitory thing. 另一方面,Vagrant VM确实是暂时的。 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". 因此,从这个意义上讲,如果“现有虚拟机”是Vagrant实例,那么如果您要“真正”构建系统,则确实可能需要配置新的虚拟机。 But that's not because of Chef! 但这不是因为厨师! On the contrary, Chef works just fine on Vagrant. 相反,Chef在Vagrant上工作得很好。

Chef is a provisioner that can be used by Vagrant. Chef是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. 因此,运行chef-solochef-solo配置(也许您更多地考虑“使虚拟机可作为chef-solo配置使用?”)。我想您不必像您所做的那样担心。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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