Tag Info

Hot answers tagged

8

You could use knife ssh to run chef-client on all boxes that contain a certain role or recipe: knife ssh "role:web" "sudo chef-client" -x ubuntu --sudo Or if you're in EC2: knife ssh "role:web" "sudo chef-client" -x ubuntu -a ec2.public_hostname


8

That'd pretty much how you get thing started to begin with, but it only needs to be done once. The initial run of chef-client typically enables and starts the chef-client daemon as an init.d service. If you really wanted to do it more elegantly, you can ditch knife-ssh and run ssh directly: ssh ubuntu@ipadddress -i mycredentials.pem sudo chef-client ...


6

package "sun-java6-jdk" do action :remove end See http://wiki.opscode.com/display/chef/Resources#Resources-Package


3

The proper approach wrt chef/puppet et al is to package that software in your distro(')s native packaging format yourself and include it in your repositories and then to pull that package.


3

You can auto scale your EC2 instance. Check this post, but before doing it have read this discussion. I am currently using chef for configure my ec2 instaces and cloudformation for amazon resources set up. Recetly CloudFormation has integrated chef. I am using Cloud formation and chef both and it works well for me.


2

It appears you are trying to register a new client by a name that already exists. If you run knife client list you should see a client name that matches your vagrant vm's host name Assuming the hostname is 'vagrant' you could run this: for foo in client node ; do knife $foo delete vagrant -y ; done then run vagrant up or vagrant provision You will ...


2

This problem is usually caused by not having the right private key PEM file added to your local ssh agent. Doing something like: $ ssh-add pk-XXXX Where the argument is the private part of the key pair used to create the EC2 instance.


2

There is likely a load error of some kind in your /etc/chef/client.rb. For example, if you're using a report or exception handler and the the library file they're trying to load isn't available, Chef will report the error you're seeing. You don't need +x on client.rb. If this isn't enough information, please post your /etc/chef/client.rb contents.


2

You should set the attributes you want on the node object(s) on the Chef Server. You can do this through a variety of methods. Add the attributes to the role you've applied to the nodes - this probably the best for systems that are all in a single role. Modify the node(s) directly, with knife node edit, or script it with knife exec. Set the attributes in ...


2

You'll need to execute chef client with an alternative configuration. The default config file and directory is /etc/chef/client.rb. You could use that one for one of the nodes / environments. Let's assume that will be "staging". You should probably make sure the node and environment are set up for the proper values: node_name "mynode.staging" environment ...


2

You can use knife bootstrap to bootstrap any server into a fully provisioned Chef node. It installs the chef-client binary automatically and runs a prespecified runlist. As usual, try knife bootstrapp --help for more information. For the steps BEFORE actually bootstrapping the server you can try a number of different applications built specifically for this ...


2

Er...you're trying to ssh in as root. EC2 by default does not allow this even with your keyfile login by default: ERROR: Net::SSH::AuthenticationFailed: root@ While your test command uses ubuntu@. You can "allow" root access by modifying the authorized_keys file under /root/.ssh (or adding the key yourself).


2

I suspect you're using a 32-bit build of chef-client on W2K8R2, which is an x64 architecture OS. Asusming that's the case the directory your chef-client process "sees" as %systemroot%\system32 is actually %systemroot%\syswow64. I would guess your DLL isn't in there to be deleted. This has been discussed in a ticket at Opscode and the workaround described ...


1

You can access Chef's config through Chef::Config. log Chef::Config[:path_to_foo]


1

Follow these steps: 1- Remove the node and the client for that node from your chef server. 2- Re install the chef client using bootstrap from your workstation knife bootstrap windows winrm server_ip -x Administrator -P server_pass -N server_name Do not add any role, just run from the command prompt to check if its working correctly: chef-client The ...


1

I finally managed to solve this (at least on Ubuntu) by using the cookbook 'ruby_build', '>= 0.8.0' with this simple recipe: include_recipe 'ruby_build' ruby_build_ruby '1.9.3-p484' do prefix_path '/usr/local' action :install end Note the prefix_path i used worked perfectly fine on Ubuntu 12.04 since /usr/local/bin is already in system $PATH ...


1

You should keep using the URL of ec2 instance instead of private ip all the time because AWS will help you to resolve the right ip address. Checkout the knife configuration file at ~/.chef/knife.rb, make sure the value of entry chef_server_url composes of ec2 instance URL instead of ip address.


1

Please check if you can do a telnet from the workstation to the node you try to access. This can be checked by typing telnet in a command prompt. If telnet is not recognized as a command, then follow the steps: 1) Right click on "My Computer" > Manage > features 2) Click on "Add Features" 3) Select "Telnet Client" 4) Press Install buuton It will ...


1

Run for Basic authentication : C:\Users\Administrator> winrm set winrm/config/service @{AllowUnencrypted="true"} C:\Users\Administrator> winrm set winrm/config/service/auth @{Basic="true"} See: https://github.com/opscode/knife-windows#nodes


1

To examine the response times of each individual resource of your recipe, you can use chef-handler-elapsed-time to do some kind of profiling for those 8.782384 seconds. For history of response times for the provision of multiple systems and statistics, you can use chef-metrics and send all those cool metrics to a graphite.


1

This is a very crazy bug in nginx recipe (as described here: https://github.com/opscode-cookbooks/nginx/pull/13) The problem is with including version attribute in role attributes. Just remove that and it will work. This indeed took lot of time for me to figureout, I hope this information saves time for someone else here. There is open bug here ...


1

Linux will kill processes if the system is in danger of running out of memory [0], perhaps this is happening? grep /var/log/syslog for the phrase "oom" (can't remember if it is in capitals or not) - this will tell you if processes are being killed due to lack of memory. 0: http://linuxdevcenter.com/pub/a/linux/2006/11/30/linux-out-of-memory.html


1

You could use the knife ec2 plugin to create and delete ec2 instances, but it won't create the full range of resources (ELB, Route 53 RecordSet, security groups, etc.) that you can use cloud formation to support. So you would either need to create these manually, or build your own policy based scaling code that would respond to alerts by your monitoring ...



Only top voted, non community-wiki answers of a minimum length are eligible