Skip to content

Commit b3aaa75

Browse files
committed
Global rename of parameters
1 parent 2c7b3db commit b3aaa75

33 files changed

+206
-205
lines changed

documentation/convert.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Prepare to run the plan against all servers in the PE infrastructure, using a pa
99
```json
1010
{
1111
"primary_host": "pe-xl-core-0.lab1.puppet.vm",
12-
"primary_replica_host": "pe-xl-core-1.lab1.puppet.vm",
12+
"replica_host": "pe-xl-core-1.lab1.puppet.vm",
1313
"compiler_hosts": [
1414
"pe-xl-compiler-0.lab1.puppet.vm",
1515
"pe-xl-compiler-1.lab1.puppet.vm"

documentation/provision.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,9 @@ Example params.json Bolt parameters file (shown: Extra Large with DR):
8888
```json
8989
{
9090
"primary_host": "pe-xl-core-0.lab1.puppet.vm",
91-
"puppetdb_database_host": "pe-xl-core-1.lab1.puppet.vm",
92-
"primary_replica_host": "pe-xl-core-2.lab1.puppet.vm",
93-
"puppetdb_database_replica_host": "pe-xl-core-3.lab1.puppet.vm",
91+
"primary_postgresql_host": "pe-xl-core-1.lab1.puppet.vm",
92+
"replica_host": "pe-xl-core-2.lab1.puppet.vm",
93+
"replica_postgresql_host": "pe-xl-core-3.lab1.puppet.vm",
9494
"compiler_hosts": [
9595
"pe-xl-compiler-0.lab1.puppet.vm",
9696
"pe-xl-compiler-1.lab1.puppet.vm"
@@ -147,7 +147,7 @@ A parameters JSON file can then reference the target names, which will become th
147147
```json
148148
{
149149
"primary_host": "pe-xl-core-0.lab1.puppet.vm",
150-
"primary_replica_host": "pe-xl-core-1.lab1.puppet.vm",
150+
"replica_host": "pe-xl-core-1.lab1.puppet.vm",
151151

152152
"console_password": "puppetlabs",
153153
"dns_alt_names": [ "puppet", "puppet.lab1.puppet.vm" ],

documentation/upgrade.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ The following is an example parameters file for upgrading an Extra Large archite
1212
{
1313
"version": "2019.2.2",
1414
"primary_host": "pe-master-09a40c-0.us-west1-a.c.reidmv-peadm.internal",
15-
"puppetdb_database_host": "pe-psql-09a40c-0.us-west1-a.c.reidmv-peadm.internal",
16-
"primary_replica_host": "pe-master-09a40c-1.us-west1-b.c.reidmv-peadm.internal",
17-
"puppetdb_database_replica_host": "pe-psql-09a40c-1.us-west1-b.c.reidmv-peadm.internal",
15+
"primary_postgresql_host": "pe-psql-09a40c-0.us-west1-a.c.reidmv-peadm.internal",
16+
"replica_host": "pe-master-09a40c-1.us-west1-b.c.reidmv-peadm.internal",
17+
"replica_postgresql_host": "pe-psql-09a40c-1.us-west1-b.c.reidmv-peadm.internal",
1818
"compiler_hosts": [
1919
"pe-compiler-09a40c-0.us-west1-a.c.reidmv-peadm.internal",
2020
"pe-compiler-09a40c-1.us-west1-b.c.reidmv-peadm.internal",

examples/provision/extra-large-ha.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
"version": "2019.4.0",
33
"console_password": "puppetlabs",
44
"primary_host": "pe-master-1830cd-0.us-west1-a.c.reidmv-peadm.internal",
5-
"primary_replica_host": "pe-master-1830cd-1.us-west1-b.c.reidmv-peadm.internal",
6-
"puppetdb_database_host": "pe-psql-1830cd-0.us-west1-a.c.reidmv-peadm.internal",
7-
"puppetdb_database_replica_host": "pe-psql-1830cd-1.us-west1-b.c.reidmv-peadm.internal",
5+
"replica_host": "pe-master-1830cd-1.us-west1-b.c.reidmv-peadm.internal",
6+
"primary_postgresql_host": "pe-psql-1830cd-0.us-west1-a.c.reidmv-peadm.internal",
7+
"replica_postgresql_host": "pe-psql-1830cd-1.us-west1-b.c.reidmv-peadm.internal",
88
"compiler_pool_address": "puppet.pe-compiler-lb-1830cd.il4.us-west1.lb.reidmv-peadm.internal",
99
"compiler_hosts": [
1010
"pe-compiler-1830cd-0.us-west1-a.c.reidmv-peadm.internal",

examples/provision/extra-large.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"console_password": "puppetlabs",
44
"primary_host": "pe-master-1830cd-0.us-west1-a.c.reidmv-peadm.internal",
55

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

88
"compiler_pool_address": "puppet.pe-compiler-lb-1830cd.il4.us-west1.lb.reidmv-peadm.internal",
99
"compiler_hosts": [

examples/provision/large-ha.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"version": "2019.4.0",
33
"console_password": "puppetlabs",
44
"primary_host": "pe-master-1830cd-0.us-west1-a.c.reidmv-peadm.internal",
5-
"primary_replica_host": "pe-master-1830cd-1.us-west1-b.c.reidmv-peadm.internal",
5+
"replica_host": "pe-master-1830cd-1.us-west1-b.c.reidmv-peadm.internal",
66

77

88
"compiler_pool_address": "puppet.pe-compiler-lb-1830cd.il4.us-west1.lb.reidmv-peadm.internal",

examples/provision/standard-ha.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"version": "2019.4.0",
33
"console_password": "puppetlabs",
44
"primary_host": "pe-master-1830cd-0.us-west1-a.c.reidmv-peadm.internal",
5-
"primary_replica_host": "pe-master-1830cd-1.us-west1-b.c.reidmv-peadm.internal",
5+
"replica_host": "pe-master-1830cd-1.us-west1-b.c.reidmv-peadm.internal",
66

77

88
"compiler_pool_address": "puppet.pe-compiler-lb-1830cd.il4.us-west1.lb.reidmv-peadm.internal",

functions/assert_supported_architecture.pp

+9-9
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
function peadm::assert_supported_architecture (
22
TargetSpec $primary_host,
3-
Variant[TargetSpec, Undef] $primary_replica_host = undef,
4-
Variant[TargetSpec, Undef] $puppetdb_database_host = undef,
5-
Variant[TargetSpec, Undef] $puppetdb_database_replica_host = undef,
3+
Variant[TargetSpec, Undef] $replica_host = undef,
4+
Variant[TargetSpec, Undef] $primary_postgresql_host = undef,
5+
Variant[TargetSpec, Undef] $replica_postgresql_host = undef,
66
Variant[TargetSpec, Undef] $compiler_hosts = undef,
77
) >> Hash {
88
$result = case [
99
!!($primary_host),
10-
!!($primary_replica_host),
11-
!!($puppetdb_database_host),
12-
!!($puppetdb_database_replica_host),
10+
!!($replica_host),
11+
!!($primary_postgresql_host),
12+
!!($replica_postgresql_host),
1313
] {
1414
[true, false, false, false]: { # Standard or Large, no DR
1515
({ 'disaster-recovery' => false, 'architecture' => $compiler_hosts ? {
@@ -33,13 +33,13 @@ function peadm::assert_supported_architecture (
3333
out::message(inline_epp(@(HEREDOC)))
3434
Invalid architecture! Recieved:
3535
- primary
36-
<% if $primary_replica_host { -%>
36+
<% if $replica_host { -%>
3737
- primary-replica
3838
<% } -%>
39-
<% if $puppetdb_database_host { -%>
39+
<% if $primary_postgresql_host { -%>
4040
- pdb-database
4141
<% } -%>
42-
<% if $puppetdb_database_replica_host { -%>
42+
<% if $replica_postgresql_host { -%>
4343
- pdb-database-replica
4444
<% } -%>
4545
<% if $compiler_hosts { -%>

manifests/setup/node_manager.pp

+11-11
Original file line numberDiff line numberDiff line change
@@ -26,22 +26,22 @@
2626
String[1] $primary_host,
2727

2828
# High Availability
29-
Optional[String[1]] $primary_replica_host = undef,
29+
Optional[String[1]] $replica_host = undef,
3030

3131
# Common
3232
Optional[String[1]] $compiler_pool_address = undef,
3333
Optional[String[1]] $internal_compiler_a_pool_address = $primary_host,
34-
Optional[String[1]] $internal_compiler_b_pool_address = $primary_replica_host,
34+
Optional[String[1]] $internal_compiler_b_pool_address = $replica_host,
3535

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

4040
# Specify when using Extra Large
41-
String[1] $puppetdb_database_host = $primary_host,
41+
String[1] $primary_postgresql_host = $primary_host,
4242

4343
# Specify when using Extra Large AND High Availability
44-
Optional[String[1]] $puppetdb_database_replica_host = $primary_replica_host,
44+
Optional[String[1]] $replica_postgresql_host = $replica_host,
4545
) {
4646

4747
# Preserve existing user data and classes values. We only need to make sure
@@ -105,10 +105,10 @@
105105
],
106106
data => {
107107
'puppet_enterprise::profile::primary_master_replica' => {
108-
'database_host_puppetdb' => $puppetdb_database_host,
108+
'database_host_puppetdb' => $primary_postgresql_host,
109109
},
110110
'puppet_enterprise::profile::puppetdb' => {
111-
'database_host' => $puppetdb_database_host,
111+
'database_host' => $primary_postgresql_host,
112112
},
113113
},
114114
}
@@ -124,7 +124,7 @@
124124
],
125125
classes => {
126126
'puppet_enterprise::profile::puppetdb' => {
127-
'database_host' => $puppetdb_database_host,
127+
'database_host' => $primary_postgresql_host,
128128
},
129129
'puppet_enterprise::profile::master' => {
130130
# lint:ignore:single_quote_string_with_variables
@@ -143,7 +143,7 @@
143143

144144
# Create the replica and B groups if a replica primary and database host are
145145
# supplied
146-
if $primary_replica_host {
146+
if $replica_host {
147147
# We need to ensure this group provides the peadm_replica variable.
148148
node_group { 'PE DR Replica':
149149
ensure => 'present',
@@ -163,10 +163,10 @@
163163
],
164164
data => {
165165
'puppet_enterprise::profile::primary_master_replica' => {
166-
'database_host_puppetdb' => $puppetdb_database_replica_host,
166+
'database_host_puppetdb' => $replica_postgresql_host,
167167
},
168168
'puppet_enterprise::profile::puppetdb' => {
169-
'database_host' => $puppetdb_database_replica_host,
169+
'database_host' => $replica_postgresql_host,
170170
},
171171
},
172172
}
@@ -180,7 +180,7 @@
180180
],
181181
classes => {
182182
'puppet_enterprise::profile::puppetdb' => {
183-
'database_host' => $puppetdb_database_replica_host,
183+
'database_host' => $replica_postgresql_host,
184184
},
185185
'puppet_enterprise::profile::master' => {
186186
# lint:ignore:single_quote_string_with_variables

plans/action/configure.pp

+22-22
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,14 @@
1515
plan peadm::action::configure (
1616
# Standard
1717
Peadm::SingleTargetSpec $primary_host,
18-
Optional[Peadm::SingleTargetSpec] $primary_replica_host = undef,
18+
Optional[Peadm::SingleTargetSpec] $replica_host = undef,
1919

2020
# Large
2121
Optional[TargetSpec] $compiler_hosts = undef,
2222

2323
# Extra Large
24-
Optional[Peadm::SingleTargetSpec] $puppetdb_database_host = undef,
25-
Optional[Peadm::SingleTargetSpec] $puppetdb_database_replica_host = undef,
24+
Optional[Peadm::SingleTargetSpec] $primary_postgresql_host = undef,
25+
Optional[Peadm::SingleTargetSpec] $replica_postgresql_host = undef,
2626

2727
# Common Configuration
2828
String $compiler_pool_address = $primary_host.peadm::certname(),
@@ -38,17 +38,17 @@
3838

3939
# Convert inputs into targets.
4040
$primary_target = peadm::get_targets($primary_host, 1)
41-
$primary_replica_target = peadm::get_targets($primary_replica_host, 1)
42-
$puppetdb_database_replica_target = peadm::get_targets($puppetdb_database_replica_host, 1)
41+
$replica_target = peadm::get_targets($replica_host, 1)
42+
$replica_postgresql_target = peadm::get_targets($replica_postgresql_host, 1)
4343
$compiler_targets = peadm::get_targets($compiler_hosts)
44-
$puppetdb_database_target = peadm::get_targets($puppetdb_database_host, 1)
44+
$primary_postgresql_target = peadm::get_targets($primary_postgresql_host, 1)
4545

4646
# Ensure input valid for a supported architecture
4747
$arch = peadm::assert_supported_architecture(
4848
$primary_host,
49-
$primary_replica_host,
50-
$puppetdb_database_host,
51-
$puppetdb_database_replica_host,
49+
$replica_host,
50+
$primary_postgresql_host,
51+
$replica_postgresql_host,
5252
$compiler_hosts,
5353
)
5454

@@ -60,7 +60,7 @@
6060
).first['content']
6161

6262
run_task('peadm::mkdir_p_file', peadm::flatten_compact([
63-
$primary_replica_target,
63+
$replica_target,
6464
$compiler_targets,
6565
]),
6666
path => '/etc/puppetlabs/puppet/hiera.yaml',
@@ -79,9 +79,9 @@
7979

8080
class { 'peadm::setup::node_manager':
8181
primary_host => $primary_target.peadm::certname(),
82-
primary_replica_host => $primary_replica_target.peadm::certname(),
83-
puppetdb_database_host => $puppetdb_database_target.peadm::certname(),
84-
puppetdb_database_replica_host => $puppetdb_database_replica_target.peadm::certname(),
82+
replica_host => $replica_target.peadm::certname(),
83+
primary_postgresql_host => $primary_postgresql_target.peadm::certname(),
84+
replica_postgresql_host => $replica_postgresql_target.peadm::certname(),
8585
compiler_pool_address => $compiler_pool_address,
8686
internal_compiler_a_pool_address => $internal_compiler_a_pool_address,
8787
internal_compiler_b_pool_address => $internal_compiler_b_pool_address,
@@ -92,23 +92,23 @@
9292
if $arch['disaster-recovery'] {
9393
# Run the PE Replica Provision
9494
run_task('peadm::provision_replica', $primary_target,
95-
primary_replica => $primary_replica_target.peadm::certname(),
96-
token_file => $token_file,
95+
replica => $replica_target.peadm::certname(),
96+
token_file => $token_file,
9797

9898
# Race condition, where the provision command checks PuppetDB status and
9999
# probably gets "starting", but fails out because that's not "running".
100100
# Can remove flag when that issue is fixed.
101-
legacy => true,
101+
legacy => true,
102102
)
103103
}
104104

105105
# Run Puppet everywhere to pick up last remaining config tweaks
106106
run_task('peadm::puppet_runonce', peadm::flatten_compact([
107107
$primary_target,
108-
$puppetdb_database_target,
108+
$primary_postgresql_target,
109109
$compiler_targets,
110-
$primary_replica_target,
111-
$puppetdb_database_replica_target,
110+
$replica_target,
111+
$replica_postgresql_target,
112112
]))
113113

114114
# Deploy an environment if a deploy environment is specified
@@ -121,9 +121,9 @@
121121
# Ensure Puppet agent service is running now that configuration is complete
122122
run_command('systemctl start puppet', peadm::flatten_compact([
123123
$primary_target,
124-
$primary_replica_target,
125-
$puppetdb_database_target,
126-
$puppetdb_database_replica_target,
124+
$replica_target,
125+
$primary_postgresql_target,
126+
$replica_postgresql_target,
127127
$compiler_targets,
128128
]))
129129

0 commit comments

Comments
 (0)