Puppet Class: xd7deliverycontroller::install

Inherits:
xd7deliverycontroller
Defined in:
manifests/install.pp

Overview

Class installing Citrix XenDesktop Delivery Controller and SQLServer powershell module



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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
# File 'manifests/install.pp', line 2

class xd7deliverycontroller::install inherits xd7deliverycontroller {

  reboot { 'after_run':
    apply => immediately,
    when  => refreshed
  }

  #Implemented a GPO check to prevent an endless reboot loop when CredSSP is configured via a GPO
  if (!$facts['credsspservicegpo']) {
    dsc_xcredssp{ 'Server':
      dsc_ensure => 'Present',
      dsc_role   => 'Server',
      notify     => Reboot['after_run']
    }
  }
  else {
    notify { 'CredSSPServiceAlreadyConfigured':
    message => 'CredSSP already configured by GPO. Unauthorized to overide GPO configuration.
      Please check that CredSSP service is allowed on this Computer.'
    }
  }

  #Implemented a GPO check to prevent an endless reboot loop when CredSSP is configured via a GPO
  if (!$facts['credsspclientgpo']) {
    dsc_xcredssp{ 'Client':
      dsc_ensure            => 'Present',
      dsc_role              => 'Client',
      dsc_delegatecomputers => '*'
    }
  }
  else {
    notify { 'CredSSPClientAlreadyConfigured':
      message => 'CredSSP already configured by GPO. Unauthorized to overide GPO configuration.
        Please check that CredSSP client is allowed on this Computer.'
    }
  }

  #Ensure IIS is not installed on the system to avoid conflicts with Broker Service
  dsc_windowsfeature{'iis':
    dsc_ensure => 'Absent',
    dsc_name   => 'Web-Server',
  }

  #Install Delivery Controller
  dsc_xd7features { 'XD7DeliveryController':
    dsc_issingleinstance => 'Yes',
    dsc_role             => ['Studio', 'Controller'],
    dsc_sourcepath       => $xd7deliverycontroller::sourcepath,
    dsc_ensure           => 'present',
    require              => Dsc_windowsfeature['iis'],
    notify               => Reboot['after_run']
  }

  #Download and install SQLSERVER powershell module. Required for database high availability setup (always on citrix databases membership)
  if ($xd7deliverycontroller::sqlservermodulesource == 'internet') {
    exec { 'InstallNuGetProviderPSGallery':
      command  => 'Install-PackageProvider -Name NuGet -Confirm:$false -Force',
      onlyif   => 'if (Get-PackageProvider -ListAvailable -Name Nuget) { exit 1 }',
      provider => 'powershell'
    }

    ->exec { 'InstallSQLServerModulePSGallery':
      command  => 'Install-Module -Name SqlServer -RequiredVersion 21.0.17099 -Confirm:$false -Force',
      onlyif   => 'if (Get-Module -ListAvailable -Name SqlServer) { exit 1 }',
      provider => 'powershell'
    }
  }
  else {
    file{ 'C:\Program Files\WindowsPowerShell\Modules\sqlserver_powershell_module.zip':
      source             => $xd7deliverycontroller::sqlservermodulesourcepath,
      source_permissions => ignore,
    }

    #Unzip function provided by the reidmv-unzip
    ->unzip{'UnzipSqlserverModule':
      source      => 'C:\Program Files\WindowsPowerShell\Modules\sqlserver_powershell_module.zip',
      destination => 'C:\Program Files\WindowsPowerShell\Modules',
      creates     => 'C:\Program Files\WindowsPowerShell\Modules\SqlServer'
    }
  }
}