]> gitweb.fluxo.info Git - puppet-monkeysphere.git/commitdiff
Trying to make it work on ubuntu by using monkeysphere-check-key
authorSilvio Rhatto <rhatto@riseup.net>
Sat, 13 Nov 2010 17:37:13 +0000 (15:37 -0200)
committerSilvio Rhatto <rhatto@riseup.net>
Sat, 13 Nov 2010 17:37:13 +0000 (15:37 -0200)
manifests/init.pp

index de91cc8d503e91d7715a4bbfddc6199c9fd4c874..991a8dfabdebc8f54a575ad5f00c33aae082e291 100644 (file)
@@ -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"] ],
             }
           }
   }