forked from puppetlabs/puppetlabs-peadm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprovision.pp
95 lines (75 loc) · 3.34 KB
/
provision.pp
1
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
83
84
85
86
87
88
89
90
91
92
93
94
# @summary Single-entry-point plan for installation and configuration of a new
# Puppet Enterprise Extra Large cluster. This plan accepts all parameters
# used by its sub-plans, and invokes them in order.
#
plan peadm::provision (
# Standard
Peadm::SingleTargetSpec $master_host,
Optional[Peadm::SingleTargetSpec] $master_replica_host = undef,
# Large
Optional[TargetSpec] $compiler_hosts = undef,
# Extra Large
Optional[Peadm::SingleTargetSpec] $puppetdb_database_host = undef,
Optional[Peadm::SingleTargetSpec] $puppetdb_database_replica_host = undef,
# Common Configuration
String $console_password,
String $version = '2019.7.0',
Optional[Array[String]] $dns_alt_names = undef,
Optional[String] $compiler_pool_address = undef,
Optional[Hash] $pe_conf_data = { },
# Code Manager
Optional[String] $r10k_remote = undef,
Optional[String] $r10k_private_key_file = undef,
Optional[Peadm::Pem] $r10k_private_key_content = undef,
Optional[String] $deploy_environment = undef,
# License Key
Optional[String] $license_key_file = undef,
Optional[String] $license_key_content = undef,
# Other
Optional[String] $stagingdir = undef,
Enum[direct,bolthost] $download_mode = 'bolthost',
) {
peadm::validate_version($version)
$install_result = run_plan('peadm::action::install',
# Standard
master_host => $master_host,
master_replica_host => $master_replica_host,
# Large
compiler_hosts => $compiler_hosts,
# Extra Large
puppetdb_database_host => $puppetdb_database_host,
puppetdb_database_replica_host => $puppetdb_database_replica_host,
# Common Configuration
version => $version,
console_password => $console_password,
dns_alt_names => $dns_alt_names,
pe_conf_data => $pe_conf_data,
# Code Manager
r10k_remote => $r10k_remote,
r10k_private_key_file => $r10k_private_key_file,
r10k_private_key_content => $r10k_private_key_content,
# License Key
license_key_file => $license_key_file,
license_key_content => $license_key_content,
# Other
stagingdir => $stagingdir,
download_mode => $download_mode,
)
$configure_result = run_plan('peadm::action::configure',
# Standard
master_host => $master_host,
master_replica_host => $master_replica_host,
# Large
compiler_hosts => $compiler_hosts,
# Extra Large
puppetdb_database_host => $puppetdb_database_host,
puppetdb_database_replica_host => $puppetdb_database_replica_host,
# Common Configuration
compiler_pool_address => $compiler_pool_address,
deploy_environment => $deploy_environment,
# Other
stagingdir => $stagingdir,
)
# Return a string banner reporting on what was done
return([$install_result, $configure_result])
}