init.pp 1.36 KB
Newer Older
mh's avatar
mh committed
1
2
3
4
# modules/bash/manifests/init.pp - manage bash stuff
# Copyright (C) 2007 admin@immerda.ch
#

mh's avatar
mh committed
5
#modules_dir { "bash": }
mh's avatar
mh committed
6
7

class bash {
mh's avatar
mh committed
8
9
10
11
12
13
    case $operatingsystem {
        openbsd: { include bash::openbsd }
        centos: { include bash::centos }
        default: { include bash::base }
    }
}
mh's avatar
mh committed
14

mh's avatar
mh committed
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
class bash::base {
    package{bash:
        ensure => present,
    }
}


class bash::centos inherits bash::base {
    package{'bash-completion':
        ensure => present,
    }

}

class bash::openbsd inherits bash::base {

	package{'libiconv':
	    ensure => 'present',
		source => 'ftp://mirror.switch.ch/pub/OpenBSD/4.2/packages/i386/libiconv-1.9.2p3.tgz'
	}

	package {'gettext':
	    ensure => 'present',
		source => 'ftp://mirror.switch.ch/pub/OpenBSD/4.2/packages/i386/gettext-0.14.6p0.tgz',
		require => Package[libiconv],
	}
    Package[bash]{
	    source => 'ftp://mirror.switch.ch/pub/OpenBSD/4.2/packages/i386/bash-3.2.17.tgz',
        require => Package[gettext],
    }
    bash::deploy_profile{bash_profile_root: source => 'openbsd' }
mh's avatar
mh committed
46
47
}

mh's avatar
mh committed
48
define bash::deploy_profile( 
mh's avatar
mh committed
49
50
51
52
53
54
	$source, 
	$destination = '/root/.bash_profile',
	$uid    = 'root',
        $gid    = '0' ){

        file {$name:
mh's avatar
mh committed
55
                path => $destination,
mh's avatar
mh committed
56
57
58
59
60
61
                owner => $uid,
                group => $gid,
                mode => 600,
                source => "puppet://$server/bash/${source}",
        }
}