Page MenuHomePhabricator

/etc/ssh/userkeys/ubuntu or /etc/ssh/userkeys/admin notices for every puppet run on labs instances
Closed, ResolvedPublic

Description

Puppet is throwing a ton of notices these days:

Notice: /Stage[main]/Role::Labs::Instance/Notify[instanceproject: puppet]/message: defined 'message' as 'instanceproject: puppet'
Notice: /Stage[main]/Ssh::Server/File[/etc/ssh/userkeys/ubuntu]: Not removing directory; use 'force' to override
Notice: /Stage[main]/Ssh::Server/File[/etc/ssh/userkeys/ubuntu]/ensure: removed
Notice: /Stage[main]/Ssh::Server/File[/etc/ssh/userkeys/ubuntu/.ssh]: Not removing directory; use 'force' to override
Notice: /Stage[main]/Ssh::Server/File[/etc/ssh/userkeys/ubuntu/.ssh]/ensure: removed
Notice: /Stage[main]/Ssh::Server/File[/etc/ssh/userkeys/ubuntu/.ssh/authorized_keys ]: Not removing directory; use 'force' to override
Notice: /Stage[main]/Ssh::Server/File[/etc/ssh/userkeys/ubuntu/.ssh/authorized_keys ]/ensure: removed
Notice: /Stage[main]/Ssh::Server/File[/etc/ssh/userkeys/ubuntu/.ssh/authorized_keys /public]: Not removing directory; use 'force' to override
Notice: /Stage[main]/Ssh::Server/File[/etc/ssh/userkeys/ubuntu/.ssh/authorized_keys /public]/ensure: removed
Notice: /Stage[main]/Ssh::Server/File[/etc/ssh/userkeys/ubuntu/.ssh/authorized_keys /public/keys]: Not removing directory; use 'force' to override
Notice: /Stage[main]/Ssh::Server/File[/etc/ssh/userkeys/ubuntu/.ssh/authorized_keys /public/keys]/ensure: removed
Notice: /Stage[main]/Ssh::Server/File[/etc/ssh/userkeys/ubuntu/.ssh/authorized_keys /public/keys/ubuntu]: Not removing directory; use 'force' to override
Notice: /Stage[main]/Ssh::Server/File[/etc/ssh/userkeys/ubuntu/.ssh/authorized_keys /public/keys/ubuntu]/ensure: removed
Notice: /Stage[main]/Ssh::Server/File[/etc/ssh/userkeys/ubuntu/.ssh/authorized_keys /public/keys/ubuntu/.ssh]: Not removing directory; use 'force' to override
Notice: /Stage[main]/Ssh::Server/File[/etc/ssh/userkeys/ubuntu/.ssh/authorized_keys /public/keys/ubuntu/.ssh]/ensure: removed

Fixing that is trivial, but I'm dumping this on Yuvi because he might have a fix in the works already.

Related / dupes:
T59752: fetch ssh authorized_keys via LDAP
{T81099}
T85814: stray files created in /etc/ssh/userkeys

Event Timeline

Andrew assigned this task to yuvipanda.
Andrew raised the priority of this task from to Medium.
Andrew updated the task description. (Show Details)
Andrew added a project: Cloud-Services.
Andrew subscribed.
Krinkle renamed this task from /etc/ssh/userkeys/ubuntu puppet notices on labs instances to /etc/ssh/userkeys/ubuntu notices for every puppet run on labs instances.Apr 2 2015, 9:22 PM
Krinkle set Security to None.
Krinkle subscribed.

These seem to be related to https://gerrit.wikimedia.org/r/#/c/183814/ & Co. where I thought that the issue was just transient for the migration from the old system to the new.

Note that then some of the affected directories had three links.

I'd rather not use force => true in puppet for this, if possible. This can be done massively with salt, no?

I still haven't figured out where these files came from, though; maybe they are included in the base image? If so, we'd need to update that as well.

