Showing with 640 additions and 765 deletions.
  1. +4 −4 README.md
  2. +16 −6 documentation/basic_usage.md
  3. +4 −4 documentation/install_and_configure_without_ha.md
  4. +2 −2 documentation/large_deploy.md
  5. +1 −1 functions/fail_on_transport.pp
  6. +1 −1 functions/flatten_compact.pp
  7. +1 −1 functions/generate_pe_conf.pp
  8. +1 −1 functions/get_targets.pp
  9. +0 −20 functions/print_apply_result.pp
  10. +6 −3 functions/{target_host.pp → target_name.pp}
  11. +2 −2 functions/validate_architecture.pp
  12. +0 −4 installer/primary-master/csr_attributes.yaml
  13. +0 −64 installer/primary-master/pe.conf
  14. +0 −4 installer/puppetdb-database/csr_attributes.yaml
  15. +0 −21 installer/puppetdb-database/pe.conf
  16. +2 −2 lib/puppet/functions/{pe_xl → peadm}/file_content_upload.rb
  17. +8 −0 lib/puppet/functions/peadm/node_manager_yaml_location.rb
  18. +1 −1 manifests/compiler.pp
  19. +1 −1 manifests/load_balancer.pp
  20. +1 −1 manifests/puppetdb.pp
  21. +24 −21 manifests/setup/node_manager.pp
  22. +14 −12 metadata.json
  23. +159 −0 plans/action/configure.pp
  24. +92 −85 plans/{unit → action}/install.pp
  25. +2 −2 plans/misc/divert_code_manager.pp
  26. +8 −8 plans/provision.pp
  27. +0 −117 plans/unit/configure.pp
  28. +111 −116 plans/upgrade.pp
  29. +0 −29 plans/util/install_module.pp
  30. +4 −4 plans/util/retrieve_and_upload.pp
  31. +4 −0 tasks/agent_upgrade.sh
  32. +0 −29 tasks/configure_node_groups.json
  33. +0 −176 tasks/configure_node_groups.sh
  34. +2 −2 tasks/enable_replica.sh
  35. +10 −1 tasks/filesize.sh
  36. +0 −8 tasks/hostname.json
  37. +0 −6 tasks/hostname.sh
  38. +4 −0 tasks/pe_install.json
  39. +4 −0 tasks/pe_install.sh
  40. +8 −0 tasks/precheck.json
  41. +17 −0 tasks/precheck.sh
  42. +2 −2 tasks/provision_replica.sh
  43. +13 −0 tasks/read_file.json
  44. +9 −0 tasks/read_file.rb
  45. +8 −0 tasks/submit_csr.json
  46. +40 −0 tasks/submit_csr.rb
  47. +8 −0 tasks/trusted_facts.json
  48. +32 −0 tasks/trusted_facts.rb
  49. +8 −0 templates/node_manager.yaml.epp
  50. +1 −1 types/pem.pp
  51. +5 −3 types/singletargetspec.pp
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Puppet Enterprise Extra Large
# Puppet Enterprise (pe) Administration (adm) Module

This Puppet module contains Puppet Task Plans used to deploy an at-scale Puppet Enterprise architecture.
This Puppet module contains Puppet Task Plans used to deploy and manage at-scale Puppet Enterprise architecture.

Use this module to deploy Puppet Enterprise 2019.0.x Extra Large architecture.
Use this module to deploy Puppet Enterprise 2019.x Standard, Large, and Extra Large architecture.

* This deployment depends on and assumes the use of trusted facts. Specifically, `pp_role` and `pp_environment`.
* This deployment depends on and assumes the use of trusted facts. Specifically, `pp_application` and `pp_cluster`.
* This deployment assumes that at least for PE infrastructure nodes, Puppet certnames are correct, resolvable FQDNs.

## Documentation
Expand Down
22 changes: 16 additions & 6 deletions documentation/basic_usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,26 +9,26 @@ The current versions of those plans can be found at:
* [provision.pp](../plans/provision.pp)
* [upgrade.pp](../plans/upgrade.pp)

Provisioning can be broken down into two actions: [install](../plans/unit/install.pp), and [configure](../plans/unit/configure.pp). Installation currently requires ssh access to the un-provisioned nodes, but configure can be performed using the Orchestrator transport if installation has already been completed.
Provisioning can be broken down into two actions: [install](../plans/action/install.pp), and [configure](../plans/action/configure.pp). Installation currently requires ssh access to the un-provisioned nodes, but configure can be performed using the Orchestrator transport if installation has already been completed.

