在oracle linux(oel)

时间:2016-12-01 13:05:48

标签: linux package chef rpm yum

我正在努力安装以本地下载的rpm文件形式提供的软件包 - 仅在Oracle Linux(OEL)上。有bug吗?有人观察过这个吗?这将是一个巨大的错误,所以我有点惊讶。

厨师食谱非常简单:

pkg_src_location = 'https://s3.amazonaws.com/solution-automation-folder/qualys'
pkg = 'qualys-cloud-agent.x86_64.rpm'
local_image = "#{Chef::Config['file_cache_path']}/#{pkg}"

remote_file 'qualys-cloud-agent-image' do
  path local_image
  source "#{pkg_src_location}/#{pkg}"
end

package 'qualys-cloud-agent' do
  source local_image
end

可从https://github.com/r2oro/oel_pkg_test.git获取。

我观察到在Oracle Linux(OEL)上会导致以下python脚本被触发:

/usr/bin/python /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.16.42/lib/chef/provider/package/yum/yum-dump.py --options --installed-provides --yum-lock-timeout 30

它运行了很长一段时间(下载几百兆字节的数据 - 据我所知 - yum repo元数据)并最终失败(调试模式下的厨房将所有这些转储到stdout ......)。无论如何,结果是:

     * yum_package[qualys-cloud-agent] action install[2016-12-01T12:35:32+00:00] ERROR: /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.16.42/lib/chef/provider/package/yum/yum-dump.py exceeded timeout 900


       ================================================================================
       Error executing action `install` on resource 'yum_package[qualys-cloud-agent]'
       ================================================================================

       Mixlib::ShellOut::CommandTimeout
       --------------------------------
       Command timed out after 900s:
       Command exceeded allowed execution time, process terminated
       ---- Begin output of /usr/bin/python /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.16.42/lib/chef/provider/package/yum/yum-dump.py --options --installed-provides --yum-lock-timeout 30 ----
       STDOUT:
       STDERR:
       ---- End output of /usr/bin/python /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.16.42/lib/chef/provider/package/yum/yum-dump.py --options --installed-provides --yum-lock-timeout 30 ----
       Ran /usr/bin/python /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.16.42/lib/chef/provider/package/yum/yum-dump.py --options --installed-provides --yum-lock-timeout 30 returned

       Resource Declaration:
       ---------------------
       # In /tmp/kitchen/cache/cookbooks/oel_pkg_test/recipes/default.rb

        16: package 'qualys-cloud-agent' do
        17:   source local_image
        18: end

       Compiled Resource:
       ------------------
       # Declared in /tmp/kitchen/cache/cookbooks/oel_pkg_test/recipes/default.rb:16:in `from_file'

       yum_package("qualys-cloud-agent") do
         package_name "qualys-cloud-agent"
         action [:install]
         retries 0
         retry_delay 2
         default_guard_interpreter :default
         declared_type :package
         cookbook_name "oel_pkg_test"
         recipe_name "default"
         source "/tmp/kitchen/cache/qualys-cloud-agent.x86_64.rpm"
         flush_cache {:before=>false, :after=>false}
       end

您是否注意到yum flush_cache应该发生,但它仍然存在?令人沮丧。这个始终在我当地的厨房(有流浪/虚拟盒)或甚至在AWS云厨房中都失败了......真实的实例有时会失败有时会聚合......但它是一个乐透。无论如何为什么这个缓存更新发生在单个本地rpm映像!?

我确实尝试使用rpm_package,但这会导致其他食谱中使用的yum_package存在问题......

有什么想法吗?

1 个答案:

答案 0 :(得分:1)

在这种情况下,您可能确实想要使用rpm_package,但至于为什么缓存正在重新加载,它可能只是第一次被命中,因此必须进行初始重新加载,或者它&# 39; s在其他东西修改了包装之后。