summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2014-01-27 17:37:04 -0200
committerSilvio Rhatto <rhatto@riseup.net>2014-01-27 17:37:04 -0200
commite4d0b463f365515ae07c6189764efb9f0aa70c4f (patch)
tree0d51f6c8a44248c6a580a5134beb75f9fd8e8049
parent6b8a9958ea8927a6afcdc360cc6f7d7411e5f490 (diff)
downloadpuppet-hydra-e4d0b463f365515ae07c6189764efb9f0aa70c4f.tar.gz
puppet-hydra-e4d0b463f365515ae07c6189764efb9f0aa70c4f.tar.bz2
Using vcsrepo
-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