summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--manifests/init.pp45
1 files changed, 15 insertions, 30 deletions
diff --git a/manifests/init.pp b/manifests/init.pp
index 471aa65..d719af3 100644
--- a/manifests/init.pp
+++ b/manifests/init.pp
@@ -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