owner => buildd,
}
+ if ! $::buildd_key {
+ exec { 'create-buildd-key':
+ command => '/bin/su - buildd -c \'mkdir -p -m 02700 .ssh && ssh-keygen -C "`whoami`@`hostname` (`date +%Y-%m-%d`)" -P "" -f .ssh/id_rsa -q\'',
+ onlyif => '/usr/bin/getent passwd buildd > /dev/null && ! [ -e /home/buildd/.ssh/id_rsa ]'
+ }
+ }
+
}
end
-
Facter.add("weblogsync_key") do
setcode do
key = nil
end
end
+ Facter.add("buildd_key") do
+ setcode do
+ key = nil
+ keyfile = '/home/buildd/.ssh/id_rsa.pub'
+ if FileTest.exist?(keyfile)
+ key = File.open(keyfile).read.chomp
+ end
+ key
+ end
+ end
+
+
rescue Exception => e
end
# vim:set et: