Puppet Class: rhel_mrepo_profiles

Defined in:
manifests/init.pp

Overview

Install MRepo

Parameters:

  • mirror_root (Any) (defaults to: '/srv/mrepo')
  • source (Any) (defaults to: 'git')
  • port (Any) (defaults to: '80')
  • install_local_rpm (Any) (defaults to: false)


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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# File 'manifests/init.pp', line 2

class rhel_mrepo_profiles(
  $mirror_root   = '/srv/mrepo',
  $source        = 'git',
  $port          = '80',
  $install_local_rpm = false,
) {

  $staging_target = "${mirror_root}/iso"

  class { '::staging':
    path  => '/opt/staging',
    owner => 'root',
    group => 'root',
    mode  => '0755',
  }

  file { $staging_target:
    ensure => directory,
    owner  => apache,
    group  => apache,
    mode   => '0755',
  }

  class { '::mrepo::params':
    source     => $source, # No mrepo el7 package, easier to just clone, specify package on RHEL 6
    ensure_src => 'present', # latest commit as of 11/Apr/16
    src_root   => $mirror_root,
    www_root   => "${mirror_root}/www",
    user       => 'root',
    group      => 'root',
    port       => $port,
  }

  if $install_local_rpm {

    file { '/var/tmp/mrepo-0.8.8-0.pre1.rft.src.rpm':
      ensure => present,
      source => 'puppet:///modules/rhel_mrepo_profiles/mrepo-0.8.8-0.pre1.rft.src.rpm',
      owner  => '0',
      group  => '0',
      mode   => '0755',
    }

    package { 'mrepo':
      ensure => installed,
      source => '/var/tmp/mrepo-0.8.8-0.pre1.rft.src.rpm',
    }

  }


  include ::git
  include ::mrepo

  ensure_packages(['make', 'rsync'])

  Package['make'] -> Class['::git'] -> Class['::mrepo']

}