From e4d0b463f365515ae07c6189764efb9f0aa70c4f Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Mon, 27 Jan 2014 17:37:04 -0200 Subject: Using vcsrepo --- manifests/init.pp | 45 +++++++++++++++------------------------------ 1 file 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 -- cgit v1.2.3