Skip to content

Commit c1e4c8f

Browse files
authored
Merge pull request #26 from puppetlabs/v4
V4
2 parents 36262a2 + cd315d1 commit c1e4c8f

File tree

9 files changed

+90
-157
lines changed

9 files changed

+90
-157
lines changed

documentation/basic_usage.md

+2-6
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ The reference implementation uses trusted facts to put nodes in the right groups
2828
5. Create a parameters file. Example included below. Note at the top of the file are arguments which dictate which plans should be run, such as install+configure.
2929
6. Run the pe\_xl plan with the inputs created. Example:
3030

31-
bolt plan run pe_xl \
31+
bolt plan run pe_xl::provision \
3232
--inventory nodes.yaml \
3333
--modulepath ~/modules \
3434
--params @params.json
@@ -59,10 +59,6 @@ Example params.json Bolt parameters file:
5959
6060
```json
6161
{
62-
"install": true,
63-
"configure": true,
64-
"upgrade": false,
65-
6662
"master_host": "pe-xl-core-0.lab1.puppet.vm",
6763
"puppetdb_database_host": "pe-xl-core-1.lab1.puppet.vm",
6864
"master_replica_host": "pe-xl-core-2.lab1.puppet.vm",
@@ -75,6 +71,6 @@ Example params.json Bolt parameters file:
7571
"console_password": "puppetlabs",
7672
"dns_alt_names": [ "puppet", "puppet.lab1.puppet.vm" ],
7773
"compiler_pool_address": "puppet.lab1.puppet.vm",
78-
"version": "2018.1.4"
74+
"version": "2019.1.1"
7975
}
8076
```

documentation/install_and_configure_without_ha.md

