从超市安装java 1.8

时间:2018-01-19 09:53:17

标签: chef chef-recipe

我正在尝试使用来自超市的社区食谱从https://supermarket.chef.io/cookbooks/java/versions/1.8.2安装java 1.8.2。 我在metadata.rb中添加了依赖项,并在berksfile中添加了。在配方中添加include_recipe,当我运行时,我收到以下错误。我检查了没有yum repo配置不确定是否因为它。如果端点上已经安装了java 1.8,它还会安装吗?

 * yum_package[java-1.6.0-openjdk] action install[2018-01-19T04:22:52-05:00] INFO: Processing yum_package[java-1.6.0-openjdk] action install (java::openjdk line 93)

    * No candidate version available for java-1.6.0-openjdk
    ================================================================================
    Error executing action `install` on resource 'yum_package[java-1.6.0-openjdk]'
    ================================================================================

    Chef::Exceptions::Package
    -------------------------
    No candidate version available for java-1.6.0-openjdk

    Resource Declaration:
    ---------------------
    # In /var/chef/cache/cookbooks/java/recipes/openjdk.rb

     93:   package pkg do
     94:     action :install
     95:     notifies :create, "ruby_block[update-java-alternatives]", :immediately if platform?("ubuntu","debian","redhat","centos","fedora","scientific","amazon")
     96:   end
     97: end

    Compiled Resource:
    ------------------
    # Declared in /var/chef/cache/cookbooks/java/recipes/openjdk.rb:93:in `block in from_file'

    yum_package("java-1.6.0-openjdk") do
      package_name "java-1.6.0-openjdk"
      action [:install]
      retries 0
      retry_delay 2
      default_guard_interpreter :default
      declared_type :package
      cookbook_name "java"
      recipe_name "openjdk"
      flush_cache {:before=>false, :after=>false}
    end

    System Info:
    ------------
    chef_version=12.21.26
    platform=redhat
    platform_version=7.4
    ruby=ruby 2.3.5p376 (2017-09-14 revision 59905) [x86_64-linux]
    program_name=chef-client worker: ppid=3118;start=04:22:48;
    executable=/opt/chef/bin/chef-client

1 个答案:

答案 0 :(得分:0)

要安装openjdk 1.8,您应该使用最新的java cookbook版本(Token authentication,而不是1.50.x)。 Cookbook版本与java版本不匹配。

在您的食谱中,您应该输入以下代码:

1.8.2