I've implemented sth. very similar here
ruby_block "save keys to attributes" do
only_if { public_key.to_s == "" }
block do
private_key = File.read(ssh_key)
public_key = File.read(ssh_key + ".pub")
node.set['gerrit']['peer_keys']['private'] = private_key
node.set['gerrit']['peer_keys']['public'] = public_key
end
end
I think the precedence level "default" that you use is causing the problems, but I'm unsure, what the exact problem is in your code.