+2-6
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ The install, configure, and upgrade plans covered in the [basic_usage.md](basic_
1414
5. Create a parameters file. An example is included below. Note the omission of the `master_replica_host` and `puppetdb_database_replica_host` parameters.
1515
6. Run the pe\_xl plan with the inputs created. Example:
1616
```
17-
bolt plan run pe_xl \
17+
bolt plan run pe_xl::provision \
1818
--inventory nodes.yaml \
1919
--modulepath ~/modules \
2020
--params @params.json
@@ -45,10 +45,6 @@ groups:
4545
4646
```json
4747
{
48-
"install": true,
49-
"configure": true,
50-
"upgrade": false,
51-
5248
"master_host": "pe-xl-core-0.lab1.puppet.vm",
5349
"puppetdb_database_host": "pe-xl-core-1.lab1.puppet.vm",
5450
"compiler_hosts": [
@@ -59,6 +55,6 @@ groups:
5955
"console_password": "puppetlabs",
6056
"dns_alt_names": [ "puppet", "puppet.lab1.puppet.vm" ],
6157
"compiler_pool_address": "puppet.lab1.puppet.vm",
62-
"version": "2019.1.0"
58+
"version": "2019.1.1"
6359
}
6460
```

manifests/setup/master.pp

-25
This file was deleted.

metadata.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "puppetlabs-pe_xl",
3-
"version": "0.3.0",
3+
"version": "0.4.0",
44
"author": "Reid Vandewiele",
55
"summary": "Bolt plans used to deploy an at-scale Puppet Enterprise architecture",
66
"license": "Apache-2.0",
@@ -46,7 +46,7 @@
4646
"requirements": [
4747
{
4848
"name": "puppet",
49-
"version_requirement": ">= 6.0.0 < 7.0.0"
49+
"version_requirement": ">= 6.0.2 < 7.0.0"
5050
}
5151
],
5252
"pdk-version": "1.13.0",

plans/init.pp

-104
This file was deleted.

plans/provision.pp

+73
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
# @summary Single-entry-point plan for installation and configuration of a new
2+
# Puppet Enterprise Extra Large cluster. This plan accepts all parameters
3+
# used by its sub-plans, and invokes them in order.
4+
#
5+
plan pe_xl::provision (
6+
String[1] $master_host,
7+
Optional[String[1]] $puppetdb_database_host = undef,
8+
Optional[String[1]] $master_replica_host = undef,
9+
Optional[String[1]] $puppetdb_database_replica_host = undef,
10+
Optional[Array[String[1]]] $compiler_hosts = undef,
11+
12+
String[1] $version,
13+
String[1] $console_password,
14+
Optional[Array[String[1]]] $dns_alt_names = undef,
15+
Optional[String[1]] $compiler_pool_address = undef,
16+
Optional[Hash] $pe_conf_data = undef,
17+
18+
Optional[String] $r10k_remote = undef,
19+
Optional[String] $r10k_private_key_file = undef,
20+
Optional[Pe_xl::Pem] $r10k_private_key_content = undef,
21+
Optional[String[1]] $deploy_environment = undef,
22+
23+
Optional[String[1]] $stagingdir = undef,
24+
Optional[Boolean] $executing_on_master = undef,
25+
) {
26+
27+
run_plan('pe_xl::unit::install',
28+
# Large
29+
master_host => $master_host,
30+
compiler_hosts => $compiler_hosts,
31+
master_replica_host => $master_replica_host,
32+
33+
# Extra Large
34+
puppetdb_database_host => $puppetdb_database_host,
35+
puppetdb_database_replica_host => $puppetdb_database_replica_host,
36+
37+
# Common Configuration
38+
version => $version,
39+
console_password => $console_password,
40+
dns_alt_names => $dns_alt_names,
41+
pe_conf_data => $pe_conf_data,
42+
43+
# Code Manager
44+
r10k_remote => $r10k_remote,
45+
r10k_private_key_file => $r10k_private_key_file,
46+
r10k_private_key_content => $r10k_private_key_content,
47+
48+
# Other
49+
stagingdir => $stagingdir,
50+
)
51+
52+
run_plan('pe_xl::unit::configure',
53+
# Large
54+
master_host => $master_host,
55+
compiler_hosts => $compiler_hosts,
56+
master_replica_host => $master_replica_host,
57+
58+
# Extra Large
59+
puppetdb_database_host => $puppetdb_database_host,
60+
puppetdb_database_replica_host => $puppetdb_database_replica_host,
61+
62+
# Common Configuration
63+
compiler_pool_address => $compiler_pool_address,
64+
deploy_environment => $deploy_environment,
65+
66+
# Other
67+
stagingdir => $stagingdir,
68+
executing_on_master => $executing_on_master,
69+
)
70+
71+
# Return a string banner reporting on what was done
72+
return('Provisioned Puppet Enterprise Extra Large cluster')
73+
}

plans/configure.pp plans/unit/configure.pp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# @summary Configure first-time classification and HA setup
22
#
3-
plan pe_xl::configure (
3+
plan pe_xl::unit::configure (
44
String[1] $master_host,
55
Array[String[1]] $compiler_hosts = [ ],
66

plans/install.pp plans/unit/install.pp

+9-12
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
# Config data to plane into pe.conf when generated on all hosts, this can be
1414
# used for tuning data etc.
1515
#
16-
plan pe_xl::install (
16+
plan pe_xl::unit::install (
1717
# Large
1818
String[1] $master_host,
1919
Array[String[1]] $compiler_hosts = [ ],
@@ -316,18 +316,15 @@
316316
],
317317
)
318318

319-
# Do a Puppet agent run to ensure certificate requests have been submitted
320-
# These runs will "fail", and that's expected.
321-
without_default_logging() || {
322-
out::message("Starting: task pe_xl::puppet_runonce on ${agent_installer_hosts}")
323-
run_task('pe_xl::puppet_runonce', $agent_installer_hosts, {_catch_errors => true})
324-
out::message("Finished: task pe_xl::puppet_runonce on ${agent_installer_hosts}")
325-
}
319+
# Ensure certificate requests have been submitted
320+
run_command(@(HEREDOC), $agent_installer_hosts)
321+
/opt/puppetlabs/bin/puppet ssl submit_request
322+
| HEREDOC
326323

327-
# Ensure some basic configuration on the master needed at install time.
328-
if ($version.versioncmp('2019.0') < 0) {
329-
apply($master_host) { include pe_xl::setup::master }.pe_xl::print_apply_result
330-
}
324+
# TODO: come up with an intelligent way to validate that the expected CSRs
325+
# have been submitted and are available for signing, prior to signing them.
326+
# For now, waiting a short period of time is necessary to avoid a small race.
327+
ctrl::sleep(15)
331328

332329
run_command(inline_epp(@(HEREDOC)), $master_host)
333330
/opt/puppetlabs/bin/puppetserver ca sign --certname <%= $agent_installer_hosts.join(',') -%>

tasks/code_manager.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ function main()
7070
function deploy()
7171
{
7272
[ "$#" = 1 ] || { echo "specify an environment to deploy"; exit 1; }
73-
cm_r10k deploy environment "$1" && commit
73+
cm_r10k deploy environment "$1" -p && commit
7474
}
7575

7676
function commit()

0 commit comments

Comments
 (0)