Anton Markelov
2012-Oct-12 00:59 UTC
[Puppet Users] Why second apt key receives again and again and again?
Hello, all. A have a manifest:> #key.pp - puppet::key class provides a keys for the puppetlabs repos with >> apt::key > > class puppet::key{ > > >> apt::key { "01puppetlabs": > > key => "4BD6EC30", > > key_options => >> "http-proxy=\"http://keyproxy@proxy.localnet:3128\"", > > key_server => "keys.gnupg.net", > > } > > >> apt::key { "02puppetlabs": > > key => "3B4FE6ACC0B21F32", > > key_options => >> "http-proxy=\"http://keyproxy@proxy.localnet:3128\"", > > key_server => "keys.gnupg.net", > > } > > } > >Apt::key class provided with puppetlabs-apt module with little additions (see https://github.com/strangeman/puppetlabs-apt, commit https://github.com/strangeman/puppetlabs-apt/commit/00155ccf1b2486e1a17e3b9f579c6e715fc06ccd ) First key (01puppetlabs) received 1 times, and all is good. But second key (02puppetlabs) recieves again and again and I don''t now, why.> root@testpuppet:/etc/puppet# puppet agent --test > > Info: Retrieving plugin > > Info: Loading facts in >> /etc/puppet/modules/stdlib/lib/facter/facter_dot_d.rb > > Info: Loading facts in >> /etc/puppet/modules/stdlib/lib/facter/puppet_vardir.rb > > Info: Loading facts in /etc/puppet/modules/stdlib/lib/facter/root_home.rb > > Info: Loading facts in /var/lib/puppet/lib/facter/facter_dot_d.rb > > Info: Loading facts in /var/lib/puppet/lib/facter/puppet_vardir.rb > > Info: Loading facts in /var/lib/puppet/lib/facter/root_home.rb > > Info: Caching catalog for testpuppet.localnet > > Info: Applying configuration version ''1350002030'' > > /Stage[first]/Puppet::Key/Apt::Key[02puppetlabs]/Exec[f4d6b744eb08aa083379d78e9b95b84493d4b2fe]/returns: >> executed successfully > > Finished catalog run in 2.40 seconds > > root@testpuppet:/etc/puppet# puppet agent --test > > Info: Retrieving plugin > > Info: Loading facts in >> /etc/puppet/modules/stdlib/lib/facter/facter_dot_d.rb > > Info: Loading facts in >> /etc/puppet/modules/stdlib/lib/facter/puppet_vardir.rb > > Info: Loading facts in /etc/puppet/modules/stdlib/lib/facter/root_home.rb > > Info: Loading facts in /var/lib/puppet/lib/facter/facter_dot_d.rb > > Info: Loading facts in /var/lib/puppet/lib/facter/puppet_vardir.rb > > Info: Loading facts in /var/lib/puppet/lib/facter/root_home.rb > > Info: Caching catalog for testpuppet.localnet > > Info: Applying configuration version ''1350002030'' > > /Stage[first]/Puppet::Key/Apt::Key[02puppetlabs]/Exec[f4d6b744eb08aa083379d78e9b95b84493d4b2fe]/returns: >> executed successfully > > Finished catalog run in 2.05 seconds > > root@testpuppet:/etc/puppet# puppet agent --test > > Info: Retrieving plugin > > Info: Loading facts in >> /etc/puppet/modules/stdlib/lib/facter/facter_dot_d.rb > > Info: Loading facts in >> /etc/puppet/modules/stdlib/lib/facter/puppet_vardir.rb > > Info: Loading facts in /etc/puppet/modules/stdlib/lib/facter/root_home.rb > > Info: Loading facts in /var/lib/puppet/lib/facter/facter_dot_d.rb > > Info: Loading facts in /var/lib/puppet/lib/facter/puppet_vardir.rb > > Info: Loading facts in /var/lib/puppet/lib/facter/root_home.rb > > Info: Caching catalog for testpuppet.localnet > > Info: Applying configuration version ''1350002030'' > > /Stage[first]/Puppet::Key/Apt::Key[02puppetlabs]/Exec[f4d6b744eb08aa083379d78e9b95b84493d4b2fe]/returns: >> executed successfully > > Finished catalog run in 2.05 seconds > > >Puppet version: 3.0.0-1puppetlabs1 (same for agent and master), OS: Debian 6 and Ubuntu 12.04. -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/G1lqkC0tAogJ. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Matthaus Owens
2012-Oct-12 17:50 UTC
Re: [Puppet Users] Why second apt key receives again and again and again?
The unless for the apt::key exec uses `apt-key list` and greps for the key name you gave the resource. apt-key prints out the shorter name for the key in the case of 3B4FE6ACC0B21F32, so the grep never finds the long name. Apt-key list for me shows pub 4096R/C0B21F32 2012-05-11 uid Ubuntu Archive Automatic Signing Key (2012) <ftpmaster@ubuntu.com> `apt-key list | grep 3B4FE6ACC0B21F32` returns 1, so the unless fails, and the exec runs again and again. If you use the shorter name (C0B21F32) as the name of your apt::key resource, the unless should correctly detect the key as being present. HTH On Thu, Oct 11, 2012 at 5:59 PM, Anton Markelov <doublic@gmail.com> wrote:> Hello, all. > > A have a manifest: > >>> >>> #key.pp - puppet::key class provides a keys for the puppetlabs repos with >>> apt::key >>> >>> class puppet::key{ >>> >>> >>> apt::key { "01puppetlabs": >>> >>> key => "4BD6EC30", >>> >>> key_options => >>> "http-proxy=\"http://keyproxy@proxy.localnet:3128\"", >>> >>> key_server => "keys.gnupg.net", >>> >>> } >>> >>> >>> apt::key { "02puppetlabs": >>> >>> key => "3B4FE6ACC0B21F32", >>> >>> key_options => >>> "http-proxy=\"http://keyproxy@proxy.localnet:3128\"", >>> >>> key_server => "keys.gnupg.net", >>> >>> } >>> >>> } > > > Apt::key class provided with puppetlabs-apt module with little additions > (see https://github.com/strangeman/puppetlabs-apt, commit > https://github.com/strangeman/puppetlabs-apt/commit/00155ccf1b2486e1a17e3b9f579c6e715fc06ccd) > First key (01puppetlabs) received 1 times, and all is good. But second key > (02puppetlabs) recieves again and again and I don''t now, why. >>> >>> root@testpuppet:/etc/puppet# puppet agent --test >>> >>> Info: Retrieving plugin >>> >>> Info: Loading facts in >>> /etc/puppet/modules/stdlib/lib/facter/facter_dot_d.rb >>> >>> Info: Loading facts in >>> /etc/puppet/modules/stdlib/lib/facter/puppet_vardir.rb >>> >>> Info: Loading facts in /etc/puppet/modules/stdlib/lib/facter/root_home.rb >>> >>> Info: Loading facts in /var/lib/puppet/lib/facter/facter_dot_d.rb >>> >>> Info: Loading facts in /var/lib/puppet/lib/facter/puppet_vardir.rb >>> >>> Info: Loading facts in /var/lib/puppet/lib/facter/root_home.rb >>> >>> Info: Caching catalog for testpuppet.localnet >>> >>> Info: Applying configuration version ''1350002030'' >>> >>> >>> /Stage[first]/Puppet::Key/Apt::Key[02puppetlabs]/Exec[f4d6b744eb08aa083379d78e9b95b84493d4b2fe]/returns: >>> executed successfully >>> >>> Finished catalog run in 2.40 seconds >>> >>> root@testpuppet:/etc/puppet# puppet agent --test >>> >>> Info: Retrieving plugin >>> >>> Info: Loading facts in >>> /etc/puppet/modules/stdlib/lib/facter/facter_dot_d.rb >>> >>> Info: Loading facts in >>> /etc/puppet/modules/stdlib/lib/facter/puppet_vardir.rb >>> >>> Info: Loading facts in /etc/puppet/modules/stdlib/lib/facter/root_home.rb >>> >>> Info: Loading facts in /var/lib/puppet/lib/facter/facter_dot_d.rb >>> >>> Info: Loading facts in /var/lib/puppet/lib/facter/puppet_vardir.rb >>> >>> Info: Loading facts in /var/lib/puppet/lib/facter/root_home.rb >>> >>> Info: Caching catalog for testpuppet.localnet >>> >>> Info: Applying configuration version ''1350002030'' >>> >>> >>> /Stage[first]/Puppet::Key/Apt::Key[02puppetlabs]/Exec[f4d6b744eb08aa083379d78e9b95b84493d4b2fe]/returns: >>> executed successfully >>> >>> Finished catalog run in 2.05 seconds >>> >>> root@testpuppet:/etc/puppet# puppet agent --test >>> >>> Info: Retrieving plugin >>> >>> Info: Loading facts in >>> /etc/puppet/modules/stdlib/lib/facter/facter_dot_d.rb >>> >>> Info: Loading facts in >>> /etc/puppet/modules/stdlib/lib/facter/puppet_vardir.rb >>> >>> Info: Loading facts in /etc/puppet/modules/stdlib/lib/facter/root_home.rb >>> >>> Info: Loading facts in /var/lib/puppet/lib/facter/facter_dot_d.rb >>> >>> Info: Loading facts in /var/lib/puppet/lib/facter/puppet_vardir.rb >>> >>> Info: Loading facts in /var/lib/puppet/lib/facter/root_home.rb >>> >>> Info: Caching catalog for testpuppet.localnet >>> >>> Info: Applying configuration version ''1350002030'' >>> >>> >>> /Stage[first]/Puppet::Key/Apt::Key[02puppetlabs]/Exec[f4d6b744eb08aa083379d78e9b95b84493d4b2fe]/returns: >>> executed successfully >>> >>> Finished catalog run in 2.05 seconds >> >> > > Puppet version: 3.0.0-1puppetlabs1 (same for agent and master), OS: Debian 6 > and Ubuntu 12.04. > > -- > You received this message because you are subscribed to the Google Groups > "Puppet Users" group. > To view this discussion on the web visit > https://groups.google.com/d/msg/puppet-users/-/G1lqkC0tAogJ. > To post to this group, send email to puppet-users@googlegroups.com. > To unsubscribe from this group, send email to > puppet-users+unsubscribe@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/puppet-users?hl=en.-- Matthaus Owens Release Manager, Puppet Labs -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Anton Markelov
2012-Oct-12 22:25 UTC
Re: [Puppet Users] Why second apt key receives again and again and again?
Oh. Thanks a lot, it helps for me. -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/nc9t2BjNErIJ. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.