Add not_if to packages_repo.rb #59

Closed
wants to merge 1 commit into
from

Projects

None yet

4 participants

@pioneerit
Contributor

Problem - try add apk-key on every run chef-client
And I got few errors. With timeout or network problems.
As example:
---- Begin output of apt-key adv --keyserver keys.gnupg.net --recv 1C4CBDCDCD2EFD2A ---- STDOUT: Executing: gpg --ignore-time-conflict --no-options --no-default-keyring --secret-keyring /tmp/tmp.oiRYKunQxV --trustdb-name /etc/apt/trustdb.gpg --keyring /etc/apt/trusted.gpg --primary-keyring /etc/apt/trusted.gpg --keyserver keys.gnupg.net --recv 1C4CBDCDCD2EFD2A gpgkeys: key 1C4CBDCDCD2EFD2A not found on keyserver STDERR: gpg: requesting key CD2EFD2A from hkp server keys.gnupg.net gpg: no valid OpenPGP data found. gpg: Total number processed: 0 ---- End output of apt-key adv --keyserver keys.gnupg.net --recv 1C4CBDCDCD2EFD2A ----

@pioneerit pioneerit Add not_if.
Problem - try add apk-key on every run chef-client
8ebeca3
@phlipper
Owner
phlipper commented Apr 9, 2013

@pioneerit what version of the apt cookbook are you using?

@pioneerit
Contributor

@phlipper I used 1.9.0 now.
In [changelog|https://github.com/opscode-cookbooks/apt/blob/master/CHANGELOG.md] didn't find anything about that.
And providers didn't has some changes from 1.9.0

But if checked [apt / providers / repository.rb|https://github.com/opscode-cookbooks/apt/blob/master/providers/repository.rb]

def install_key_from_keyserver(key, keyserver)
  execute "install-key #{key}" do
    if !node['apt']['key_proxy'].empty?
      command "apt-key adv --keyserver-options http-proxy=#{node['apt']['key_proxy']} --keyserver #{keyserver} --recv #{key}"
    else
      command "apt-key adv --keyserver #{keyserver} --recv #{key}"
    end
    action :run
    not_if "apt-key list | grep #{key}"
  end
end

Install key - and checked key is the same. But in Percona you use full key 1C4CBDCDCD2EFD2A
That key never wouldn't checked by apt-key list. I will test in few days work with 'CD2EFD2A' instead '1C4CBDCDCD2EFD2A'. I think it will help.

@phlipper
Owner

@pioneerit thanks for the information. There is definitely some cleanup that can be done in here. Let me know how your testing turns out. Thanks!

@mikesmullin

merged your change into my branch. thx

@patcon
Contributor
patcon commented Jun 24, 2013

I think both key and key_id work in the key resource attribute (for some reason), but I think the key_id is what opscode used in the mysql:percona_repo recipe:
https://github.com/opscode-cookbooks/mysql/blob/master/attributes/percona_repo.rb#L1

Perhaps that's the route we should go?

I'll investigate how this is working later

@phlipper
Owner

Closed via c1bc6b3 and 34e9391.

@phlipper phlipper closed this Sep 27, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment