chef

How can I change a file with Chef?

↘锁芯ラ 提交于 2019-11-27 03:50:34
I have 7 files and 1 war. I need to change values when I deploy them. I have this: ##usuario #alfresco.user=***** alfresco.user=******** ##pass #alfresco.password= sfsfs alfresco.password=sfgsf alfresco.rutaAnexos=/gthtfdh/dfgdf/cm: #atributo.type.anexo=ANEXO_INFO_OBJETO atributo.type.anexo=AN atributo.type.observaciones=OBSERVACIONES I need to comment some lines and uncomment some other lines. Then I need to make seven templates and put variables depending on the environments and create a file in the recipe. How can I do this? StephenKing By design, you don't modify files with Chef. Instead

to_specs': Could not find chef (>= 0) amongst [] (Gem::LoadError)

不想你离开。 提交于 2019-11-27 02:42:22
问题 I am trying to install chef and knife ec2 plugin on my laptop to set up the workstation. Initially I use chef omnibus to install chef-client but after installing I encountered some problems, so a quick googling landed me to stackoverflow and couple of threads suggested me to install chef using gem. I am running on ruby 2.0.0-p0 and insalled chef and knife ec2 but I am getting a different issue now. I have posted the issue bleow, kindly have a look. Please help me out to fix me this issue

Compile time vs. run time in Chef recipes

我的梦境 提交于 2019-11-27 01:30:27
I have the following (simplified) recipe called java, to install Java of course. File recipes/default.rb include_recipe "install_java" File recipes/install_java.rb # Install RPM from yum repo via yum_install library function yum_install("jdk1.7.0_51") # List the directories in /usr/java jdk_dir = `ls -ld /usr/java/jdk1.* | sort | tail -1` if jdk_dir.empty? raise "Missing JDK installation" end When I run the recipe by "chef-client -o recipe[java]" Synchronizing Cookbooks: - java Compiling Cookbooks... ls: /usr/java/jdk1.*: No such file or directory ==============================================

Difference between convergence and idempotence in Chef

梦想的初衷 提交于 2019-11-27 00:57:46
问题 What is the basic difference between convergence and idempotence in Chef? 回答1: Convergence and idempotence are not Chef-specific. They're generally attributed to configuration management theory, though have use in other fields, notably mathematics. Let's start with the more basic, idempotent. We're going to ignore the mathematic use of idempotent, and focus instead on what configuration management people mean when they talk about it. That is: "multiple applications of the same action do not

Chef libraries or definitions?

独自空忆成欢 提交于 2019-11-27 00:11:58
问题 Being relatively new to Chef, I am required to create libraries or definitions from existing recipes. There recipes use bash resource, ruby block resource (which notifies another ruby block resource with delayed timing), template resource again which notifies a ruby block etc. What would be the best approach to this? Library or definition? I have read that if I use definition, I won't be able to notify a resource within the definition, does that mean I can notify a resource in a different

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

不羁岁月 提交于 2019-11-26 21:41:54
问题 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. 回答1: When you provision the machine by running chef-solo or chef-client you cannot provide any arguments to these commands that can be visible

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

痴心易碎 提交于 2019-11-26 19:35:57
问题 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

Use of @ symbol in Node module names

馋奶兔 提交于 2019-11-26 06:35:20
问题 I\'m looking at some code from a coworker wrote and she\'s using the @ symbol in require statements. This is the first line of one of these files: var restServer = require(\'@company/config\') When I try to run this code, I get an error: Error: Cannot find module \'@company/config\' Which I frankly expect, there\'s nothing that looks like this in my directory for require to recognize! It seems like there\'s some magic going on here, which I hate. All I can guess is that either this is some