On Tue, 7 May 2013 10:11:44 -0400 Bret Wortman <bret.wort...@damascusgrp.com> wrote:
> I've got a situation where a manifest fails when writing one > particular key for a user. What I have is a manifest that looks like > this: > > class my::accounts () { > > Ssh_authorized_key { > ensure => present, > type => ssh-dss, > } > > Then, after making sure the user, group, and authorized_keys2 file > exist: > > ssh_authorized_key { "key-name-1": > key => "omitted", > user => "user", > target => "/home/user/.ssh/authorized_keys2", > require => File["/home/user/.ssh/authorized_keys2"], > } > > There's a lengthy series of these -- most of them work, but one will > fail with this error: > > Error: Puppet::Util::FileType::FileTypeFlat could not write > /home/user/.ssh/authorized_keys2: Permission denied - > /home/user/.ssh/authorized_keys2 > Error: /Stage[main]/My::Accounts/Ssh_authorized_key[key-name-8]: > Could not evaluate: Puppet::Util::FileType::FileTypeFlat could nto > write /home/xmmgr/.ssh/authorized_keys2: Permission denied - > /home/user/.ssh/authorized_keys2 > > This is not the first nor the last key, and I get around 19 entries > in the file, so I'm not seeing why this one in particular is failing. > Structurally, it looks exactly like all the others. Any ideas? > > Thanks! > Do you also see notice messages about changing targets? If a ssh key is already present in targetA and you specifiy targetB in your manifest, puppet will try to migrate the key from targetA to targetB. As a result puppet has to rewrite both targetA (remove the key) and targetB (add the key) and there is a know bug where puppet tries to write the files with the wrong user context (hence the Permission denied messages). So if you see "target change" events, you'll probably hit http://projects.puppetlabs.com/issues/10850#note-12 -Stefan -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscr...@googlegroups.com. To post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users?hl=en. For more options, visit https://groups.google.com/groups/opt_out.