Skip to content
This repository
  • 3 commits
  • 4 files changed
  • 0 comments
  • 1 contributor
Aug 06, 2012
R. Tyler Croy rtyler Add some descriptions ot the existing Rake tasks e0064b2
R. Tyler Croy rtyler Clean up the resource graph for the git-repositories module to make a…
…pache2 requirements explicit

In some cases, such as the placement of the VirtualHost configuration, we need
apache2 to be fully installed before we try to install the file, otherwise it
will fail because `/etc/apache` doesn't exist yet
f3b3ff6
R. Tyler Croy rtyler Start to manage Puppet and Facter through Puppet itself
Fixes #47
156c4aa
3  Rakefile
@@ -32,6 +32,7 @@ def each_manifest(&block)
32 32 end
33 33 end
34 34
  35 +desc "Run puppet-lint on all manifests"
35 36 task :lint do
36 37 puts "Linting manifests"
37 38 puts "-----------------"
@@ -42,6 +43,8 @@ task :lint do
42 43 puts "-----------------"
43 44 end
44 45
  46 +
  47 +desc "Validate the Puppet syntax of all manifests"
45 48 task :validate do
46 49 each_manifest do |filename|
47 50 sh "puppet parser validate '#{filename}'"
1  modules/base/manifests/init.pp
@@ -37,6 +37,7 @@
37 37 'packages::wget': ;
38 38 'packages::ruby': ;
39 39 'packages::hiera': ;
  40 + 'packages::puppet': ;
40 41
41 42 'ntp' :
42 43 ensure => running,
98 modules/git-repositories/manifests/init.pp
@@ -2,57 +2,59 @@
2 2 # Hosts read-only Git repositories and expose it via Apache
3 3 #
4 4 class git-repositories {
5   - include apache2
6   - include apache2::log-rotation
7   -
8   - $gitrepo_dir="/var/www/git.jenkins-ci.org"
9   -
10   - file {
11   - $gitrepo_dir :
12   - ensure => directory,
13   - owner => 'www-data',
14   - group => 'www-data'
15   - }
16   -
17   - git::repository {
18   - "all" :
19   - description => "Hi"
20   - }
21   -
22   - package {
23   - "gitweb" :
24   - ensure => installed
25   - }
26   -
27   - file {
28   - "/etc/gitweb.conf":
29   - source => 'puppet:///modules/git-repositories/gitweb.conf';
30   - }
31   -
32   - apache2::virtualhost {
33   - 'git.jenkins-ci.org' :
34   - source => 'puppet:///modules/git-repositories/git.jenkins-ci.org';
35   - }
  5 + include apache2
  6 + include apache2::log-rotation
  7 +
  8 + $gitrepo_dir="/var/www/git.jenkins-ci.org"
  9 +
  10 + file {
  11 + $gitrepo_dir :
  12 + ensure => directory,
  13 + owner => 'www-data',
  14 + group => 'www-data',
  15 + require => Class['apache2'];
  16 + }
  17 +
  18 + git::repository {
  19 + "all" :
  20 + description => "Hi";
  21 + }
  22 +
  23 + package {
  24 + "gitweb" :
  25 + ensure => installed;
  26 + }
  27 +
  28 + file {
  29 + "/etc/gitweb.conf":
  30 + source => 'puppet:///modules/git-repositories/gitweb.conf';
  31 + }
  32 +
  33 + apache2::virtualhost {
  34 + 'git.jenkins-ci.org' :
  35 + require => Class['apache2'],
  36 + source => 'puppet:///modules/git-repositories/git.jenkins-ci.org';
  37 + }
36 38 }
37 39
38 40 # create one Git repository
39 41 define git::repository($description) {
40   - $gitrepo_dir=$git-repositories::gitrepo_dir
41   -
42   - exec {
43   - "create repository ${name}" :
44   - require => File[$gitrepo_dir],
45   - unless => "test -d ${gitrepo_dir}/${name}.git",
46   - path => ['/bin', '/usr/bin'],
47   - user => 'www-data',
48   - command => "git init --bare ${gitrepo_dir}/${name}.git";
49   - }
50   -
51   - file {
52   - "${gitrepo_dir}/${name}.git/description":
53   - require => Exec["create repository ${name}"],
54   - content => $description
55   - }
  42 + $gitrepo_dir=$git-repositories::gitrepo_dir
  43 +
  44 + exec {
  45 + "create repository ${name}" :
  46 + require => File[$gitrepo_dir],
  47 + unless => "test -d ${gitrepo_dir}/${name}.git",
  48 + path => ['/bin', '/usr/bin'],
  49 + user => 'www-data',
  50 + command => "git init --bare ${gitrepo_dir}/${name}.git";
  51 + }
  52 +
  53 + file {
  54 + "${gitrepo_dir}/${name}.git/description":
  55 + require => Exec["create repository ${name}"],
  56 + content => $description;
  57 + }
56 58 }
57 59
58   -# vim: shiftwidth=4 expandtab tabstop=4
  60 +# vim: shiftwidth=2 expandtab tabstop=2
13 modules/packages/manifests/puppet.pp
... ... @@ -0,0 +1,13 @@
  1 +class packages::puppet {
  2 + package {
  3 + 'facter' :
  4 + ensure => '1.6.10',
  5 + provider => gem,
  6 + require => Class['packages::ruby'];
  7 +
  8 + 'puppet' :
  9 + ensure => '2.7.18',
  10 + provider => gem,
  11 + require => [Package['facter'], Class['packages::ruby']];
  12 + }
  13 +}

No commit comments for this range

Something went wrong with that request. Please try again.