]> gitweb.fluxo.info Git - puppet-reprepro.git/commitdiff
Adding /usr/local/bin/reprepro-export-key
authorSilvio Rhatto <rhatto@riseup.net>
Sun, 9 May 2010 02:37:21 +0000 (23:37 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Sun, 9 May 2010 02:37:21 +0000 (23:37 -0300)
manifests/init.pp
templates/reprepro-export-key.sh.erb [new file with mode: 0644]

index 99f46aa4e468f8fe55e34255f72846c41d3f48c0..dd0d247c4ce6b5c3db3a225511dfbf3291dd2234 100644 (file)
@@ -90,6 +90,13 @@ class reprepro {
     "$basedir/.gnupg":
     mode => 750, owner => reprepro, group => root,
     ensure => directory;
+
+    "/usr/local/bin/reprepro-export-key":
+    ensure  => present,
+    content => template('reprepro/reprepro-export-key.sh.erb'),
+    owner   => root,
+    group   => root,
+    mode    => 755,
   }
 
   exec {
@@ -103,11 +110,11 @@ class reprepro {
       user => reprepro,
       subscribe => File["$basedir/conf/distributions"],
       path => "/usr/bin:/bin";
-    "gpg --export -a `gpg --with-colon --list-secret-keys | cut -d : -f 5 | head -1` > $basedir/key.asc":
-      creates => "$basedir/key.asc",
-      user => reprepro,
+    "/usr/local/bin/reprepro-export-key":
+      creates   => "$basedir/key.asc",
+      user      => reprepro,
       subscribe => File["$basedir/.gnupg"],
-      path => "/usr/bin:/bin";
+      require   => File["/usr/local/bin/reprepro-export-key"],
   }
 
   cron { reprepro:
diff --git a/templates/reprepro-export-key.sh.erb b/templates/reprepro-export-key.sh.erb
new file mode 100644 (file)
index 0000000..f6584ae
--- /dev/null
@@ -0,0 +1,4 @@
+#!/bin/bash
+
+KEY="`gpg --with-colon --list-secret-keys | cut -d : -f 5 | head -1`"
+gpg --export -a $KEY > <%= basedir %>/key.asc