aboutsummaryrefslogtreecommitdiff
path: root/manifests/puppet_bootstrap.pp
blob: d0517f7470381bab64525ae32604db73748b5ae2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
class puppet_bootstrap {

  $templates_dir = "$puppet_bootstrap_tmpdir/templates"

  # puppet-bootstrap script
  file { "/usr/local/sbin/puppet-bootstrap":
    owner   => "root",
    group   => "root",
    mode    => 0755,
    ensure  => present,
    content => template("$templates_dir/bin/puppet-bootstrap"),
  }

  package { "lynx": ensure => installed }

  define puppet_modules($puppet_dir) {

    # directory to download modules
    file { "$puppet_dir/modules":
      ensure  => directory,
      owner   => "puppet",
      group   => "puppet",
      mode    => 0755,
    }

     # execute the bootstrap script to download puppet modules
    exec { "/usr/local/sbin/puppet-bootstrap add-submodules $puppet_dir":
      user    => root,
      require => [ File["/usr/local/sbin/puppet-bootstrap"], File["$puppet_dir/modules"] ],
      timeout => 600,
    }

  }

}