- From: Marcelo de Moraes Serpa <
>
- To:
- Subject: [chef] Strange order execution of recipes, chef-solo
- Date: Mon, 26 Nov 2012 15:15:18 -0600
Hello list,
So I have my own recipe, and it's like an "aggregator" recipe, it's the only recipe in the run list for my node, and it in turn calls other recipes in order to build the node and deploy a couple of apps.
My default.rb for this recipe looks like this:
include_recipe "build-essential"
include_recipe "user::data_bag"
include_recipe "sudo"
include_recipe "fullofcaffeine::setup_keys"
include_recipe "git::default" #sets up git
include_recipe "nginx::default" #installs nginx
include_recipe "runit"
include_recipe "unicorn"
include_recipe "ruby"
package "libpq-dev"
require_recipe "postgresql::client"
require_recipe "postgresql::server"
require_recipe "fullofcaffeine::deploy_rack_apps"
I'm cooking a new node now, and I just got the following error:
Error executing action `create` on resource 'file[/home/deploy/.ssh/id_deploy
This is caused by the "fullofcaffeine::setup_keys" recipe, which is pretty simple, and looks like:
# Handle ssh key for git private repo
secret = Chef::EncryptedDataBagItem.load_secret('/tmp/chef-solo/data_bag_key')
secrets = Chef::EncryptedDataBagItem.load("deploy_keys", "marcelo-laptop",secret)
file "/home/deploy/.ssh/id_deploy" do
action :nothing
content secrets["deploy_key"]
owner "deploy"
group "deploy"
mode '0600'
end.run_action(:create)
However, for some reason, the user::data_bag (
https://github.com/fnichol/chef-user) - the one that should have created the deploy user before the setup of keys - did not run, and hence the deploy key could not be written in the non-existent path for the deploy user.
Any ideas why this happens? Any insights appreciated, I'm a bit lost here.
Thanks in advance,
- Marcelo.
- [chef] Strange order execution of recipes, chef-solo, Marcelo de Moraes Serpa, 11/26/2012
Archive powered by MHonArc 2.6.16.