Besides getting Puppet Enterprise installed, the key configuration supporting Large and Extra Large architectures is laid out in four classification groups. Links are provided below to a Markdown document that describes the groups, and also to the Puppet manifest that actually configures them:

* [classification.md](classification.md)
* [pe\_xl::node\_manager class](../manifests/node_manager.pp)
* [peadm::node\_manager class](../manifests/node_manager.pp)

The reference implementation uses trusted facts to put nodes in the right groups. Because the important puppet\_enterprise::\* class parameters and data are specified in the console, it should also be safe to have a pe.conf present on both the master, and the master replica nodes.

## Basic usage instructions

1. Install Bolt on a jumphost. This can be the master, or any other system.
2. Download or git clone the pe\_xl module and put it somewhere on the jumphost. e.g. ~/modules/pe\_xl.
2. Download or git clone the peadm module and put it somewhere on the jumphost. e.g. ~/modules/peadm.
2. Download or git clone the module dependencies, and put them somewhere on the jumphost. e.g. ~/modules/stdlib, ~/modules/node\_manager, etc.
2. Ensure the hostname of each system is set correctly, to the same value that will be used to connect to the system, and refer to the system as. If the hostname is not set as expected the installation plan will refuse to continue.
4. Create an inventory file with connection information. Example included below. Available Bolt configuration options are documented here.
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:
6. Run the peadm::provision plan with the inputs created. Example:

bolt plan run pe_xl::provision \
bolt plan run peadm::provision \
--inventory nodes.yaml \
--modulepath ~/modules \
--params @params.json
Expand All @@ -38,7 +38,7 @@ Example nodes.yaml Bolt inventory file:
```yaml
---
groups:
- name: pe_xl_nodes
- name: pe_nodes
config:
transport: ssh
ssh:
Expand Down Expand Up @@ -74,3 +74,13 @@ Example params.json Bolt parameters file:
"version": "2019.1.1"
}
```

## Offline usage

The peadm::provision plan downloads installation content from an online repository by default. To perform an offline installation, you can prefetch the needed content and place it in the staging directory. If content is available in the staging directory, peadm::provision will not try to download it.

The default staging directory is `/tmp`. If a different staging dir is being used, it can be specified using the `stagingdir` parameter to the peadm::provision plan.

The content needed is the PE installation tarball for the target version. The installation content should be in the staging dir, and should have its original name. E.g. `/tmp/puppet-enterprise-2019.2.2-el-7-x86_64.tar.gz`.

