]> gitweb.fluxo.info Git - puppet-hydra.git/commitdiff
Using vcsrepo
authorSilvio Rhatto <rhatto@riseup.net>
Mon, 27 Jan 2014 19:37:04 +0000 (17:37 -0200)
committerSilvio Rhatto <rhatto@riseup.net>
Mon, 27 Jan 2014 19:37:04 +0000 (17:37 -0200)
manifests/init.pp

index 471aa65a1db973cbae923852158af76a6e71dd91..d719af362352d5b83dfca161cb7f9fd55324036e 100644 (file)
@@ -1,34 +1,19 @@
-class hydra {
-  $hydra_dir = "/usr/local/hydra"
-
-  # the needed packages
-  package { "git-core": ensure => installed, }
-
-  exec { "clone hydra":
-    command => "if [ ! -d $hydra_dir ]; then git clone git://git.sarava.org/hydra.git $hydra_dir; fi",
-    creates => "$hydra_dir", 
-    path => ["/usr/bin", "/usr/sbin"],
-  }
-
-  file { "$hydra_dir":
-    owner   => "root",
-    group   => "root",
-    mode    => 0644,
-    require => Exec["clone hydra"],
+class hydra(
+  $folder = hiera('hydra::folder', '/usr/local/hydra')
+) {
+  vcsrepo { "$folder":
+    ensure   => present,
+    provider => git,
+    source   => 'git://git.sarava.org',
+    revision => '9d0a6147bdb356f47c4d89dd6c0e099cb2bbe88c',
+    owner    => 'root',
+    group    => 'root',
   }
 
-  file { "$hydra_dir/hydra":
-    owner   => "root",
-    group   => "root",
-    mode    => 0755,
-    require => File["$hydra_dir"],
-  }
-
-  file { ["/usr/local/sbin/hydra", "/usr/local/sbin/hydractl"]:
-    ensure => link,
-    target => "$hydra_dir/hydra",
-    require => File["$hydra_dir/hydra"],
+  file { [ "/usr/local/sbin/hydra", "/usr/local/sbin/hydractl",
+           "/usr/local/sbin/hydras" ]:
+    ensure  => link,
+    target  => "$folder/hydra",
+    require => Vcsrepo["$hydra_dir"],
   }
 }
-
-include hydra