Skip to content

V4 #26

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Oct 28, 2019
Merged

V4 #26

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions documentation/basic_usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ The reference implementation uses trusted facts to put nodes in the right groups
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.
6. Run the pe\_xl plan with the inputs created. Example:

bolt plan run pe_xl \
bolt plan run pe_xl::provision \
--inventory nodes.yaml \
--modulepath ~/modules \
--params @params.json
Expand Down Expand Up @@ -59,10 +59,6 @@ Example params.json Bolt parameters file:

```json
{
"install": true,
"configure": true,
"upgrade": false,

"master_host": "pe-xl-core-0.lab1.puppet.vm",
"puppetdb_database_host": "pe-xl-core-1.lab1.puppet.vm",
"master_replica_host": "pe-xl-core-2.lab1.puppet.vm",
Expand All @@ -75,6 +71,6 @@ Example params.json Bolt parameters file:
"console_password": "puppetlabs",
"dns_alt_names": [ "puppet", "puppet.lab1.puppet.vm" ],
"compiler_pool_address": "puppet.lab1.puppet.vm",
"version": "2018.1.4"
"version": "2019.1.1"
}
```
8 changes: 2 additions & 6 deletions documentation/install_and_configure_without_ha.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ The install, configure, and upgrade plans covered in the [basic_usage.md](basic_
5. Create a parameters file. An example is included below. Note the omission of the `master_replica_host` and `puppetdb_database_replica_host` parameters.
6. Run the pe\_xl plan with the inputs created. Example:
```
bolt plan run pe_xl \
bolt plan run pe_xl::provision \
--inventory nodes.yaml \
--modulepath ~/modules \
--params @params.json
Expand Down Expand Up @@ -45,10 +45,6 @@ groups:

```json
{
"install": true,
"configure": true,
"upgrade": false,

"master_host": "pe-xl-core-0.lab1.puppet.vm",
"puppetdb_database_host": "pe-xl-core-1.lab1.puppet.vm",
"compiler_hosts": [
Expand All @@ -59,6 +55,6 @@ groups:
"console_password": "puppetlabs",
"dns_alt_names": [ "puppet", "puppet.lab1.puppet.vm" ],
"compiler_pool_address": "puppet.lab1.puppet.vm",
"version": "2019.1.0"
"version": "2019.1.1"
}
```
25 changes: 0 additions & 25 deletions manifests/setup/master.pp

This file was deleted.

4 changes: 2 additions & 2 deletions metadata.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "puppetlabs-pe_xl",
"version": "0.3.0",
"version": "0.4.0",
"author": "Reid Vandewiele",
"summary": "Bolt plans used to deploy an at-scale Puppet Enterprise architecture",
"license": "Apache-2.0",
Expand Down Expand Up @@ -46,7 +46,7 @@
"requirements": [
{
"name": "puppet",
"version_requirement": ">= 6.0.0 < 7.0.0"
"version_requirement": ">= 6.0.2 < 7.0.0"
}
],
"pdk-version": "1.13.0",
Expand Down
104 changes: 0 additions & 104 deletions plans/init.pp

This file was deleted.

73 changes: 73 additions & 0 deletions plans/provision.pp
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
# @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 pe_xl::provision (
String[1] $master_host,
Optional[String[1]] $puppetdb_database_host = undef,
Optional[String[1]] $master_replica_host = undef,
Optional[String[1]] $puppetdb_database_replica_host = undef,
Optional[Array[String[1]]] $compiler_hosts = undef,

String[1] $version,
String[1] $console_password,
Optional[Array[String[1]]] $dns_alt_names = undef,
Optional[String[1]] $compiler_pool_address = undef,
Optional[Hash] $pe_conf_data = undef,

Optional[String] $r10k_remote = undef,
Optional[String] $r10k_private_key_file = undef,
Optional[Pe_xl::Pem] $r10k_private_key_content = undef,
Optional[String[1]] $deploy_environment = undef,

Optional[String[1]] $stagingdir = undef,
Optional[Boolean] $executing_on_master = undef,
) {

run_plan('pe_xl::unit::install',
# Large
master_host => $master_host,
compiler_hosts => $compiler_hosts,
master_replica_host => $master_replica_host,

# 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,

# Other
stagingdir => $stagingdir,
)

run_plan('pe_xl::unit::configure',
# Large
master_host => $master_host,
compiler_hosts => $compiler_hosts,
master_replica_host => $master_replica_host,

# 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,
executing_on_master => $executing_on_master,
)

# Return a string banner reporting on what was done
return('Provisioned Puppet Enterprise Extra Large cluster')
}
2 changes: 1 addition & 1 deletion plans/configure.pp → plans/unit/configure.pp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# @summary Configure first-time classification and HA setup
#
plan pe_xl::configure (
plan pe_xl::unit::configure (
String[1] $master_host,
Array[String[1]] $compiler_hosts = [ ],

Expand Down
21 changes: 9 additions & 12 deletions plans/install.pp → plans/unit/install.pp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# Config data to plane into pe.conf when generated on all hosts, this can be
# used for tuning data etc.
#
plan pe_xl::install (
plan pe_xl::unit::install (
# Large
String[1] $master_host,
Array[String[1]] $compiler_hosts = [ ],
Expand Down Expand Up @@ -316,18 +316,15 @@
],
)

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

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

run_command(inline_epp(@(HEREDOC)), $master_host)
/opt/puppetlabs/bin/puppetserver ca sign --certname <%= $agent_installer_hosts.join(',') -%>
Expand Down
2 changes: 1 addition & 1 deletion tasks/code_manager.sh
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ function main()
function deploy()
{
[ "$#" = 1 ] || { echo "specify an environment to deploy"; exit 1; }
cm_r10k deploy environment "$1" && commit
cm_r10k deploy environment "$1" -p && commit
}

function commit()
Expand Down