Skip to content

Commit d2332cc

Browse files
author
Thomas Linkin
authored
Merge pull request #121 from puppetlabs/compiler-pool-addresses
Add compiler_pool_{a,b}_address parameters
2 parents a95c84c + 7a76f06 commit d2332cc

File tree

5 files changed

+102
-28
lines changed

5 files changed

+102
-28
lines changed

CHANGELOG.md

+8
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,14 @@
55

66
Documentation and README update
77

8+
### Features
9+
10+
- Added parameters to configure compiler pool addresses for the A and B availability groups. These are used in large and extra large architectures.
11+
12+
### Bugfixes
13+
14+
- Fixed GH-118, wherein a compiler would unnecessarily send duplicate work to an extra configured PuppetDB endpoint.
15+
816
### Improvements
917

1018
- Provide a useful overview of the module in the README so that readers can quickly gain a sense of how the module is used, what it affects, and what it does not affect.

manifests/setup/node_manager.pp

+20-4
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,30 @@
99
# environments => ["production", "staging", "development"],
1010
# }'
1111
#
12+
# @param compiler_pool_address
13+
# The service address used by agents to connect to compilers, or the Puppet
14+
# service. Typically this is a load balancer.
15+
# @param internal_compiler_a_pool_address
16+
# A load balancer address directing traffic to any of the "A" pool
17+
# compilers. This is used for DR/HA configuration in large and extra large
18+
# architectures.
19+
# @param internal_compiler_b_pool_address
20+
# A load balancer address directing traffic to any of the "B" pool
21+
# compilers. This is used for DR/HA configuration in large and extra large
22+
# architectures.
23+
#
1224
class peadm::setup::node_manager (
13-
# Common
25+
# Standard
1426
String[1] $master_host,
15-
Optional[String[1]] $compiler_pool_address = undef,
1627

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

31+
# Common
32+
Optional[String[1]] $compiler_pool_address = undef,
33+
Optional[String[1]] $internal_compiler_a_pool_address = $master_host,
34+
Optional[String[1]] $internal_compiler_b_pool_address = $master_replica_host,
35+
2036
# For the next two parameters, the default values are appropriate when
2137
# deploying Standard or Large architectures. These values only need to be
2238
# specified differently when deploying an Extra Large architecture.
@@ -101,7 +117,7 @@
101117
'database_host' => $puppetdb_database_host,
102118
},
103119
'puppet_enterprise::profile::master' => {
104-
'puppetdb_host' => ['${trusted[\'certname\']}', $master_replica_host].filter |$_| { $_ }, # lint:ignore:single_quote_string_with_variables
120+
'puppetdb_host' => ['${trusted[\'certname\']}', $internal_compiler_b_pool_address].filter |$_| { $_ }, # lint:ignore:single_quote_string_with_variables
105121
'puppetdb_port' => [8081],
106122
}
107123
},
@@ -158,7 +174,7 @@
158174
'database_host' => $puppetdb_database_replica_host,
159175
},
160176
'puppet_enterprise::profile::master' => {
161-
'puppetdb_host' => ['${trusted[\'certname\']}', $master_host], # lint:ignore:single_quote_string_with_variables
177+
'puppetdb_host' => ['${trusted[\'certname\']}', $internal_compiler_a_pool_address], # lint:ignore:single_quote_string_with_variables
162178
'puppetdb_port' => [8081],
163179
}
164180
},

plans/action/configure.pp

+22-6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,17 @@
11
# @summary Configure first-time classification and HA setup
22
#
3+
# @param compiler_pool_address
4+
# The service address used by agents to connect to compilers, or the Puppet
5+
# service. Typically this is a load balancer.
6+
# @param internal_compiler_a_pool_address
7+
# A load balancer address directing traffic to any of the "A" pool
8+
# compilers. This is used for DR/HA configuration in large and extra large
9+
# architectures.
10+
# @param internal_compiler_b_pool_address
11+
# A load balancer address directing traffic to any of the "B" pool
12+
# compilers. This is used for DR/HA configuration in large and extra large
13+
# architectures.
14+
#
315
plan peadm::action::configure (
416
# Standard
517
Peadm::SingleTargetSpec $master_host,
@@ -14,6 +26,8 @@
1426

1527
# Common Configuration
1628
String $compiler_pool_address = $master_host,
29+
Optional[String] $internal_compiler_a_pool_address = undef,
30+
Optional[String] $compiler_pool_b_address = undef,
1731
Optional[String] $token_file = undef,
1832
Optional[String] $deploy_environment = undef,
1933

@@ -64,12 +78,14 @@
6478
}
6579

6680
class { 'peadm::setup::node_manager':
67-
master_host => $master_target.peadm::target_name(),
68-
master_replica_host => $master_replica_target.peadm::target_name(),
69-
puppetdb_database_host => $puppetdb_database_target.peadm::target_name(),
70-
puppetdb_database_replica_host => $puppetdb_database_replica_target.peadm::target_name(),
71-
compiler_pool_address => $compiler_pool_address,
72-
require => Class['peadm::setup::node_manager_yaml'],
81+
master_host => $master_target.peadm::target_name(),
82+
master_replica_host => $master_replica_target.peadm::target_name(),
83+
puppetdb_database_host => $puppetdb_database_target.peadm::target_name(),
84+
puppetdb_database_replica_host => $puppetdb_database_replica_target.peadm::target_name(),
85+
compiler_pool_address => $compiler_pool_address,
86+
internal_compiler_a_pool_address => $internal_compiler_a_pool_address,
87+
internal_compiler_b_pool_address => $internal_compiler_b_pool_address,
88+
require => Class['peadm::setup::node_manager_yaml'],
7389
}
7490
}
7591

plans/provision.pp

+28-12
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,18 @@
22
# Puppet Enterprise Extra Large cluster. This plan accepts all parameters
33
# used by its sub-plans, and invokes them in order.
44
#
5+
# @param compiler_pool_address
6+
# The service address used by agents to connect to compilers, or the Puppet
7+
# service. Typically this is a load balancer.
8+
# @param internal_compiler_a_pool_address
9+
# A load balancer address directing traffic to any of the "A" pool
10+
# compilers. This is used for DR/HA configuration in large and extra large
11+
# architectures.
12+
# @param internal_compiler_b_pool_address
13+
# A load balancer address directing traffic to any of the "B" pool
14+
# compilers. This is used for DR/HA configuration in large and extra large
15+
# architectures.
16+
#
517
plan peadm::provision (
618
# Standard
719
Peadm::SingleTargetSpec $master_host,
@@ -16,10 +28,12 @@
1628

1729
# Common Configuration
1830
String $console_password,
19-
String $version = '2019.7.0',
20-
Optional[Array[String]] $dns_alt_names = undef,
21-
Optional[String] $compiler_pool_address = undef,
22-
Optional[Hash] $pe_conf_data = { },
31+
String $version = '2019.8.1',
32+
Optional[Array[String]] $dns_alt_names = undef,
33+
Optional[String] $compiler_pool_address = undef,
34+
Optional[String] $internal_compiler_a_pool_address = undef,
35+
Optional[String] $internal_compiler_b_pool_address = undef,
36+
Optional[Hash] $pe_conf_data = { },
2337

2438
# Code Manager
2539
Optional[String] $r10k_remote = undef,
@@ -71,22 +85,24 @@
7185

7286
$configure_result = run_plan('peadm::action::configure',
7387
# Standard
74-
master_host => $master_host,
75-
master_replica_host => $master_replica_host,
88+
master_host => $master_host,
89+
master_replica_host => $master_replica_host,
7690

7791
# Large
78-
compiler_hosts => $compiler_hosts,
92+
compiler_hosts => $compiler_hosts,
7993

8094
# Extra Large
81-
puppetdb_database_host => $puppetdb_database_host,
82-
puppetdb_database_replica_host => $puppetdb_database_replica_host,
95+
puppetdb_database_host => $puppetdb_database_host,
96+
puppetdb_database_replica_host => $puppetdb_database_replica_host,
8397

8498
# Common Configuration
85-
compiler_pool_address => $compiler_pool_address,
86-
deploy_environment => $deploy_environment,
99+
compiler_pool_address => $compiler_pool_address,
100+
internal_compiler_a_pool_address => $internal_compiler_a_pool_address,
101+
internal_compiler_b_pool_address => $internal_compiler_b_pool_address,
102+
deploy_environment => $deploy_environment,
87103

88104
# Other
89-
stagingdir => $stagingdir,
105+
stagingdir => $stagingdir,
90106
)
91107

92108
# Return a string banner reporting on what was done

plans/upgrade.pp

+24-6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,17 @@
11
# @summary Upgrade an Extra Large stack from one .z to the next
22
#
3+
# @param compiler_pool_address
4+
# The service address used by agents to connect to compilers, or the Puppet
5+
# service. Typically this is a load balancer.
6+
# @param internal_compiler_a_pool_address
7+
# A load balancer address directing traffic to any of the "A" pool
8+
# compilers. This is used for DR/HA configuration in large and extra large
9+
# architectures.
10+
# @param internal_compiler_b_pool_address
11+
# A load balancer address directing traffic to any of the "B" pool
12+
# compilers. This is used for DR/HA configuration in large and extra large
13+
# architectures.
14+
#
315
plan peadm::upgrade (
416
# Standard
517
Peadm::SingleTargetSpec $master_host,
@@ -13,7 +25,10 @@
1325
Optional[Peadm::SingleTargetSpec] $puppetdb_database_replica_host = undef,
1426

1527
# Common Configuration
16-
String $version,
28+
String $version,
29+
Optional[String] $compiler_pool_address = undef,
30+
Optional[String] $internal_compiler_a_pool_address = undef,
31+
Optional[String] $internal_compiler_b_pool_address = undef,
1732

1833
# Other
1934
Optional[String] $token_file = undef,
@@ -177,11 +192,14 @@
177192
}
178193

179194
class { 'peadm::setup::node_manager':
180-
master_host => $master_target.peadm::target_name(),
181-
master_replica_host => $master_replica_target.peadm::target_name(),
182-
puppetdb_database_host => $puppetdb_database_target.peadm::target_name(),
183-
puppetdb_database_replica_host => $puppetdb_database_replica_target.peadm::target_name(),
184-
require => Class['peadm::setup::node_manager_yaml'],
195+
master_host => $master_target.peadm::target_name(),
196+
master_replica_host => $master_replica_target.peadm::target_name(),
197+
puppetdb_database_host => $puppetdb_database_target.peadm::target_name(),
198+
puppetdb_database_replica_host => $puppetdb_database_replica_target.peadm::target_name(),
199+
compiler_pool_address => $compiler_pool_address,
200+
internal_compiler_a_pool_address => $internal_compiler_a_pool_address,
201+
internal_compiler_b_pool_address => $internal_compiler_b_pool_address,
202+
require => Class['peadm::setup::node_manager_yaml'],
185203
}
186204
}
187205

0 commit comments

Comments
 (0)