我最初在StackOverflow问这个问题,但没有收到任何工作的答案: https : //stackoverflow.com/questions/18648713/specify-chef-provider-for-windows-feature 。 我试图使用厨师(厨师独奏)来pipe理我的Windows Server 2008 R2安装。 厨师提供windows_feature以将angular色/function添加到Windows服务器。 默认情况下, windows_feature使用DISM来安装angular色(如果可用)。 但是据我所知,并不是所有的angular色(如RDS-RD-Server)都可以通过DISM添加。 我大概可以使用Chef::Provider::WindowsFeature::ServerManagerCmd (Windows Cookbook自述文件中标识: https : //github.com/opscode-cookbooks/windows ),但它看起来不像是一个真正的类(浏览那里的源代码)。 此外,servermanagercmd已被弃用(尽pipe它会工作)。 我甚至不介意使用powershell块来添加angular色,但是我很难确保幂等性。 看起来not_if命令shell是一些奇怪的mingwin shell而不是CMD。 以下是我尝试使用powershell的一个示例(不起作用): powershell "install_rds_server" do code %Q{ Import-Module Servermanager Add-WindowsFeature RDS-RD-Server }.strip not_if %Q{ powershell "Import-Module Servermanager; $check = get-windowsfeature -name RDS-RD-Server; if ($check.Installed -ne \"True\") { exit 1 }" }.strip end […]
首先,我正在使用Chef Solo,我希望事情尽可能保持自动化。 所以我有一个问题,我不太清楚如何解决。 我正在设置很多不同的Linux机器的部署,并且他们都将要求自定义安装节点/angular色。 例: /nodes/app_server.json { "run_list": [ "role[app_server]" ] } /roles/app_server.rb name 'app_server' description 'App_Server' override_attributes({ "apache" => { "proxypass" => [" / http://localhost:8080/"] } }) run_list 'recipe[app_server]' 我的问题是,我将运行一个脚本来安装厨师在所有这些不同的盒子,但每一个将有一个不同的IP之间http:// [xxxxxx]:8080 / 我需要一种方法来通过命令行来指定这些IP,而不必像创build一百个节点或angular色文件一样。 我看了他们的网站上的一个例子,显示: Web服务器angular色 description "The base role for systems that serve HTTP traffic" run_list "recipe[apache2]", "recipe[apache2::mod_ssl]", "role[monitor]" env_run_lists "prod" => ["recipe[apache2]"], "staging" […]
我在做什么: Debian Wheezy 7.6 厨师:11.14.6 到目前为止,我一直使用node.name来设置一个实例的主机名。 例: { "name": "web-01", "chef_environment": "_default", "normal": { "tags": [ ] }, "run_list": [ "recipe[[email protected]]" ] } 但是最近,从“名称”键设置node.name停止工作。 node.name仍然是我的云提供商提供的主机名。 这发生在运行厨师客户端,厨师独奏,甚至在厨师壳。 它似乎设置正确在我的client.rb,但仍然没有node.name不更新。 我试着用-N标志跑,但还是没有成功。 其他人遇到这个问题? 如何设置node.name? 或者,如何设置node.name?
我能够使用刀桉树创build一个新的服务器,如下所示: knife euca server create 服务器已创build,但设置失败,并显示以下消息: "ERROR: Errno::ENOENT: No such file or directory – /etc/chef/validation.pem" 这是可以理解的,因为我认为它试图使用Chef Server进行configuration。 这就是问题。 我想用Chef Solo来configuration这个服务器(至less现在是这样)。 有没有什么办法指导刀桉提供厨师独奏新的服务器?
事实: 我有一个厨师服务器安装。 我已经注册了一个节点到这个服务器,我可以看到在webUI中的节点(这是一个现有的节点,不是使用刀引导启动 当我执行命令 $ knife ssh "role:test" "sudo chef-client" WARNING: Failed to connect to node[ip-XXXX.ec2.internal] — Net::SSH::AuthenticationFailed: [email protected] 有什么我错过了吗? 例如复制SSH密钥?
我正在使用Packer和厨师独奏提供程序构buildVirtualBox机器。 有没有办法从虚拟机内部重新运行厨师,因为食谱更新,而无需重新运行packer build ?
我正尝试使用Chef Solo和下面的食谱来安装Maven 3: http://community.opscode.com/cookbooks/maven Cookbook默认安装了Maven 2,第一次运行它时,它按照预期安装了Maven 2。 后来我修改了我的solo.json文件,如下所示: { "maven": { "version": "3" }, "run_list": [ "recipe[java]", "recipe[maven]" ] } 但厨师没有更新到版本3的Maven。我不知道这是否是因为我错误地指定覆盖属性,或者如果有一些其他问题。 我用这个作为参考: http://wiki.opscode.com/display/chef/Chef+Solo#ChefSolo-JSON%2CAttributesandRecipes 谢谢。
我有一个简单的配方,如下所示,目前我正在使用本地文件来指示命令是否已经运行 execute "test" do command "sh test.sh && touch /opt/myapp/done.log" only_if {File.exists?("/opt/myapp/done.log")} end 有更好的方法吗? 这是推荐的方式?
我正在尝试与厨师安装Redis。 我想,这很容易,因为我只想要默认configuration。 所以,我添加到一个Berksfile: 网站:opscode 食谱“apt” 菜谱“节点” cookbook'rvm',:git =>“https://github.com/fnichol/chef-rvm” 菜谱“runit” 食谱“redis” 然后,我运行:stream浪汉提供 但是我得到这个: 2013-12-11T21:18:23 + 00:00] DEBUG:chef_gem [rvm]已经安装 – 无事可做 [2013-12-11T21:18:23 + 00:00] DEBUG:加载配方rvm :: vagrant via include_recipe [2013-12-11T21:18:23 + 00:00] DEBUG:在食谱rvmfindstream浪食谱 [2013-12-11T21:18:23 + 00:00]警告:从先前资源(CHEF-3694)克隆组[rvm]的资源属性 [2013-12-11T21:18:23 + 00:00]警告:上一组[rvm]:/tmp/vagrant-chef-1/chef-solo-1/cookbooks/rvm/recipes/system.rb:33:在`from_file' [2013-12-11T21:18:23 + 00:00]警告:当前组[rvm]:/tmp/vagrant-chef-1/chef-solo-1/cookbooks/rvm/recipes/vagrant.rb:34:在`from_file' [2013-12-11T21:18:23 + 00:00] DEBUG:通过include_recipe加载配方redis [2013-12-11T21:18:23 + 00:00] DEBUG:在食谱redis中发现食谱默认 [2013-12-11T21:18:23 + 00:00] DEBUG:通过include_recipe加载配方metachef [2013-12-11T21:18:23 + 00:00] […]
使用opscode厨师,有没有办法find或循环所有用户帐户? 我需要在每个用户主目录中创build一个configuration文件。 我不想循环任何目录结构。