I only noticed T85814 now; trying to draw a line that task's scope is about finding and removing the cause of the files' existence in freshly provisioned instances, this task's scope is about removing the files (once) in already existing instances (for which using salt probably makes sense).

I think these keys are in the base image and should be removed from there.

(and I don't have a fix atm)

I noticed the same thing in a freshly created jessie image today.

Notice: /Stage[main]/Puppetmaster::Ssl/File[/var/lib/puppet/server/ssl]/group: group changed 'puppet' to 'root'
Notice: /Stage[main]/Ssh::Server/File[/etc/ssh/userkeys/admin]: Not removing directory; use 'force' to override
Notice: /Stage[main]/Ssh::Server/File[/etc/ssh/userkeys/admin]/ensure: removed
Notice: /Stage[main]/Ssh::Server/File[/etc/ssh/userkeys/admin/.ssh]: Not removing directory; use 'force' to override
Notice: /Stage[main]/Ssh::Server/File[/etc/ssh/userkeys/admin/.ssh]/ensure: removed
Notice: /Stage[main]/Ssh::Server/File[/etc/ssh/userkeys/admin/.ssh/authorized_keys ]: Not removing directory; use 'force' to override
Notice: /Stage[main]/Ssh::Server/File[/etc/ssh/userkeys/admin/.ssh/authorized_keys ]/ensure: removed
Notice: /Stage[main]/Ssh::Server/File[/etc/ssh/userkeys/admin/.ssh/authorized_keys /public]: Not removing directory; use 'force' to override
Notice: /Stage[main]/Ssh::Server/File[/etc/ssh/userkeys/admin/.ssh/authorized_keys /public]/ensure: removed
Notice: /Stage[main]/Ssh::Server/File[/etc/ssh/userkeys/admin/.ssh/authorized_keys /public/keys]: Not removing directory; use 'force' to override
Notice: /Stage[main]/Ssh::Server/File[/etc/ssh/userkeys/admin/.ssh/authorized_keys /public/keys]/ensure: removed
Notice: /Stage[main]/Ssh::Server/File[/etc/ssh/userkeys/admin/.ssh/authorized_keys /public/keys/admin]: Not removing directory; use 'force' to override
Notice: /Stage[main]/Ssh::Server/File[/etc/ssh/userkeys/admin/.ssh/authorized_keys /public/keys/admin]/ensure: removed
Notice: /Stage[main]/Ssh::Server/File[/etc/ssh/userkeys/admin/.ssh/authorized_keys /public/keys/admin/.ssh]: Not removing directory; use 'force' to override
Notice: /Stage[main]/Ssh::Server/File[/etc/ssh/userkeys/admin/.ssh/authorized_keys /public/keys/admin/.ssh]/ensure: removed

A quick glance download, qemu convert and mount of the image showed no traces of that file in the image itself. A grep in /var/log/ shows

cloud-init.log:Apr 15 19:34:09 testakis [CLOUDINIT] util.py[DEBUG]: Writing to /etc/ssh/userkeys/admin/.ssh/authorized_keys /public/keys/admin/.ssh/authorized_keys - wb: [384] 0 bytes

could cloud init be the culrpit? I am not familiar with the software

akosiaris renamed this task from /etc/ssh/userkeys/ubuntu notices for every puppet run on labs instances to /etc/ssh/userkeys/ubuntu or /etc/ssh/userkeys/admin notices for every puppet run on labs instances.Apr 27 2015, 7:57 AM

Basically - live with it until we make new images, which will happen today (for T101916)

Have we found why these were included in the base image in the old image and in the first place?

I've verified that those files are not present in the base image before first boot. So I suspect that cloud-init is creating them -- I'll see about changing the config.

Change 217455 had a related patch set uploaded (by Andrew Bogott):
Override default cloud.cfg with a custom file.

https://gerrit.wikimedia.org/r/217455

Change 217455 merged by Andrew Bogott:
Override default cloud.cfg with a custom file.

https://gerrit.wikimedia.org/r/217455

Andrew claimed this task.