Bug #2004

ssh_authorized_key fails if no target is defined

Added by Peter Meier almost 3 years ago. Updated almost 2 years ago.

Status:Closed Start date:02/21/2009
Priority:Normal Due date:
Assignee:Francois Deppierraz % Done:

100%

Category:ssh
Target version:0.24.8
Affected Puppet version:0.24.7 Branch:
Keywords:ssh_authorized_key, target
Votes: 0

Description

Latest version from 0.24.x fails with the following error if no target is defined:

#puppet --trace --debug foo.pp
debug: Creating default schedules
debug: Prefetching parsed resources for ssh_authorized_key
debug: //Ssh_authorized_key[xy@foobar_root]: Changing ensure
debug: //Ssh_authorized_key[xy@foobar_root]: 1 change(s)
notice: //Ssh_authorized_key[xy@foobar_root]/ensure: created
debug: Flushing ssh_authorized_key provider target 
/usr/lib/ruby/1.8/fileutils.rb:1262:in `initialize'
/usr/lib/ruby/1.8/fileutils.rb:1262:in `open'
/usr/lib/ruby/1.8/fileutils.rb:1262:in `copy_file'
/usr/lib/ruby/1.8/fileutils.rb:1261:in `open'
/usr/lib/ruby/1.8/fileutils.rb:1261:in `copy_file'
/usr/lib/ruby/1.8/fileutils.rb:463:in `copy_file'
/usr/lib/ruby/1.8/fileutils.rb:383:in `cp'
/usr/lib/ruby/1.8/fileutils.rb:1395:in `fu_each_src_dest'
/usr/lib/ruby/1.8/fileutils.rb:1411:in `fu_each_src_dest0'
/usr/lib/ruby/1.8/fileutils.rb:1393:in `fu_each_src_dest'
/usr/lib/ruby/1.8/fileutils.rb:382:in `cp'
/usr/lib/ruby/site_ruby/1.8/puppet/util/filetype.rb:114:in `write'
/usr/lib/ruby/site_ruby/1.8/puppet/util/filetype.rb:55:in `real_write'
/usr/lib/ruby/site_ruby/1.8/puppet/util/filetype.rb:55:in `write'
/usr/lib/ruby/site_ruby/1.8/puppet/provider/parsedfile.rb:102:in `flush_target'
/usr/lib/ruby/site_ruby/1.8/puppet/provider/parsedfile.rb:74:in `flush'
/usr/lib/ruby/site_ruby/1.8/puppet/provider/parsedfile.rb:72:in `each'
/usr/lib/ruby/site_ruby/1.8/puppet/provider/parsedfile.rb:72:in `flush'
/usr/lib/ruby/site_ruby/1.8/puppet/provider/parsedfile.rb:356:in `flush'
/usr/lib/ruby/site_ruby/1.8/puppet/provider/ssh_authorized_key/parsed.rb:66:in `flush'
/usr/lib/ruby/site_ruby/1.8/puppet/type.rb:855:in `flush'
/usr/lib/ruby/site_ruby/1.8/puppet/transaction.rb:92:in `apply'
/usr/lib/ruby/site_ruby/1.8/puppet/transaction.rb:239:in `eval_resource'
/usr/lib/ruby/site_ruby/1.8/puppet/util.rb:425:in `thinmark'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/core_ext/benchmark.rb:8:in `realtime'
/usr/lib/ruby/site_ruby/1.8/puppet/util.rb:424:in `thinmark'
/usr/lib/ruby/site_ruby/1.8/puppet/transaction.rb:238:in `eval_resource'
/usr/lib/ruby/site_ruby/1.8/puppet/transaction.rb:310:in `evaluate'
/usr/lib/ruby/site_ruby/1.8/puppet/util.rb:425:in `thinmark'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/core_ext/benchmark.rb:8:in `realtime'
/usr/lib/ruby/site_ruby/1.8/puppet/util.rb:424:in `thinmark'
/usr/lib/ruby/site_ruby/1.8/puppet/transaction.rb:309:in `evaluate'
/usr/lib/ruby/site_ruby/1.8/puppet/transaction.rb:303:in `collect'
/usr/lib/ruby/site_ruby/1.8/puppet/transaction.rb:303:in `evaluate'
/usr/lib/ruby/site_ruby/1.8/puppet/node/catalog.rb:124:in `apply'
/usr/bin/puppet:233
err: Could not apply complete catalog: Puppet::Util::FileType::FileTypeFlat could not write : No such file or directory 

Content of foo.pp

ssh_authorized_key{'xy@foobar_root':
    type => 'ssh-rsa',
    user => 'root',
    key => 'AAAAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX='
}

if I additionally define a target it works like a charm.

History

Updated by James Turnbull almost 3 years ago

  • Status changed from Unreviewed to Accepted

Updated by Francois Deppierraz almost 3 years ago

It seems that the prefetch() method in the provider is no longer called. It’s perhaps time to move (again) the path expansion back to the type.

Updated by Bart Cortooms almost 3 years ago

We’ve been testing 0.24.8rc1 (upgrading from 0.24.5), and the only regression we’ve run into so far is this issue. I’m not sure how feasible it is, but should this be targeted for 0.24.8?

Updated by Francois Deppierraz almost 3 years ago

  • Status changed from Accepted to In Topic Branch Pending Review
  • Target version set to 0.24.8
  • % Done changed from 0 to 100

The fix is available on http://github.com/ctrlaltdel/puppet/commits/ticket/0.24.8rc1/2004

Updated by James Turnbull almost 3 years ago

  • Category set to ssh
  • Status changed from In Topic Branch Pending Review to Closed

Pushed in commit:9eb377aab786296d2b9c5c4807026bf8e5f89f55 in branch 0.24.x

Also available in: Atom PDF