Installation content can be downloaded from [https://puppet.com/try-puppet/puppet-enterprise/download/](https://puppet.com/try-puppet/puppet-enterprise/download/).
8 changes: 4 additions & 4 deletions documentation/install_and_configure_without_ha.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ The install, configure, and upgrade plans covered in the [basic_usage.md](basic_

1. Ensure the hostname of each system is set correctly, to the same value that will be used to connect to the system, and refer to the system as. If the hostname is not set as expected the installation plan will refuse to continue.
2. Install Bolt on a jumphost. This can be the master, or any other system.
3. Download or git clone the pe\_xl module and put it somewhere on the jumphost, e.g. ~/modules/pe\_xl.
3. Download or git clone the peadm module and put it somewhere on the jumphost, e.g. ~/modules/peadm.
4. Create an inventory file with connection information. An example is included below.
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:
6. Run the peadm plan with the inputs created. Example:
```
bolt plan run pe_xl::provision \
bolt plan run peadm::provision \
--inventory nodes.yaml \
--modulepath ~/modules \
--params @params.json
Expand All @@ -26,7 +26,7 @@ The install, configure, and upgrade plans covered in the [basic_usage.md](basic_

---
groups:
- name: pe_xl_nodes
- name: peadm_nodes
config:
transport: ssh
ssh:
Expand Down
4 changes: 2 additions & 2 deletions documentation/large_deploy.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ deploy a PE Large Architecture.

Ensuring that the parameters above are omitted from the `params.json` file,
the [basic usage instructions](basic_usage.md#basic-usage-instructions) can be
used to run the `pe_xl` plan in order to install and configure the deployment.
used to run the `peadm` plan in order to install and configure the deployment.

Example nodes.yaml Bolt inventory file:

```yaml
---
groups:
- name: pe_xl_nodes
- name: peadm_nodes
config:
transport: ssh
ssh:
Expand Down
2 changes: 1 addition & 1 deletion functions/fail_on_transport.pp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#
# Useful for excluding PCP when it's not appopriate
#
function pe_xl::fail_on_transport (
function peadm::fail_on_transport (
TargetSpec $nodes,
String $transport,
) {
Expand Down
2 changes: 1 addition & 1 deletion functions/flatten_compact.pp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
function pe_xl::flatten_compact (
function peadm::flatten_compact (
Array $input,
) {
$input.flatten.filter |$value| {
Expand Down
2 changes: 1 addition & 1 deletion functions/generate_pe_conf.pp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# undef will not be included in the config file. This is done to reduce the
# amount of logic required within plans if parameters are not passed in.
#
function pe_xl::generate_pe_conf (
function peadm::generate_pe_conf (
Hash $settings,
) {
# Check that console_admin_password is present
Expand Down
2 changes: 1 addition & 1 deletion functions/get_targets.pp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# This differs from get_target() in that:
# - It returns an Array[Target, 1, 0], rather than a Target
# - It will accept undef and return [ ].
function pe_xl::get_targets(
function peadm::get_targets(
Variant[TargetSpec, Undef] $spec,
Optional[Integer[1,1]] $count = undef,
) {
Expand Down
20 changes: 0 additions & 20 deletions functions/print_apply_result.pp

This file was deleted.

9 changes: 6 additions & 3 deletions functions/target_host.pp → functions/target_name.pp
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
function pe_xl::target_host(
function peadm::target_name(
Variant[Target, Array[Target,0,1]] $target,
) >> Variant[String, Undef] {
case $target {
Target: {
$target.host
$target.name
}
Array[Target,1,1]: {
$target[0].host
$target[0].name
}
Array[Target,0,0]: {
undef
}
default: {
fail('Unexpected input type to peadm::target_name function')
}
}
}
4 changes: 2 additions & 2 deletions functions/validate_architecture.pp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
function pe_xl::validate_architecture (
function peadm::validate_architecture (
TargetSpec $master_host,
Variant[TargetSpec, Undef] $master_replica_host = undef,
Variant[TargetSpec, Undef] $puppetdb_database_host = undef,
Expand All @@ -18,7 +18,7 @@ function pe_xl::validate_architecture (
}})
}
[true, true, false, false]: { # Standard or Large, HA
({ 'high-availability' => false, 'architecture' => $compiler_hosts ? {
({ 'high-availability' => true, 'architecture' => $compiler_hosts ? {
undef => 'standard',
default => 'large',
}})
Expand Down
4 changes: 0 additions & 4 deletions installer/primary-master/csr_attributes.yaml

This file was deleted.

64 changes: 0 additions & 64 deletions installer/primary-master/pe.conf

This file was deleted.

4 changes: 0 additions & 4 deletions installer/puppetdb-database/csr_attributes.yaml

This file was deleted.

21 changes: 0 additions & 21 deletions installer/puppetdb-database/pe.conf

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
require 'tempfile'

Puppet::Functions.create_function(:'pe_xl::file_content_upload') do
Puppet::Functions.create_function(:'peadm::file_content_upload') do
local_types do
type 'TargetOrTargets = Variant[String[1], Target, Array[TargetOrTargets]]'
end
Expand All @@ -12,7 +12,7 @@
end

def file_content_upload(content, destination, *targets)
file = Tempfile.new('pe_xl')
file = Tempfile.new('peadm')
file.write(content)
file.flush
result = call_function('upload_file', file.path, destination, *targets)
Expand Down
8 changes: 8 additions & 0 deletions lib/puppet/functions/peadm/node_manager_yaml_location.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Puppet::Functions.create_function(:'peadm::node_manager_yaml_location') do
dispatch :nm_yaml_location do
end

def nm_yaml_location
File.join(Puppet.settings['confdir'], 'node_manager.yaml')
end
end
2 changes: 1 addition & 1 deletion manifests/compiler.pp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# @summary Example class for PE compiler load balancing
#
class pe_xl::compiler {
class peadm::compiler {

@@haproxy::balancermember { "${::clientcert}_puppetserver_listener":
listening_service => 'puppetserver',
Expand Down
2 changes: 1 addition & 1 deletion manifests/load_balancer.pp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# @summary Example class for PE compiler load balancer
#
class pe_xl::load_balancer {
class peadm::load_balancer {

class { 'haproxy':
global_options => {
Expand Down
2 changes: 1 addition & 1 deletion manifests/puppetdb.pp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# @summary Example class for PE PuppetDB load balancing
#
class pe_xl::puppetdb {
class peadm::puppetdb {

# TODO: split load balancing into two pools, A and B
@@haproxy::balancermember { "${::clientcert}_puppetdb_listener":
Expand Down
Loading