[Puppet Users] ssh_authorized_keys fails if a line is empty

2012-04-19 Thread Maurice Meeden
Hi group,

we want to manage our authorized_keys with puppet and are trying
ssh_authorized_keys. Everything works as expected, but if ~/.ssh/
authorized_keys contains en empty line, puppet raises an error and
generate a complete new file:

debug: Prefetching parsed resources for ssh_authorized_key
err: Could not prefetch ssh_authorized_key provider 'parsed': Could
not parse line  at /root/.ssh/authorized_keys:3

If the line contains a blank, it works. How can we change this
behaviour? We've looked into /usr/lib64/ruby/vendor_ruby/1.8/puppet/
provider/ssh_authorized_key/parsed.rb but I believe the match
statement is correct:

text_line :blank, :match = /^\s+/

It seems that puppet fails before any matching is done, but I'm not
familar with ruby and puppet development.

We are using puppet 2.6.12 on SLES11.

Thanks in advance and greetings, Maurice

-- 
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



Re: [Puppet Users] ssh_authorized_keys fails if a line is empty

2012-04-19 Thread Stefan Schulte
On Thu, Apr 19, 2012 at 07:20:10AM -0700, Maurice Meeden wrote:
 Hi group,
 
 we want to manage our authorized_keys with puppet and are trying
 ssh_authorized_keys. Everything works as expected, but if ~/.ssh/
 authorized_keys contains en empty line, puppet raises an error and
 generate a complete new file:
 
 debug: Prefetching parsed resources for ssh_authorized_key
 err: Could not prefetch ssh_authorized_key provider 'parsed': Could
 not parse line  at /root/.ssh/authorized_keys:3
 
 If the line contains a blank, it works. How can we change this
 behaviour? We've looked into /usr/lib64/ruby/vendor_ruby/1.8/puppet/
 provider/ssh_authorized_key/parsed.rb but I believe the match
 statement is correct:
 
 text_line :blank, :match = /^\s+/
 

The match means »one or more whitespace characters at the beginning of
a line«. So it would match »   aaa« or » « but not »«. It should read

text_line :blank, :match = /^\s*$/

which means »beginning of a line, followed by zero, one or more
whitespace characters, followed by the end of line.

Would you mind opening a ticket on redmine? This is clearly a bug
http://projects.puppetlabs.com/issues

-Stefan

-- 
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.