Add not_if to packages_repo.rb #59

wants to merge 1 commit into


None yet

4 participants


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 --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 --recv 1C4CBDCDCD2EFD2A gpgkeys: key 1C4CBDCDCD2EFD2A not found on keyserver STDERR: gpg: requesting key CD2EFD2A from hkp server gpg: no valid OpenPGP data found. gpg: Total number processed: 0 ---- End output of apt-key adv --keyserver --recv 1C4CBDCDCD2EFD2A ----

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

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


@phlipper I used 1.9.0 now.
In [changelog|] didn't find anything about that.
And providers didn't has some changes from 1.9.0

But if checked [apt / 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}"
      command "apt-key adv --keyserver #{keyserver} --recv #{key}"
    action :run
    not_if "apt-key list | grep #{key}"

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.


@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!


merged your change into my branch. thx

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:

Perhaps that's the route we should go?

I'll investigate how this is working later


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