Skip to content

Commit acd3f5a

Browse files
authored
Merge pull request #181 from taikaa/SUP-3703
(SUP-3703) Add indicator S0044 node_terminus is the PE classifier
2 parents 7177638 + e3a5519 commit acd3f5a

File tree

3 files changed

+14
-1
lines changed

3 files changed

+14
-1
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,7 @@ Refer below for next steps when any indicator reports a `false`.
267267
| S0041 | Determines if the pxp broker on a compiler has an established connection to another pxp broker | To resolve a connection issue from a compiler to a pcp broker examine the following log `/var/log/puppetlabs/puppetserver/pcp-broker.log` for an explanation, Compilers should be attempting to make a connection to port 8143 on the primary server, ssl can not be terminated on a network appliance and must passthrough directly to the primary server. Ensure the connnection attempt is not to another compiler in the pool | If unable to make a connection to a broker, raise a ticket with the support team quoting S0041 and attaching the file `/var/log/puppetlabs/puppetserver/pcp-broker.log` along with the conclusions of your investigation so far |
268268
| S0042 |Determines if the pxp-agent has an established connection to a pxp broker | Ensure the pxp-agent service is running. Check S0002 can make that determination. if running check `/var/log/puppetlabs/pxp-agent/pxp-agent.log` (on *nix) or `C:/ProgramData/PuppetLabs/pxp-agent/var/log/pxp-agent.log` (on Windows), for connection issues, first ensuring the agent is connecting to the proper endpoint, for example, a compiler and not the primary. This fact can also be used as a target filter for running tasks, ensuring time is not wasted sending instructions to agents not connected to a broker | If unable to make a connection to a broker, raise a ticket with the support team quoting S0042 and attaching the file `/var/log/puppetlabs/pxp-agent/pxp-agent.log` (on *nix) or `C:/ProgramData/PuppetLabs/pxp-agent/var/log/pxp-agent.log` (on Windows), along with the conclusions of your investigation so far |
269269
| S0043 |Determines if there are nodes with Puppet agent versions ahead of the primary server | Agent nodes should not be running Puppet agent versions ahead of infrastructure nodes. Instead consider upgrading PE so that PE package management contains the desired Puppet agent version. See the [upgrading PE](https://puppet.com/docs/pe/latest/upgrading_pe.html) and [upgrading agents](https://puppet.com/docs/latest/upgrading_agents.html) documentation for more information. | If you are unable to determine why the indicator is evaluating to `false` or have questions about Puppet agent versions, open a support ticket and reference S0043. |
270+
| S0044 |Determines if Puppet Servers are using the the PE classifier for the node data plugin (node terminus) | Due to performance optimizations, it is recommended to use the PE classifier plugin instead of external node classifier (ENC) scripts or applications. See the [node_terminus configuration setting documentation](https://www.puppet.com/docs/puppet/7/configuration.html#node-terminus) for more information. | If you have additional questions about the node_terminus configuration setting, open a support ticket and reference S0044. |
270271
271272
### Fact: agent_status_check
272273

lib/facter/pe_status_check.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -526,4 +526,10 @@
526526
{ S0043: false }
527527
end
528528
end
529+
530+
chunk(:S0044) do
531+
next unless ['primary', 'legacy_primary', 'replica', 'pe_compiler', 'legacy_compiler'].include?(Facter.value('pe_status_check_role'))
532+
classifier_is_node_terminus = (Puppet.settings.set_in_section(:node_terminus, :master) == 'classifier') || (Puppet.settings.set_in_section(:node_terminus, :server) == 'classifier')
533+
{ S0044: classifier_is_node_terminus }
534+
end
529535
end

spec/acceptance/pe_status_check_spec.rb

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
# Test Confirms all facts are false which is another indicator the class is performing correctly
1717
describe 'check no pe_status_check fact is false' do
1818
it 'if idempotent all facts should be true' do
19-
expect(host_inventory['facter']['pe_status_check'].size).to eq(38)
19+
expect(host_inventory['facter']['pe_status_check'].size).to eq(39)
2020
expect(host_inventory['facter']['pe_status_check'].filter { |_k, v| !v }).to be_empty
2121
end
2222
end
@@ -345,6 +345,12 @@ class {'pe_status_check':
345345
expect(result.stdout).to match(%r{false})
346346
run_shell('systemctl start pe-orchestration-services')
347347
end
348+
it 'if S0044 conditions for false are met' do
349+
run_shell('puppet config set --section master node_terminus exec')
350+
result = run_shell('facter -p pe_status_check.S0044')
351+
expect(result.stdout).to match(%r{false})
352+
run_shell('puppet config set --section master node_terminus classifier')
353+
end
348354
end
349355
end
350356
end

0 commit comments

Comments
 (0)