Puppet Class: powercli
Summary
Class that installs PowerCLI via PowerShell Gallery on a Windows host.
Requires PowerShell 5 (default on Windows 2016) or PowerShellCore 6.
Overview
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
|
# File 'manifests/init.pp', line 31
class powercli (
Optional[Powercli::Connection] $vcenter_connection = undef,
Optional[Hash] $config = $powercli::params::config,
) inherits powercli::params {
pspackageprovider { 'Nuget':
ensure => 'present',
}
psrepository { 'PSGallery':
ensure => present,
source_location => 'https://www.powershellgallery.com/api/v2',
installation_policy => 'trusted',
}
package { 'VMware.PowerCLI':
ensure => latest,
provider => 'windowspowershell',
source => 'PSGallery',
}
if $config != undef {
create_resources('powercli::config', $config)
}
if $vcenter_connection != undef {
class { 'powercli::vcenter::connection':
server => $vcenter_connection['server'],
username => $vcenter_connection['username'],
password => $vcenter_connection['password'],
}
contain powercli::vcenter::connection
}
}
|