Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dnf_package :lock does not work on centos8 #9189

Open
TiTi opened this issue Dec 26, 2019 · 0 comments
Open

dnf_package :lock does not work on centos8 #9189

TiTi opened this issue Dec 26, 2019 · 0 comments

Comments

@TiTi
Copy link

@TiTi TiTi commented Dec 26, 2019

Description

dnf_package action :lock doesn't work

it's also pretty obvious as the implementation only throws an exception

def package_locked(name, version)

#9013 seems linked
looks like everything is not implemented, despite being documented 😢

This is the error i get:

           Chef::Exceptions::UnsupportedAction
           -----------------------------------
           #<Chef::Provider::Package::Dnf:0x0000000004926220> has no way to detect if package is locked

Chef Version

15.6.10

Platform Version

CentOS 8

Replication Case

Run this recipe:

  es_version = node['elasticsearch']['version'].to_i
  yum_repository "elasticsearch-oss-#{es_version}.x" do
    description "Elasticsearch repository for #{es_version}.x OSS packages"
    baseurl "https://artifacts.elastic.co/packages/oss-#{es_version}.x/yum"
    gpgkey 'https://artifacts.elastic.co/GPG-KEY-elasticsearch'
    action :create
  end

  dnf_package 'elasticsearch-oss' do
    version node['elasticsearch']['version']
    action [:install, :lock]
  end

on a generic/centos8 vagrant box
i'm using this attribute:

default['elasticsearch']['version'] = '7.3.2'

Client Output

         * dnf_package[elasticsearch-oss] action install
           - install version 7.3.2 of package elasticsearch-oss
         * dnf_package[elasticsearch-oss] action lock

           ================================================================================
           Error executing action `lock` on resource 'dnf_package[elasticsearch-oss]'
           ================================================================================

           Chef::Exceptions::UnsupportedAction
           -----------------------------------
           #<Chef::Provider::Package::Dnf:0x0000000004926220> has no way to detect if package is locked

           Resource Declaration:
           ---------------------
           # In /tmp/kitchen/cache/cookbooks/eod_es_base/recipes/install_es.rb

            53:   dnf_package es_package_name do
            54:     version node['elasticsearch']['version']
            55:     action [:install, :lock]
            56:   end
            57: end

           Compiled Resource:
           ------------------
           # Declared in /tmp/kitchen/cache/cookbooks/eod_es_base/recipes/install_es.rb:53:in `from_file'

           dnf_package("elasticsearch-oss") do
             package_name "elasticsearch-oss"
             action [:install, :lock]
             updated true
             default_guard_interpreter :default
             declared_type :dnf_package
             cookbook_name "eod_es_base"
             recipe_name "install_es"
             version "7.3.2"
           end

           System Info:
           ------------
           chef_version=15.6.10
           platform=centos
           platform_version=8.0.1905
           ruby=ruby 2.6.5p114 (2019-10-01 revision 67812) [x86_64-linux]
           program_name=/opt/chef/bin/chef-client
           executable=/opt/chef/bin/chef-client
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.