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 (
GitHub - fnichol/chef-user: A convenient Chef LWRP to manage user accounts and SSH keys) - 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.