Skip to content
This repository has been archived by the owner on Mar 8, 2018. It is now read-only.

Commit

Permalink
Relocate the usage of the gitrepo::repo resource onto the machines wh…
Browse files Browse the repository at this point in the history
…ere it's being used
  • Loading branch information
R. Tyler Croy committed Aug 7, 2012
1 parent af69bd0 commit 73b8a18
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 32 deletions.
7 changes: 6 additions & 1 deletion manifests/cabbage.pp
Expand Up @@ -6,7 +6,12 @@
include base

include confluence
include git-repositories
include gitrepo

gitrepo::repo {
'all' :
description => 'Hi';
}

firewall {
'100 accept inbound HTTP requests' :
Expand Down
7 changes: 6 additions & 1 deletion manifests/vagrant.pp
Expand Up @@ -9,7 +9,12 @@
## - add 'wiki2.jenkins-ci.org' to /etc/hosts as 127.0.0.1
# include confluence

include git-repositories
include gitrepo

gitrepo::repo {
'all' :
description => 'Hi';
}

firewall {
'100 accept inbound HTTP requests' :
Expand Down
33 changes: 3 additions & 30 deletions modules/gitrepo/manifests/init.pp
@@ -1,7 +1,7 @@
#
# Hosts read-only Git repositories and expose it via Apache
#
class git-repositories {
class gitrepo {
include apache2
include apache2::log-rotation

Expand All @@ -15,46 +15,19 @@
require => Class['apache2'];
}

git::repository {
"all" :
description => "Hi";
}

package {
"gitweb" :
ensure => installed;
}

file {
"/etc/gitweb.conf":
source => 'puppet:///modules/git-repositories/gitweb.conf';
source => 'puppet:///modules/gitrepo/gitweb.conf';
}

apache2::virtualhost {
'git.jenkins-ci.org' :
require => Class['apache2'],
source => 'puppet:///modules/git-repositories/git.jenkins-ci.org';
}
}

# create one Git repository
define git::repository($description) {
$gitrepo_dir=$git-repositories::gitrepo_dir

exec {
"create repository ${name}" :
require => File[$gitrepo_dir],
unless => "test -d ${gitrepo_dir}/${name}.git",
path => ['/bin', '/usr/bin'],
user => 'www-data',
command => "git init --bare ${gitrepo_dir}/${name}.git";
}

file {
"${gitrepo_dir}/${name}.git/description":
require => Exec["create repository ${name}"],
content => $description;
source => 'puppet:///modules/gitrepo/git.jenkins-ci.org';
}
}

# vim: shiftwidth=2 expandtab tabstop=2
22 changes: 22 additions & 0 deletions modules/gitrepo/manifests/repo.pp
@@ -0,0 +1,22 @@

# create one Git repository
define gitrepo::repo($description) {
$gitrepo_dir = $gitrepo::gitrepo_dir

exec {
"create repository ${name}" :
require => File[$gitrepo_dir],
unless => "test -d ${gitrepo_dir}/${name}.git",
path => ['/bin', '/usr/bin'],
user => 'www-data',
command => "git init --bare ${gitrepo_dir}/${name}.git";
}

file {
"${gitrepo_dir}/${name}.git/description":
require => Exec["create repository ${name}"],
content => $description;
}
}

# vim: shiftwidth=2 expandtab tabstop=2

0 comments on commit 73b8a18

Please sign in to comment.