通过厨师为用户添加授权密钥

时间:2016-01-25 21:27:37

标签: chef chef-solo

我尝试使用厨师为部署添加授权密钥,但我收到了无方法错误。

错误

[2016-01-25T21:24:01+00:00] ERROR: No resource or method named `user_ssh_keys_key' for `Chef::Recipe "user"'

user.rb

user_ssh_keys_key 'deploy' do
  authorized_keys node['ssh_public_keys']
  authorized_users %w(deploy)
end

berksfile

cookbook 'user-ssh-keys', '~> 1.0.2'

属性/ default.rb

default['ssh_public_keys'] = ['...','...']

1 个答案:

答案 0 :(得分:4)

您能否检查一下您是否已将依赖关系添加到user-ssh-keys中的metadata.rb食谱中?

它应该是这样的:

depends 'user-ssh-keys', '~> 1.0.2'

相关问题