]> git.donarmstrong.com Git - dsa-puppet.git/blob - modules/multipath/manifests/init.pp
luchesi -> ubc-bl4
[dsa-puppet.git] / modules / multipath / manifests / init.pp
1 # = Class: multipath
2 #
3 # Manage a multipath installation
4 #
5 # == Sample Usage:
6 #
7 #   include multipath
8 #
9 class multipath {
10         case $::hostname {
11                 bm-bl9: {
12                         $conffile = 'multipath-bm-os.conf'
13                 }
14                 bm-bl1,bm-bl2,bm-bl3,bm-bl4,bm-bl5,bm-bl6,bm-bl7,bm-bl8,bm-bl13,bm-bl14: {
15                         $conffile = 'multipath-bm.conf'
16                 }
17                 ubc-bl8,ubc-bl4,ubc-bl7,ubc-bl3,ubc-bl2,ubc-bl6: {
18                         $conffile = 'multipath-ubc-ganeti.conf'
19                 }
20                 default: {
21                         $conffile = ''
22                 }
23         }
24
25         if $conffile != '' {
26                 package { 'multipath-tools':
27                         ensure => installed,
28                 }
29                 exec { 'multipath reload':
30                         path        => '/usr/bin:/usr/sbin:/bin:/sbin',
31                         command     => 'service multipath-tools reload',
32                         refreshonly => true,
33                         require     =>  Package['multipath-tools'],
34                 }
35
36                 file { '/etc/multipath.conf':
37                         content  => template("multipath/${conffile}.erb"),
38                         notify  => Exec['multipath reload']
39                 }
40         }
41 }