chef-solo

Using Ruby 2.0 on Amazon OpsWorks

。_饼干妹妹 提交于 2019-12-03 07:59:22
I'd like to use Ruby 2.0 on Amazon OpsWorks, so I'm trying the following: Choose custom cookbooks and set them to my fork of https://github.com/aws/opsworks-cookbooks Update all version numbers here https://github.com/aws/opsworks-cookbooks/blob/master/ruby/attributes/ruby.rb to 2.0 values. This doesn't seem to have any effect, though. Do custom cookbooks override their built in counterparts? Does OpsWorks use the Ruby recipe from the cookbook for basic Ruby setup? The same question applies to Nginx too - can I control versions and settings by changing my fork for the cookbooks? OpsWorks now

Provision developer environment with chef server and vagrant without registering node

眉间皱痕 提交于 2019-12-03 07:54:49
问题 I wish to create a developer environment of a web based application which will have an application server and database server installed on a VM using vagrant. I am using open source chef server and vagrant with chef_client provisioner. However each time a developer node is provisioned, chef_client provisioner creates a client node on chef server. This is not desirable because this setup will be used by a lot of developers. Such nodes might get created and destroyed several times. So

“include_recipe” vs. Vagrantfile “chef.add_recipe”. What's the difference?

孤街浪徒 提交于 2019-12-03 07:35:17
Just ran nginx::source recipe on my vagrant box, and I have very unusual behaviour. When I include a recipe from the Vagrantfile (as below), everything works like a charm, chef.add_recipe("project::nginx") chef.add_recipe("nginx::source") ( project::nginx recipe is very simple. Using it to override default attributes of the nginx cookbook) but if I include a recipe at the very end of project::nginx (mentioned up), everything falls apart: node.default['nginx']['server_names_hash_bucket_size'] = 128 include_recipe "nginx::source" Until now I didn't know there's any difference in behaviour

Chef cookbook - reload PATH

心已入冬 提交于 2019-12-01 09:18:14
I just installed java using chef cookbook and updated PATH environment variable for all users (added new file to /etc/profile.d/). Is it possible to tell chef to reload PATH variable? When I do something like this: execute "java_check" do command "java -version" end Is says that java could not be found. It works fine when I log out, log in again and then run chef recipe. I'm not 100% sure you can update the PATH variable for future chef runs, but you can set it up manually using the environment attribute within the execute stanza. This can also be used on other Resources as well. See: http:/

Chef cookbook - reload PATH

梦想与她 提交于 2019-12-01 07:12:35
问题 I just installed java using chef cookbook and updated PATH environment variable for all users (added new file to /etc/profile.d/). Is it possible to tell chef to reload PATH variable? When I do something like this: execute "java_check" do command "java -version" end Is says that java could not be found. It works fine when I log out, log in again and then run chef recipe. 回答1: I'm not 100% sure you can update the PATH variable for future chef runs, but you can set it up manually using the

Chef Solo get user input

这一生的挚爱 提交于 2019-11-27 08:21:43
问题 I don't know why I can't find anything on the interwebs about this. I basically want to write a recipe that prompts a user for their github username/password, then posts to the github API to add an ssh key. I'm sure I can prompt a user with normal ruby methods (ie gets) but this doesn't seem natural given all the utilities chef provides. Can someone tell me a 'chef' way of prompting a user for input to store in vars for later use? I'd like to first output some instructions for the user to