application cookbook with node js
I have modified that opscode application cookbook to include support for node servers and applications. So far things have worked out pretty well and I only have one issue.
When I get to the point where the recipe should clone the repository from git I am prompted to enter the passphrase for the deploy key. The odd thing about this is no passphrase was created for this deploy key.
This is what I am seeing during provisioning:
This is the current state of my recipe: https://gist.github.com/2423774
This is the current state of my data bag(deploy_key/repository removed): https://gist.github.com/2423781
Offline install - aka a recipe that doesn't retrieve resources from the internet
I’m completely new to Chef and have a few questions.
Over the last year or so – I’ve developed an installer for my Rails apps. The key requirement was that this installer needed to be able to function ‘off line’ – aka on a server not connected to the internet. The biggest consequence of this requirement (not made up by me) is that all the resources that the installer needs need to be available on a CD / iso image. So what I do is essentially create a shell script that installs everything from a local directory. This directory is created by another program I’ve created that essentially builds the installer.
I’d like to know if I can some how use Chef to create a chef recipe that only access resources locally (i.e. NOT from the internet). Ideally – there would be a way to run this recipe first so that all the resources could be retrieved from the internet and stored locally for later use.
Hopefully this makes sense and hopefully this is possible with Chef.
Thanks Dave Ekhaus firstname.lastname@example.org
Is setting node attributes in ruby_block impossible?
I have a Chef recipe for a multi-node web service, each node of which needs to get the hostname and IP of the other nodes, to put it into its own local configuration.
The code is shown below. The problem is that when the node.set assignments are made in the ruby_block as shown, the values are empty when the template that relies upon them is created. If I want to create that template, I have to move all of the ruby_block code outside, and have it “loose” in the recipe. Which makes it harder to do unit-testing with Chefspec and the like.
Can any Chef guru set me straight? Is it just impossible to do node.set like this inside of a ruby_block? And if so, why doesn’t it say so in the docs?
I also added
subscribes :create, “ruby_block[get host addresses]”, :immediately to the template definition to ensure that the ruby_block ran before the template was created. This didn’t make a difference.