- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试使用 Chef Cookbook 在 CentOS 7 上安装 Java JDK 1.8。
我在 Windows 10 上使用 Chef DK,并且已从 https://downloads.chef.io/chefdk 下载
在我的 Berksfile
中,我已经
source 'https://supermarket.chef.io'
metadata
我的Kitchen.yml
如下
---
driver:
name: vagrant
provisioner:
name: chef_zero
# You may wish to disable always updating cookbooks in CI or other testing environments.
# For example:
# always_update_cookbooks: <%= !ENV['CI'] %>
always_update_cookbooks: true
verifier:
name: inspec
platforms:
- name: centos-7
suites:
- name: default
run_list:
- recipe[test::default]
verifier:
inspec_tests:
- test/integration/default
attributes:
我的metadata.rb
如下
name 'test'
maintainer 'The Authors'
maintainer_email 'you@example.com'
license 'All Rights Reserved'
description 'Installs/Configures test'
long_description 'Installs/Configures test'
version '0.1.0'
chef_version '>= 12.14' if respond_to?(:chef_version)
depends 'java', '~> 2.2.0'
我的recipes/default.rb
node.default["java"]["install_flavor"] = "oracle"
node.default["java"]["jdk_version"] = "8"
node.default['java']['oracle']['accept_oracle_download_terms'] = true
include_recipe "java"
及其attributes/recipe.rb
default['java']['install_flavor'] = 'oracle'
default['java']['jdk_version'] = '8'
default['java']['oracle']['accept_oracle_download_terms'] = true
当我尝试执行kitchen融合
时,输出是
-----> Starting Kitchen (v1.22.0)
-----> Converging <default-centos-7>...
Preparing files for transfer
Preparing dna.json
Resolving cookbook dependencies with Berkshelf 7.0.4...
Removing non-cookbook files before transfer
Preparing validation.pem
Preparing client.rb
-----> Chef Omnibus installation detected (install only if missing)
Transferring files to <default-centos-7>
Starting Chef Client, version 14.3.37
resolving cookbooks for run list: ["test::default"]
Synchronizing Cookbooks:
- windows (5.0.0)
- homebrew (5.0.4)
- test (0.1.0)
- java (2.2.0)
Installing Cookbook Gems:
Compiling Cookbooks...
================================================================================
Recipe Compile Error in /tmp/kitchen/cache/cookbooks/test/recipes/default.rb
================================================================================
NoMethodError
-------------
undefined method `java_oracle_install' for cookbook: java, recipe: oracle :Chef::Recipe
Cookbook Trace:
---------------
/tmp/kitchen/cache/cookbooks/java/recipes/oracle.rb:40:in `from_file'
/tmp/kitchen/cache/cookbooks/java/recipes/default.rb:22:in `from_file'
/tmp/kitchen/cache/cookbooks/test/recipes/default.rb:8:in `from_file'
Relevant File Content:
----------------------
/tmp/kitchen/cache/cookbooks/java/recipes/oracle.rb:
33: version = node['java']['jdk_version'].to_s
34: tarball_url = node['java']['jdk'][version][arch]['url']
35: tarball_checksum = node['java']['jdk'][version][arch]['checksum']
36: bin_cmds = node['java']['jdk'][version]['bin_cmds']
37:
38: include_recipe 'java::set_java_home'
39:
40>> java_oracle_install 'jdk' do
41: url tarball_url
42: default node['java']['set_default']
43: checksum tarball_checksum
44: app_home java_home
45: bin_cmds bin_cmds
46: alternatives_priority node['java']['alternatives_priority']
47: retries node['java']['ark_retries']
48: retry_delay node['java']['ark_retry_delay']
49: connect_timeout node['java']['ark_timeout']
System Info:
------------
chef_version=14.3.37
platform=centos
platform_version=7.5.1804
ruby=ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-linux]
program_name=/opt/chef/bin/chef-client
executable=/opt/chef/bin/chef-client
Running handlers:
[2018-08-21T17:23:54+00:00] ERROR: Running exception handlers
[2018-08-21T17:23:54+00:00] ERROR: Running exception handlers
Running handlers complete
[2018-08-21T17:23:54+00:00] ERROR: Exception handlers complete
[2018-08-21T17:23:54+00:00] ERROR: Exception handlers complete
Chef Client failed. 0 resources updated in 04 seconds
[2018-08-21T17:23:54+00:00] FATAL: Stacktrace dumped to /tmp/kitchen/cache/chef-stacktrace.out
[2018-08-21T17:23:54+00:00] FATAL: Stacktrace dumped to /tmp/kitchen/cache/chef-stacktrace.out
[2018-08-21T17:23:54+00:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report
[2018-08-21T17:23:54+00:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report
[2018-08-21T17:23:54+00:00] FATAL: NoMethodError: undefined method `java_oracle_install' for cookbook: java, recipe: oracle :Chef::Recipe
[2018-08-21T17:23:54+00:00] FATAL: NoMethodError: undefined method `java_oracle_install' for cookbook: java, recipe: oracle :Chef::Recipe
>>>>>> ------Exception-------
>>>>>> Class: Kitchen::ActionFailed
>>>>>> Message: 1 actions failed.
>>>>>> Converge failed on instance <default-centos-7>. Please see .kitchen/logs/default-centos-7.log for more details
>>>>>> ----------------------
>>>>>> Please see .kitchen/logs/kitchen.log for more details
>>>>>> Also try running `kitchen diagnose --all` for configuration
有什么建议吗?
最佳答案
经过多次尝试(Slack Chef 聊天也支持...),我解决了:我不确定这个解决方案有多通用,但它有效。
问题是关于命令kitchen融合
的执行。
我注意到,当它失败并显示消息警告:在另一个 chdir block 期间冲突 chdir
时,会生成此消息(我不知道为什么......),在 Recipe 中的一些目录(在我的情况是,java
、windows
、homebrew
、ecc ..),这很奇怪。
我做了什么:
厨房销毁
C:\Users\USERNAME\.berkshelf
kitchen create
kitchen融合
警告:在另一个 chdir block 比较期间冲突 chdir
,并且 Recipe 中生成了一些奇怪的目录,请删除它们(手动)。 C:\Users\USERNAME\.berkshelf
(在我的例子中homebrew-5.0.4
,java-2.2.0
、tomcat-3.0.0
和 windows-5.0.0
)kitchen融合
直到没有错误产生这样我的CentOS 7目标节点上就已经安装了oracle java jdk 1.8
我希望这对其他人有用
关于java - 使用 Chef 在 CentOS 上安装 Java JDK 1.8,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51953977/
我有一套用于配置 Web 和 SQL 服务器的说明书,它们目前在我们的持续部署管道中使用。我希望开发人员能够使用相同的 Recipe 来设置他们的本地开发环境,而无需在 Chef 服务器上注册每台开发
我是 Chef 的新手,并且已经成功配置了我的三个节点 - 工作站、客户端和服务器。 Chef 文档提到了一个 Chef “repo”,其内容看起来与 Chef 服务器非常相似。两者有什么区别,或者它
我正在使用Solo Solo并尝试为Oh My Zsh安装食谱!这导致这个麻烦的错误: Failed to read the private key /etc/chef/client.pem: Err
我正在使用 Vagrant 和 Chef-solo 来测试我的食谱,但我有一个需要厨师服务器的特定食谱(它使用搜索)。我希望我的默认配方如下所示: include_recipe 'some_recip
我在计算机上设置了一个 Chef 客户端,以便使用 learnchef.com 提供的实验室进行练习。 我现在如何将我的 Chef 客户指向我们的内部 Chef 服务器(我们有 2 个非生产和生产服务
我有一个现有的 Chef 服务器设置,其中注册了大约 300 个节点。现在我想转移到另一个具有更新版本的 Chef 服务器。但是我不确定如何将所有节点和其他数据从较旧的 Chef 服务器迁移到较新的服
我正在将我的 Recipe 从 Chef 版本 12.11.18 升级到 13.6.4。某些版本 13 的特定说明在 Chef 版本 12 中不起作用,反之亦然。我现有的服务器仍然使用 Chef Cl
我正在测试一本食谱,其中一个 LWRP 似乎不包含我期望的属性。我需要查看在节点上设置的属性列表。有没有办法在 Vagrant 厨师独奏节点中做到这一点? 我用 kitchen converge它使用
我已经将 Chef 文件从我的 Chef 服务器复制到本地客户端节点,在 ~/.chef 下,我在 ~/.chef/environments 下有所有环境,例如development.rb, prod
对厨师来说完全陌生......我们曾经从 ppa 存储库安装 elasticsearch 但现在我想从头开始构建它(存储库不再更新)每次我更改我的 attributes/default.rb 中的版本
olr以下情况我该如何处理? /etc/init.d/chef-server-webui start * Starting chef-server-webui ~ In 15468 ...fa
尝试在我的 Oracle Linux Box 上安装 Chef。完全按照以下说明进行操作后,我到达了以下位置: 运行 Chef 独奏: (在网址中): http://wiki.opscode.com/
很明显,每个环境都使用一个策略组(如开发、暂存或生产,如 they do here)。然而,当涉及到处理一些与环境相关的属性时,例如名称或种子地址,与旧的角色/环境布局相比,使用策略文件处理起来非常棘
我有一本安装 nginx 并安装自定义 nginx.conf 文件的 Chef Recipe 。基本上就是 Opscode 上的 Cookbook,使用 cookbook_file 来安装文件。 如果
试图在谷歌云引擎上引导一个节点,但我所有的尝试都以失败告终代码 knife bootstrap ipaddress -x raid -i ~/.ssh/google_compute_engine --
我需要创建一个所有者为“testuser”的目录树。 但是,如果我指定“/foo/bar/baz”,则只有在“testuser”、“/foo”和“/foo/bar”下创建的“baz”归“root”用户
也许我错过了文档中的某些内容,但是在阅读了在多个地方定义时使用属性的顺序后,我不明白 中的属性设置的位置节点级别 进入等式 在可以设置和覆盖属性的 1 到 15 个级别中,它提到了配方、环境、角色、属
如何通过厨师将多个成员添加到组中? 我这样试过,但它失败了。 group "git" do action :modify members "foo, bar" append true en
Chef-如何获取命令输出到Ruby变量 我有以下情况,我在grep中获取文件 command "ls /filder1 | grep .txt" grep提供文件名/文件名的输出(如果存在)。 我想
我一直在尝试使用本指南在我的 CentOS 6.5 机器上安装 Chef 服务器 (chef-server-core-12.1.0-1.el6.x86_64.rpm):http://docs.chef
我是一名优秀的程序员,十分优秀!