首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >菜谱的未定义方法`poise_service_user‘:newrelic infra

菜谱的未定义方法`poise_service_user‘:newrelic infra
EN

Stack Overflow用户
提问于 2019-08-28 19:56:43
回答 1查看 499关注 0票数 2

我正试图为我的项目设置新厨师长食谱使用厨师单独。遵循其文档中列出的指南:使用厨师配置新的文物基础设施

目标:

在ubuntu框中启动新的下位服务。

上述步骤如下:

新文物菜谱在公共厨师超市有售。使用厨师安装和配置新文物基础设施:

  1. 在您自己的主厨metadata.rb或Berksfile - Done中添加新的-infra依赖项。

metadata.rb

代码语言:javascript
复制
depends 'newrelic-infra'
  1. 设置New许可密钥属性。例如,将以下内容添加到您的菜谱/default.rb:- to

新文物-infra/attributes/default.rb

代码语言:javascript
复制
# New Relic infrastructure agent configuration options
default['newrelic_infra']['config'].tap do |conf|
  # Account license key
  conf['license_key'] = 'added my license key here'
  1. 通过使用include_recipe‘newrelic infra::default’或将菜谱添加到您的运行列表中,包括默认的newrelic菜谱。- Done

新的文物烹饪书的依赖是平衡服务和平衡存档v1.5.0 :,所以我已经将所有三本烹饪书都添加到了运行列表中。流浪文件如下所示:

代码语言:javascript
复制
Vagrant.configure('2') do |config|
config.vm.box = 'bento/ubuntu-18.04'
...
...
config.vm.provision 'shell', inline: <<~SHELL
wget -q -O /tmp/chefdk.deb  https://packages.chef.io/files/stable/chefdk/3.2.30/ubuntu/18.04/chefdk_3.2.30-1_amd64.deb
apt-get -q install -y /tmp/chefdk.deb
mkdir /tmp/cookbooks
  ...
rsync -av  /vagrant/infrastructure-agent-chef/ /tmp/cookbooks/newrelic-infra/
git clone https://github.com/poise/poise-service.git /tmp/cookbooks/poise-service
cd /tmp/cookbooks/poise-service && git checkout v1.5.0
git clone https://github.com/poise/poise-archive.git /tmp/cookbooks/poise-archive
cd /tmp/cookbooks/poise-archive && git checkout v1.5.0
echo '{"run_list":["recipe[newrelic-infra]", "recipe[poise-service]", "recipe[poise-archive]"]}' > /tmp/runlist.json
chef-solo -j /tmp/runlist.json --recipe-url /tmp/random.tar.gz 
SHELL
end

最后,当我使用流浪者运行newrelic infra服务时,我会看到以下错误:

代码语言:javascript
复制
default: Starting Chef Client, version 14.4.56 default: resolving cookbooks for run list: ["newrelic-infra", "poise-service", "poise-archive"] default: Synchronizing Cookbooks: default: - newrelic-infra (0.11.0) default: - poise-service (0.0.0) default: default: - poise-archive (0.0.0) default: Installing Cookbook Gems: default: Compiling Cookbooks... default: default: ================================================================================ default: Recipe Compile Error in /etc/chef/local-mode-cache/cache/cookbooks/newrelic-infra/recipes/default.rb default: ================================================================================ default: default: default: NoMethodError default: ------------- default: undefined method poise_service_user' for cookbook: newrelic-infra, recipe: agent_linux :Chef::Recipe
default:
default:
default: Cookbook Trace:
default: ---------------
default: /etc/chef/local-mode-cache/cache/cookbooks/newrelic-infra/recipes/agent_linux.rb:17:in from_file' default: default: /etc/chef/local-mode-cache/cache/cookbooks/newrelic-infra/recipes/default.rb:11:in from_file'
default:
default: Relevant File Content:
default: ----------------------
default: /etc/chef/local-mode-cache/cache/cookbooks/newrelic-infra/recipes/agent_linux.rb:
default:
default: 10: #
default: 11: node.default['newrelic_infra']['agent']['flags']['config'] = ::File.join(
default: 12: node['newrelic_infra']['agent']['directory']['path'],
default: 13: node['newrelic_infra']['agent']['config']['file']
default: 14: )
default: 15:
default: 16: # Setup a service account
default: 17>> poise_service_user node['newrelic_infra']['user']['name'] do
default: 18: group node['newrelic_infra']['group']['name']
default: 19: only_if { node['newrelic_infra']['features']['manage_service_account'] }
default: 20: end
default: 21:
default: 22: # Based on the Ohai attribute platform_family either an APT or YUM repository
default: 23: # will be created. The respective Chef resources are built using metaprogramming,
default: 24: # so that the configuration can be extended via attributes without having to
default: 25: # release a new version of the cookbook. Attributes that cannot be passed to the resource
default: 26: # are logged out as warnings in order to prevent potential failes from typos,
default:
default: System Info:
default: ------------
default: chef_version=14.4.56
default: platform=ubuntu
default: platform_version=18.04
default: ruby=ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-linux]
default: program_name=/usr/bin/chef-solo
default: executable=/opt/chefdk/bin/chef-solo
default:
default:
default: Running handlers:`

我花了几个小时在GitHub中查看烹饪书的源代码,但是还没有找到解决问题的方法吗?我对主厨或红宝石非常陌生,所以我非常感谢你的建议。

谢谢!

有用的链接:

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2019-08-29 16:24:45

我在GitHub上提出了一个问题,看起来这份平衡服务的食谱已经不再维护了,几个小时前它的主人就把它存档了。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/57699274

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档