Skip to content

Commit

Permalink
(SOLARCH-376) Updating master_host to primaary_host
Browse files Browse the repository at this point in the history
  • Loading branch information
davidsandilands committed May 19, 2021
1 parent ac7e5b4 commit 55ecc6d
Show file tree
Hide file tree
Showing 40 changed files with 82 additions and 82 deletions.
2 changes: 1 addition & 1 deletion documentation/convert.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Prepare to run the plan against all servers in the PE infrastructure, using a pa

```json
{
"master_host": "pe-xl-core-0.lab1.puppet.vm",
"primary_host": "pe-xl-core-0.lab1.puppet.vm",
"master_replica_host": "pe-xl-core-1.lab1.puppet.vm",
"compiler_hosts": [
"pe-xl-compiler-0.lab1.puppet.vm",
Expand Down
4 changes: 2 additions & 2 deletions documentation/provision.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ Example params.json Bolt parameters file (shown: Extra Large with HA):
```json
{
"master_host": "pe-xl-core-0.lab1.puppet.vm",
"primary_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",
"puppetdb_database_replica_host": "pe-xl-core-3.lab1.puppet.vm",
Expand Down Expand Up @@ -146,7 +146,7 @@ A parameters JSON file can then reference the target names, which will become th
```json
{
"master_host": "pe-xl-core-0.lab1.puppet.vm",
"primary_host": "pe-xl-core-0.lab1.puppet.vm",
"master_replica_host": "pe-xl-core-1.lab1.puppet.vm",

"console_password": "puppetlabs",
Expand Down
2 changes: 1 addition & 1 deletion documentation/upgrade.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ The following is an example parameters file for upgrading an Extra Large archite
```json
{
"version": "2019.2.2",
"master_host": "pe-master-09a40c-0.us-west1-a.c.reidmv-peadm.internal",
"primary_host": "pe-master-09a40c-0.us-west1-a.c.reidmv-peadm.internal",
"puppetdb_database_host": "pe-psql-09a40c-0.us-west1-a.c.reidmv-peadm.internal",
"master_replica_host": "pe-master-09a40c-1.us-west1-b.c.reidmv-peadm.internal",
"puppetdb_database_replica_host": "pe-psql-09a40c-1.us-west1-b.c.reidmv-peadm.internal",
Expand Down
2 changes: 1 addition & 1 deletion examples/provision/extra-large-ha.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"version": "2019.4.0",
"console_password": "puppetlabs",
"master_host": "pe-master-1830cd-0.us-west1-a.c.reidmv-peadm.internal",
"primary_host": "pe-master-1830cd-0.us-west1-a.c.reidmv-peadm.internal",
"master_replica_host": "pe-master-1830cd-1.us-west1-b.c.reidmv-peadm.internal",
"puppetdb_database_host": "pe-psql-1830cd-0.us-west1-a.c.reidmv-peadm.internal",
"puppetdb_database_replica_host": "pe-psql-1830cd-1.us-west1-b.c.reidmv-peadm.internal",
Expand Down
2 changes: 1 addition & 1 deletion examples/provision/extra-large.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"version": "2019.2.4",
"console_password": "puppetlabs",
"master_host": "pe-master-1830cd-0.us-west1-a.c.reidmv-peadm.internal",
"primary_host": "pe-master-1830cd-0.us-west1-a.c.reidmv-peadm.internal",

"puppetdb_database_host": "pe-psql-1830cd-0.us-west1-a.c.reidmv-peadm.internal",

Expand Down
2 changes: 1 addition & 1 deletion examples/provision/large-ha.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"version": "2019.4.0",
"console_password": "puppetlabs",
"master_host": "pe-master-1830cd-0.us-west1-a.c.reidmv-peadm.internal",
"primary_host": "pe-master-1830cd-0.us-west1-a.c.reidmv-peadm.internal",
"master_replica_host": "pe-master-1830cd-1.us-west1-b.c.reidmv-peadm.internal",


Expand Down
2 changes: 1 addition & 1 deletion examples/provision/large.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"version": "2019.4.0",
"console_password": "puppetlabs",
"master_host": "pe-master-1830cd-0.us-west1-a.c.reidmv-peadm.internal",
"primary_host": "pe-master-1830cd-0.us-west1-a.c.reidmv-peadm.internal",



Expand Down
2 changes: 1 addition & 1 deletion examples/provision/minimal.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "2019.4.0",
"console_password": "puppetlabs",
"master_host": "pe-master-1830cd-0.us-west1-a.c.reidmv-peadm.internal"
"primary_host": "pe-master-1830cd-0.us-west1-a.c.reidmv-peadm.internal"
}
2 changes: 1 addition & 1 deletion examples/provision/standard-ha.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"version": "2019.4.0",
"console_password": "puppetlabs",
"master_host": "pe-master-1830cd-0.us-west1-a.c.reidmv-peadm.internal",
"primary_host": "pe-master-1830cd-0.us-west1-a.c.reidmv-peadm.internal",
"master_replica_host": "pe-master-1830cd-1.us-west1-b.c.reidmv-peadm.internal",


Expand Down
2 changes: 1 addition & 1 deletion examples/provision/standard.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"version": "2019.4.0",
"console_password": "puppetlabs",
"master_host": "pe-master-1830cd-0.us-west1-a.c.reidmv-peadm.internal",
"primary_host": "pe-master-1830cd-0.us-west1-a.c.reidmv-peadm.internal",



Expand Down
4 changes: 2 additions & 2 deletions functions/validate_architecture.pp
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
function peadm::validate_architecture (
TargetSpec $master_host,
TargetSpec $primary_host,
Variant[TargetSpec, Undef] $master_replica_host = undef,
Variant[TargetSpec, Undef] $puppetdb_database_host = undef,
Variant[TargetSpec, Undef] $puppetdb_database_replica_host = undef,
Variant[TargetSpec, Undef] $compiler_hosts = undef,
) >> Hash {
$result = case [
!!($master_host),
!!($primary_host),
!!($master_replica_host),
!!($puppetdb_database_host),
!!($puppetdb_database_replica_host),
Expand Down
10 changes: 5 additions & 5 deletions manifests/setup/node_manager.pp
Original file line number Diff line number Diff line change
Expand Up @@ -23,22 +23,22 @@
#
class peadm::setup::node_manager (
# Standard
String[1] $master_host,
String[1] $primary_host,

# High Availability
Optional[String[1]] $master_replica_host = undef,

# Common
Optional[String[1]] $compiler_pool_address = undef,
Optional[String[1]] $internal_compiler_a_pool_address = $master_host,
Optional[String[1]] $internal_compiler_a_pool_address = $primary_host,
Optional[String[1]] $internal_compiler_b_pool_address = $master_replica_host,

# For the next two parameters, the default values are appropriate when
# deploying Standard or Large architectures. These values only need to be
# specified differently when deploying an Extra Large architecture.

# Specify when using Extra Large
String[1] $puppetdb_database_host = $master_host,
String[1] $puppetdb_database_host = $primary_host,

# Specify when using Extra Large AND High Availability
Optional[String[1]] $puppetdb_database_replica_host = $master_replica_host,
Expand Down Expand Up @@ -78,7 +78,7 @@
variables => { 'pe_master' => true },
rule => ['or',
['and', ['=', ['trusted', 'extensions', 'pp_auth_role'], 'pe_compiler']],
['=', 'name', $master_host],
['=', 'name', $primary_host],
],
}

Expand All @@ -87,7 +87,7 @@
node_group { 'PE Database':
rule => ['or',
['and', ['=', ['trusted', 'extensions', peadm::oid('peadm_role')], 'puppet/puppetdb-database']],
['=', 'name', $master_host],
['=', 'name', $primary_host],
]
}

Expand Down
4 changes: 2 additions & 2 deletions manifests/setup/node_manager_yaml.pp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
class peadm::setup::node_manager_yaml (
String $master_host,
String $primary_host
) {

# Necessary to give the sandboxed Puppet executor the configuration
Expand All @@ -9,7 +9,7 @@
mode => '0644',
path => Deferred('peadm::node_manager_yaml_location'),
content => epp('peadm/node_manager.yaml.epp', {
server => $master_host,
server => $primary_host,
}),
}

Expand Down
12 changes: 6 additions & 6 deletions plans/action/configure.pp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#
plan peadm::action::configure (
# Standard
Peadm::SingleTargetSpec $master_host,
Peadm::SingleTargetSpec $primary_host,
Optional[Peadm::SingleTargetSpec] $master_replica_host = undef,

# Large
Expand All @@ -25,7 +25,7 @@
Optional[Peadm::SingleTargetSpec] $puppetdb_database_replica_host = undef,

# Common Configuration
String $compiler_pool_address = $master_host,
String $compiler_pool_address = $primary_host,
Optional[String] $internal_compiler_a_pool_address = undef,
Optional[String] $internal_compiler_b_pool_address = undef,
Optional[String] $token_file = undef,
Expand All @@ -37,15 +37,15 @@
# TODO: get and validate PE version

# Convert inputs into targets.
$master_target = peadm::get_targets($master_host, 1)
$master_target = peadm::get_targets($primary_host, 1)
$master_replica_target = peadm::get_targets($master_replica_host, 1)
$puppetdb_database_replica_target = peadm::get_targets($puppetdb_database_replica_host, 1)
$compiler_targets = peadm::get_targets($compiler_hosts)
$puppetdb_database_target = peadm::get_targets($puppetdb_database_host, 1)

# Ensure input valid for a supported architecture
$arch = peadm::validate_architecture(
$master_host,
$primary_host,
$master_replica_host,
$puppetdb_database_host,
$puppetdb_database_replica_host,
Expand Down Expand Up @@ -74,11 +74,11 @@

apply($master_target) {
class { 'peadm::setup::node_manager_yaml':
master_host => $master_target.peadm::target_name(),
primary_host => $master_target.peadm::target_name(),
}

class { 'peadm::setup::node_manager':
master_host => $master_target.peadm::target_name(),
primary_host => $master_target.peadm::target_name(),
master_replica_host => $master_replica_target.peadm::target_name(),
puppetdb_database_host => $puppetdb_database_target.peadm::target_name(),
puppetdb_database_replica_host => $puppetdb_database_replica_target.peadm::target_name(),
Expand Down
6 changes: 3 additions & 3 deletions plans/action/install.pp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#
plan peadm::action::install (
# Standard
Peadm::SingleTargetSpec $master_host,
Peadm::SingleTargetSpec $primary_host,
Optional[Peadm::SingleTargetSpec] $master_replica_host = undef,

# Large
Expand Down Expand Up @@ -52,15 +52,15 @@
peadm::validate_version($version)

# Convert inputs into targets.
$master_target = peadm::get_targets($master_host, 1)
$master_target = peadm::get_targets($primary_host, 1)
$master_replica_target = peadm::get_targets($master_replica_host, 1)
$puppetdb_database_target = peadm::get_targets($puppetdb_database_host, 1)
$puppetdb_database_replica_target = peadm::get_targets($puppetdb_database_replica_host, 1)
$compiler_targets = peadm::get_targets($compiler_hosts)

# Ensure input valid for a supported architecture
$arch = peadm::validate_architecture(
$master_host,
$primary_host,
$master_replica_host,
$puppetdb_database_host,
$puppetdb_database_replica_host,
Expand Down
24 changes: 12 additions & 12 deletions plans/convert.pp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
plan peadm::convert (
# Standard
Peadm::SingleTargetSpec $master_host,
Peadm::SingleTargetSpec $primary_host,
Optional[Peadm::SingleTargetSpec] $master_replica_host = undef,

# Large
Expand All @@ -11,7 +11,7 @@
Optional[Peadm::SingleTargetSpec] $puppetdb_database_replica_host = undef,

# Common Configuration
String $compiler_pool_address = $master_host,
String $compiler_pool_address = $primary_host,
Optional[String] $internal_compiler_a_pool_address = undef,
Optional[String] $internal_compiler_b_pool_address = undef,
Array[String] $dns_alt_names = [ ],
Expand All @@ -31,7 +31,7 @@
# TODO: read and validate convertable PE version

# Convert inputs into targets.
$master_target = peadm::get_targets($master_host, 1)
$master_target = peadm::get_targets($primary_host, 1)
$master_replica_target = peadm::get_targets($master_replica_host, 1)
$puppetdb_database_replica_target = peadm::get_targets($puppetdb_database_replica_host, 1)
$compiler_targets = peadm::get_targets($compiler_hosts)
Expand All @@ -47,7 +47,7 @@

# Ensure input valid for a supported architecture
$arch = peadm::validate_architecture(
$master_host,
$primary_host,
$master_replica_host,
$puppetdb_database_host,
$puppetdb_database_replica_host,
Expand Down Expand Up @@ -130,7 +130,7 @@
}

run_plan('peadm::util::add_cert_extensions', $master_target,
master_host => $master_target,
primary_host => $master_target,
extensions => {
peadm::oid('peadm_role') => 'puppet/master',
peadm::oid('peadm_availability_group') => 'A',
Expand All @@ -148,7 +148,7 @@
}

run_plan('peadm::util::add_cert_extensions', $master_replica_target,
master_host => $master_target,
primary_host => $master_target,
extensions => {
peadm::oid('peadm_role') => 'puppet/master',
peadm::oid('peadm_availability_group') => 'B',
Expand All @@ -158,7 +158,7 @@

peadm::plan_step('convert-database') || {
run_plan('peadm::util::add_cert_extensions', $puppetdb_database_target,
master_host => $master_target,
primary_host => $master_target,
extensions => {
peadm::oid('peadm_role') => 'puppet/puppetdb-database',
peadm::oid('peadm_availability_group') => 'A',
Expand All @@ -168,7 +168,7 @@

peadm::plan_step('convert-database-replica') || {
run_plan('peadm::util::add_cert_extensions', $puppetdb_database_replica_target,
master_host => $master_target,
primary_host => $master_target,
extensions => {
peadm::oid('peadm_role') => 'puppet/puppetdb-database',
peadm::oid('peadm_availability_group') => 'B',
Expand All @@ -178,7 +178,7 @@

peadm::plan_step('convert-compilers-a') || {
run_plan('peadm::util::add_cert_extensions', $compiler_a_targets,
master_host => $master_target,
primary_host => $master_target,
extensions => {
peadm::oid('pp_auth_role') => 'pe_compiler',
peadm::oid('peadm_availability_group') => 'A',
Expand All @@ -188,7 +188,7 @@

peadm::plan_step('convert-compilers-b') || {
run_plan('peadm::util::add_cert_extensions', $compiler_b_targets,
master_host => $master_target,
primary_host => $master_target,
extensions => {
peadm::oid('pp_auth_role') => 'pe_compiler',
peadm::oid('peadm_availability_group') => 'B',
Expand All @@ -204,11 +204,11 @@
if (versioncmp($pe_version, '2019.7.0') >= 0) {
apply($master_target) {
class { 'peadm::setup::node_manager_yaml':
master_host => $master_target.peadm::target_name(),
primary_host => $master_target.peadm::target_name(),
}

class { 'peadm::setup::node_manager':
master_host => $master_target.peadm::target_name(),
primary_host => $master_target.peadm::target_name(),
master_replica_host => $master_replica_target.peadm::target_name(),
puppetdb_database_host => $puppetdb_database_target.peadm::target_name(),
puppetdb_database_replica_host => $puppetdb_database_replica_target.peadm::target_name(),
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 @@ -11,7 +11,7 @@
# This is a stop-gap at best. This should not be attempted without advisement.
#
plan peadm::misc::divert_code_manager (
$master_host,
$primary_host,
) {

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

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

notice(@(HEREDOC))
Remember to enforce this configuration in your Puppet code with a Collector Override. E.g.
Expand Down
6 changes: 3 additions & 3 deletions plans/provision.pp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#
plan peadm::provision (
# Standard
Peadm::SingleTargetSpec $master_host,
Peadm::SingleTargetSpec $primary_host,
Optional[Peadm::SingleTargetSpec] $master_replica_host = undef,

# Large
Expand Down Expand Up @@ -55,7 +55,7 @@

$install_result = run_plan('peadm::action::install',
# Standard
master_host => $master_host,
primary_host => $primary_host,
master_replica_host => $master_replica_host,

# Large
Expand Down Expand Up @@ -87,7 +87,7 @@

$configure_result = run_plan('peadm::action::configure',
# Standard
master_host => $master_host,
primary_host => $primary_host,
master_replica_host => $master_replica_host,

# Large
Expand Down
Loading

0 comments on commit 55ecc6d

Please sign in to comment.