chef

How to control the version of Chef that Vagrant uses to provision VMs?

℡╲_俬逩灬. 提交于 2019-11-28 02:48:58
A current Chef recipe isn't running because of a bug in version 0.10.10. How can I upgrade the version of Chef that Vagrant uses, to 0.10.12? I don't want to just update it for the current instance of the VM - I keep destroying and rebuilding those. Do I need to change something in the Vagrant base box, or something in my (physical) system's installation? Using the Vagrant plugin vagrant-omnibus worked great for me: vagrant plugin install vagrant-omnibus You can then simply configure your chef version in the Vagrantfile before doing the provisioning: config.omnibus.chef_version = :latest You

Chef BERKSHELF3 proxy settings - Windows platform

我怕爱的太早我们不能终老 提交于 2019-11-28 02:19:28
问题 I just wanna know how to set proxy values(Url, user, password) for Berkshelf3 under windows platform when I launch the command >berks intall ? I already try in cmd command: http_proxy='http://xx.xx.xx.xx' http_proxy_user=USERNAME http_proxy_pass=PASSWORD The reamining issue: C:\chef-repo-distant\cookbooks\putty>berks install Resolving cookbook dependencies... Fetching 'putty' from source at . Fetching cookbook index from ttps://supermarket.getchef.com... C:/opscode/chefdk/embedded/lib/ruby/2

How I can capture values in command line and add to recipe?

点点圈 提交于 2019-11-28 00:26:25
I am new to Chef and Ruby I need to pass two variables to Chef on the command line and have those variables available in a recipe. How I can capture these values and get them in Chef? I need something like this: before_deploy command execute param1 param2 deploy{ param1/param2} Where param1 and param2 get their values at run-time from the command-line. When you provision the machine by running chef-solo or chef-client you cannot provide any arguments to these commands that can be visible to recipes. Chef recipes work only with attributes . Good thing (or not so good) is that attributes can be

how to run a java program at background from chef recipe

坚强是说给别人听的谎言 提交于 2019-11-27 19:05:15
问题 I am a chef rookie. I want to create a recipe to run a jar at background. bash 'run_jar' do code <<-EOH wget https://github.com/kiwiwin/jar-repo/releases/download/kiwi/helloworld-1.0.jar -O hello.jar java -jar hello.jar & EOH end The helloworld-1.0.jar is a program first print "Hello World", then execute a while(true) loop. I expect when I login to the chef-client machine. It should indicate there is a jar running using "jps" command. But there is no such jar running. And I can see the hello

Can I modify the ownership for a shared folder in vagrant?

懵懂的女人 提交于 2019-11-27 19:00:07
I use vagrant and chef to develop my own blog in a virtual machine. To have easy access to the wordpress folder I created a shared folder. Basically the wordpress folder is on my host and gets mounted as shared folder in /var/www/wordpress in the VM. The configuration is similar to: config.vm.share_folder "foo", "/guest/path", "/host/path" My problem is that the ownership in my VM is always vagrant:vagrant even if I change it on my host. Ownership changes in the VM get ignored. I cannot use chown to set the ownership of the upload directory to www-data:www-data . It is possible to use chmod

How can you use a Chef recipe to set an environment variable?

夙愿已清 提交于 2019-11-27 12:37:04
How can you use a Chef recipe to set an environment variable? I need to set an environment variable using a Chef recipe. Can you provide an example of how to accomplish this? jodell If you need an env var set strictly within the Chef process, you can use ENV['foo'] = 'bar ' since it's a ruby process. If you need to set one for an execute provider , Chef exposes an environment hash: execute 'Bootstrap the database' do cwd "#{app_dir}/current" command "#{env_cmd} rake db:drop db:create db:schema:load RAILS_ENV=#{rails_env}" environment 'HOME' => "/home/#{app_user}" user app_user action :run not

Git authentication in Chef

£可爱£侵袭症+ 提交于 2019-11-27 12:04:42
问题 When deploying an application with Chef, I've got the code base set to be cloned from a private github repository with the following resource: git '/mnt/application' do repository 'git@github.com:organization/repository' reference 'master' action :sync user node.application.user group node.application.user end However, after scanning the documentation for the git resource, I can't see how you supply the key file for authentication. I'm also confused as to how to store this key in a data bag,

How to move/copy files locally with Chef

白昼怎懂夜的黑 提交于 2019-11-27 11:12:09
I haven't yet come across a Chef resource that will copy/move files locally. For example, I want to download jetty hightide and unzip it. Once done, copy all the files into a particular folder, like this: # mv /var/tmp/jetty-hightide-7.4.5.v20110725/* /opt/jetty/ BTW, jettyhightide when unzipped, gives you a folder and inside that folder rest of the files are located. Hence unzip jetty-hightide-7.4.5.v20110725.zip -d /opt/jetty/ is useless because it will create a directory /opt/jetty/jetty-hightide-7.4.5.v20110725/* whereas what I really want is /opt/jetty/* . Hence I am looking for a local

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

一些新技术的整理

二次信任 提交于 2019-11-27 06:39:33
Jetty : Jetty 是一个开源的servlet容器,它为基于Java的web内容,例如JSP和servlet提供运行环境。Jetty是使用 Java语言 编写的,它的API以一组JAR包的形式发布。开发人员可以将Jetty容器实例化成一个对象,可以迅速为一些独立运行(stand-alone)的Java应用提供网络和web连接. Chef : "Chef is like a little system admin robot ... you tell it how you want your system configured, and it will do all the dirty work." http://wiki.opscode.com/display/chef/About Akka: Akka is the platform for the next generation of event-driven, scalable and fault-tolerant architectures on the JVM Zookeeper : Zookeeper 分布式服务框架是 Apache Hadoop 的一个子项目,它主要是用来解决分布式应用中经常遇到的一些数据管理问题,如:统一命名服务、状态同步服务、集群管理、分布式应用配置项的管理等。 Scala : 是一种