aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2010-11-13 15:37:13 -0200
committerSilvio Rhatto <rhatto@riseup.net>2010-11-13 15:37:13 -0200
commitcfe9ef09911bace2287c21a4fb2449139e40df64 (patch)
tree61b619ed9fcede0b893354252f699daa2aff4ff4
parent139b3d373e3f021caa6f4226ac880b01fffb4f58 (diff)
downloadpuppet-monkeysphere-cfe9ef09911bace2287c21a4fb2449139e40df64.tar.gz
puppet-monkeysphere-cfe9ef09911bace2287c21a4fb2449139e40df64.tar.bz2
Trying to make it work on ubuntu by using monkeysphere-check-key
-rw-r--r--manifests/init.pp20
1 files changed, 14 insertions, 6 deletions
diff --git a/manifests/init.pp b/manifests/init.pp
index de91cc8..991a8df 100644
--- a/manifests/init.pp
+++ b/manifests/init.pp
@@ -30,29 +30,37 @@ class monkeysphere {
$key = "ssh://${fqdn}${ssh_port}"
+ file { "/usr/local/sbin/monkeysphere-check-key":
+ ensure => present,
+ owner => root,
+ group => root,
+ mode => 0755,
+ content => "#!/bin/bash\n/usr/bin/gpg --homedir /var/lib/monkeysphere/host --list-keys '=$key' &> /dev/null || false",
+ }
+
# Server host key publication
case $monkeysphere_publish_key {
false: {
exec { "/usr/sbin/monkeysphere-host import-key /etc/ssh/ssh_host_rsa_key $key":
- unless => "/usr/bin/gpg --homedir /var/lib/monkeysphere/host --list-keys '=$key' &> /dev/null",
+ unless => "/usr/local/sbin/monkeysphere-check-key",
user => "root",
- require => Package["monkeysphere"],
+ require => [ Package["monkeysphere"], File["/usr/local/sbin/monkeysphere-check-key"] ],
}
}
'mail': {
exec { "/usr/sbin/monkeysphere-host import-key /etc/ssh/ssh_host_rsa_key $key && \
/usr/bin/mail -s 'monkeysphere host pgp key for $fqdn' root < /var/lib/monkeysphere/host_keys.pub.pgp":
- unless => "/usr/bin/gpg --homedir /var/lib/monkeysphere/host --list-keys '=$key' &> /dev/null",
+ unless => "/usr/local/sbin/monkeysphere-check-key",
user => "root",
- require => Package["monkeysphere"],
+ require => [ Package["monkeysphere"], File["/usr/local/sbin/monkeysphere-check-key"] ],
}
}
default: {
exec { "/usr/sbin/monkeysphere-host import-key /etc/ssh/ssh_host_rsa_key $key && \
/usr/sbin/monkeysphere-host publish-key":
- unless => "/usr/bin/gpg --homedir /var/lib/monkeysphere/host --list-keys '=$key' &> /dev/null",
+ unless => "/usr/local/sbin/monkeysphere-check-key",
user => "root",
- require => Package["monkeysphere"],
+ require => [ Package["monkeysphere"], File["/usr/local/sbin/monkeysphere-check-key"] ],
}
}
}