chef

How to use Berkshelf to manage Organization repo?

坚强是说给别人听的谎言 提交于 2019-12-23 09:48:30
问题 I'm a huge fan of Berkshelf and I've released few community cookbooks using it and its awesome. Now, I'm starting a new chef project and I went ahead with Berkshelf for this too. But I'm finding some confusions/difficulties using it for the project. Following is in the Berksfile: site :opscode cookbook 'mediawiki', github: 'millisami/chef-mediawiki' cookbook 'sp-mediawiki', path: 'site-cookbooks/sp-mediawiki' I've generated my application cookbook inside the site-cookbooks folder. When I do

how to make chef execute with a specific user and load its environment values

你。 提交于 2019-12-23 07:30:05
问题 Hi I am creating a WCS instance, for which i have to execute the create instance command using the wcs user (webadmin), its failing to connect to DB as its not able to get the required env variables. so i put some sample code to check I am using the below code bash "wcs-create-instance" do user "webadmin" group "webspher" code <<-EOH ###{node[:websphere][:wcs][:wcs_installLocation]}/bin/config_ant.sh -DinstanceName=#{node[:websphere][:wcs][:wcs_instance]} CreateInstance whoami > /tmp/whoami

how to make chef execute with a specific user and load its environment values

放肆的年华 提交于 2019-12-23 07:30:03
问题 Hi I am creating a WCS instance, for which i have to execute the create instance command using the wcs user (webadmin), its failing to connect to DB as its not able to get the required env variables. so i put some sample code to check I am using the below code bash "wcs-create-instance" do user "webadmin" group "webspher" code <<-EOH ###{node[:websphere][:wcs][:wcs_installLocation]}/bin/config_ant.sh -DinstanceName=#{node[:websphere][:wcs][:wcs_instance]} CreateInstance whoami > /tmp/whoami

Chef node not registering with server

巧了我就是萌 提交于 2019-12-23 03:59:14
问题 I am trying to register my client to the server, but it gives following error on running below command: [root@vm ~]# chef-client -S https://chef-server.example.com -K /etc/chef/chef-validator.pem {:config_missing=>true} [2014-12-29T18:20:00+05:30] WARN: ***************************************** [2014-12-29T18:20:00+05:30] WARN: Did not find config file: /etc/chef/client.rb, using command line options. [2014-12-29T18:20:00+05:30] WARN: ***************************************** Starting Chef

RVM + Nginx + Passenger in Chef

老子叫甜甜 提交于 2019-12-23 01:34:53
问题 I'm trying to setup Nginx with Passenger on RVM in Chef using community cookbook for nginx and fnichol's for RVM. Everything on ubuntu. Now, my problem is that if I bootstrap the machine using knife ec2 and try to install everything in one go, it fails. For the most part it works well, picking up RVM and Passenger nicely, until the point when it realizes Passenger is not compiled, tries to do it using rake from default ruby 1.9.1 and fails. If I then connect to the machine and run sudo chef

How to upload a WAR file on Tomcat 7 cookbook by Chef?

寵の児 提交于 2019-12-22 23:35:23
问题 I'm trying deploy a War file on my Tomcat 7 installed by a cookbook on CHEF. But, I can't find a single answer for my question at any forums. I don't have any idea how to do this! I'm using a Ubuntu server 12.10. The recipe that I'm using is https://github.com/solarvm/tomcat7-cookbook 回答1: The simple way to do is is to use the service resource to stop Tomcat, use the bash resource or a file resource to copy the WAR file, and then use the service resource to start Tomcat again. That cookbook

cookbook_name in recipe- TypeError: no implicit conversion of Symbol into String

心已入冬 提交于 2019-12-22 16:01:13
问题 I have the following code in my recipe but it errors. log "###" + cookbook_name + "::" + recipe_name + " " + Time.now.inspect + ": Starting execution phase" puts "###" + cookbook_name + "::" + recipe_name + " " + Time.now.inspect + ": Starting compile phase" The error is: TypeError: no implicit conversion of Symbol into String /test/chef/cookbooks/cookbook-server/recipes/setup_server.rb:10:in `+' The issue seems to be with the cookbook_name , recipe_name etc.(the ones which are not hardcoded)

Vagrant to test chef recipies - but how to deal with private git

自古美人都是妖i 提交于 2019-12-22 10:10:02
问题 I use vagrant to test my chef recipes. The issue is that I have clone my private repo and the machine is not auteticated. How can i automated git authentication to boostrap chef? I am using the vagrant ubuntu 11.10 with chef. Thanks 回答1: use ssh keys with passphrase on a vagrant+chef setup will have similar answers that might be helpful. Without knowing more details of chef-solo, or chef-client + chef-server. It comes down to ssh keys. Make sure you are authing with something like git@github

Should we really use chef to manage the sudoers file?

◇◆丶佛笑我妖孽 提交于 2019-12-22 10:08:40
问题 This is my question. I am worried that if Chef breaks something in the sudoers file, probably by a Chef user using the cookbook incorrectly, then the server will be entirely inaccessible. I would hate for us to completely lose a production server for a customer because we messed up the sudoers file and can no longer ssh into the box. 回答1: Chef has a feature to help with this, verifiers. You can set up the verifies on your sudoer template like this: template '/etc/sudoers' do source 'whatever

Failing To Find Chef Community Cookbooks Using Chef 12 On AWS Opsworks

旧街凉风 提交于 2019-12-22 09:51:35
问题 The Problem When running custom cookbooks on AWS OpsWorks a setup_failed status appears against the instance and the following in the failure log: [2016-03-26T22:53:48+00:00] INFO: Started chef-zero at chefzero://localhost:8889 with repository at /var/chef One version per cookbook data_bags at /var/chef/runs/62832572-cb67-421a-8309-d831140d7b98/data_bags nodes at /var/chef/runs/62832572-cb67-421a-8309-d831140d7b98/nodes [2016-03-26T22:53:48+00:00] INFO: Forking chef instance to converge...