Puppet Class: powershell

Defined in:
manifests/init.pp

Overview

Parameters:

  • source (Any) (defaults to: undef)


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
# File 'manifests/init.pp', line 3

class powershell (
        $source         = undef,
) {

        #Get OS version
        $kernel_ver = $::kernelmajversion
        $arch_type  = $::architecture


        #Determine version of PS to install - Valid for Windows 7 SP1 x86/x64, Server 2008/2008 R2
        if $kernel_ver =~  /^5\./ {

          $pack_type = 'exe'
          $ver = '2.0'
          $inst_opts = undef

          $exe_name = "WindowsServer2003-KB968930-${arch_type}-ENG.exe"
          $isnt_type = "2.0 for Server 2003 SP2 ${arch_type}"

        } else {

          $ver = '3.0'
          $pack_type = 'msi'
          $inst_opts = ['/quiet', '/norestart']
		  
          if $kernel_ver =~ /^6\.0/ {

              $exe_name = "Windows6.0-KB2506146-${arch_type}.msu"
              $isnt_type = "3 for Server 2008 SP2 ${arch_type}"

          } elsif $kernel_ver =~ /^6\.1/ {

            $exe_name = "Windows6.1-KB2506143-${arch_type}.msu"
            $inst_type = "3 for Windows 7 SP1 ${arch_type} and Server 2008 R2 SP1 ${arch_type}"

          } else {

           notify{"Operating system with kernel ${kernel_ver} not supported":}
           fail()

          }
        }

        notify{"Installtion configured for Powershell ${inst_type}": }

        powershell::installation { $exe_name:
          source        => $source,
          ver           => $ver,
          inst_opts     => $inst_opts,
          pack_type     => $pack_type,
        }

   }