Skip to content

Rename module to puppetlabs-peadm #31

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 2 commits into from
Dec 12, 2019
Merged
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
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# 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 assumes that at least for PE infrastructure nodes, Puppet certnames are correct, resolvable FQDNs.
Expand Down
10 changes: 5 additions & 5 deletions documentation/basic_usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,21 @@ Provisioning can be broken down into two actions: [install](../plans/unit/instal
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
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.

5 changes: 4 additions & 1 deletion functions/target_host.pp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
function pe_xl::target_host(
function peadm::target_host(
Variant[Target, Array[Target,0,1]] $target,
) >> Variant[String, Undef] {
case $target {
Expand All @@ -11,5 +11,8 @@ function pe_xl::target_host(
Array[Target,0,0]: {
undef
}
default: {
fail('Unexpected input type to peadm::target_host function')
}
}
}
2 changes: 1 addition & 1 deletion 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 Down
2 changes: 1 addition & 1 deletion installer/primary-master/csr_attributes.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
---
extension_requests:
pp_role: "pe_xl::master"
pp_role: "peadm::master"
pp_environment: "pe_production"
2 changes: 1 addition & 1 deletion installer/puppetdb-database/csr_attributes.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
---
extension_requests:
pp_role: "pe_xl::puppetdb_database"
pp_role: "peadm::puppetdb_database"
pp_environment: "pe_production"
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
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Puppet::Functions.create_function(:'pe_xl::node_manager_yaml_location') do
Puppet::Functions.create_function(:'peadm::node_manager_yaml_location') do
dispatch :nm_yaml_location do
end

def nm_yaml_location()
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
20 changes: 10 additions & 10 deletions manifests/setup/node_manager.pp
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
# This class will be applied during master bootstrap using e.g.
#
# puppet apply \
# --exec 'class { "pe_xl::node_manager":
# --exec 'class { "peadm::node_manager":
# environments => ["production", "staging", "development"],
# }'
#
class pe_xl::setup::node_manager (
class peadm::setup::node_manager (
String[1] $master_host,
String[1] $puppetdb_database_host,
String[1] $compiler_pool_address,
Expand Down Expand Up @@ -43,7 +43,7 @@
# We modify this group's rule such that all PE infrastructure nodes will be
# members.
node_group { 'PE Infrastructure Agent':
rule => ['and', ['~', ['trusted', 'extensions', 'pp_role'], '^pe_xl::']],
rule => ['and', ['~', ['trusted', 'extensions', 'pp_role'], '^peadm::']],
}

# We modify this group to add, as data, the compiler_pool_address only.
Expand All @@ -52,7 +52,7 @@
node_group { 'PE Master':
parent => 'PE Infrastructure',
rule => ['or',
['and', ['=', ['trusted', 'extensions', 'pp_role'], 'pe_xl::compiler']],
['and', ['=', ['trusted', 'extensions', 'pp_role'], 'peadm::compiler']],
['=', 'name', $master_host],
],
data => {
Expand All @@ -71,7 +71,7 @@
parent => 'PE Infrastructure',
environment => 'production',
override_environment => false,
rule => ['and', ['=', ['trusted', 'extensions', 'pp_role'], 'pe_xl::puppetdb_database']],
rule => ['and', ['=', ['trusted', 'extensions', 'pp_role'], 'peadm::puppetdb_database']],
classes => {
'puppet_enterprise::profile::database' => { },
},
Expand All @@ -84,7 +84,7 @@
ensure => present,
parent => 'PE Infrastructure',
rule => ['and',
['=', ['trusted', 'extensions', 'pp_role'], 'pe_xl::master'],
['=', ['trusted', 'extensions', 'pp_role'], 'peadm::master'],
['=', ['trusted', 'extensions', 'pp_cluster'], 'A'],
],
data => {
Expand All @@ -103,7 +103,7 @@
ensure => 'present',
parent => 'PE Master',
rule => ['and',
['=', ['trusted', 'extensions', 'pp_role'], 'pe_xl::compiler'],
['=', ['trusted', 'extensions', 'pp_role'], 'peadm::compiler'],
['=', ['trusted', 'extensions', 'pp_cluster'], 'A'],
],
classes => {
Expand Down Expand Up @@ -131,14 +131,14 @@
classes => {
'puppet_enterprise::profile::primary_master_replica' => { }
},
variables => { 'pe_xl_replica' => true },
variables => { 'peadm_replica' => true },
}

node_group { 'PE Master B':
ensure => present,
parent => 'PE Infrastructure',
rule => ['and',
['=', ['trusted', 'extensions', 'pp_role'], 'pe_xl::master'],
['=', ['trusted', 'extensions', 'pp_role'], 'peadm::master'],
['=', ['trusted', 'extensions', 'pp_cluster'], 'B'],
],
data => {
Expand All @@ -155,7 +155,7 @@
ensure => 'present',
parent => 'PE Master',
rule => ['and',
['=', ['trusted', 'extensions', 'pp_role'], 'pe_xl::compiler'],
['=', ['trusted', 'extensions', 'pp_role'], 'peadm::compiler'],
['=', ['trusted', 'extensions', 'pp_cluster'], 'B'],
],
classes => {
Expand Down
8 changes: 4 additions & 4 deletions metadata.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"name": "puppetlabs-pe_xl",
"name": "puppetlabs-peadm",
"version": "0.4.0",
"author": "Reid Vandewiele",
"summary": "Bolt plans used to deploy an at-scale Puppet Enterprise architecture",
"license": "Apache-2.0",
"source": "https://github.com/puppetlabs/puppetlabs-pe_xl",
"project_page": "https://github.com/puppetlabs/puppetlabs-pe_xl",
"issues_url": "https://github.com/puppetlabs/puppetlabs-pe_xl/issues",
"source": "https://github.com/puppetlabs/puppetlabs-peadm",
"project_page": "https://github.com/puppetlabs/puppetlabs-peadm",
"issues_url": "https://github.com/puppetlabs/puppetlabs-peadm/issues",
"dependencies": [
{
"name": "puppetlabs/stdlib",
Expand Down
4 changes: 2 additions & 2 deletions plans/misc/divert_code_manager.pp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#
# This is a stop-gap at best. This should not be attempted without advisement.
#
plan pe_xl::misc::divert_code_manager (
plan peadm::misc::divert_code_manager (
$master_host,
) {

Expand All @@ -21,7 +21,7 @@
This will allow /etc/puppetlabs/code to be managed manually
| HEREDOC

run_task('pe_xl::divert_code_manager', $master_host)
run_task('peadm::divert_code_manager', $master_host)

notice(@(HEREDOC))
Remember to enforce this configuration in your Puppet code with a Collector Override. E.g.
Expand Down
16 changes: 8 additions & 8 deletions plans/provision.pp
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@
# Puppet Enterprise Extra Large cluster. This plan accepts all parameters
# used by its sub-plans, and invokes them in order.
#
plan pe_xl::provision (
plan peadm::provision (
# Standard
Pe_xl::SingleTargetSpec $master_host,
Optional[Pe_xl::SingleTargetSpec] $master_replica_host = undef,
Peadm::SingleTargetSpec $master_host,
Optional[Peadm::SingleTargetSpec] $master_replica_host = undef,

# Large
Optional[TargetSpec] $compiler_hosts = undef,

# Extra Large
Optional[Pe_xl::SingleTargetSpec] $puppetdb_database_host = undef,
Optional[Pe_xl::SingleTargetSpec] $puppetdb_database_replica_host = undef,
Optional[Peadm::SingleTargetSpec] $puppetdb_database_host = undef,
Optional[Peadm::SingleTargetSpec] $puppetdb_database_replica_host = undef,

# Common Configuration
String $console_password,
Expand All @@ -24,14 +24,14 @@
# Code Manager
Optional[String] $r10k_remote = undef,
Optional[String] $r10k_private_key_file = undef,
Optional[Pe_xl::Pem] $r10k_private_key_content = undef,
Optional[Peadm::Pem] $r10k_private_key_content = undef,
Optional[String] $deploy_environment = undef,

# Other
Optional[String] $stagingdir = undef,
) {

$install_result = run_plan('pe_xl::unit::install',
$install_result = run_plan('peadm::unit::install',
# Standard
master_host => $master_host,
master_replica_host => $master_replica_host,
Expand All @@ -58,7 +58,7 @@
stagingdir => $stagingdir,
)

$configure_result = run_plan('pe_xl::unit::configure',
$configure_result = run_plan('peadm::unit::configure',
# Standard
master_host => $master_host,
master_replica_host => $master_replica_host,
Expand Down
Loading