Skip to content

Commit

Permalink
Fixes #35184 - Drop puppetca_puppet_cert provider
Browse files Browse the repository at this point in the history
Currently for Puppet 6.0 or higher the Puppetserver REST API is used.
Puppet 5 is EOL so this can be dropped. Older versions (dating back to
Puppet 4) had an incomplete API, but core methods do work. Just the
reporting in the UI is incomplete. This means even with Puppet 5 it
won't be completely broken.

Dropping this allows us to move forward. The current implementation has
some coding techniques which need adjustment on Ruby 3. Since nobody
should be using the old code, refactoring it is pointless.
  • Loading branch information
ekohl authored and ehelms committed Jul 8, 2022
1 parent aa25357 commit 6983107
Show file tree
Hide file tree
Showing 18 changed files with 4 additions and 442 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Currently Supported modules:
* BMC - BMC management of devices supported by freeipmi and ipmitool
* DHCP - ISC DHCP and MS DHCP Servers
* DNS - Bind and MS DNS Servers
* Puppet - Any Puppet server from 4.4, 6+ recommended
* Puppet - Puppetserver 6 or 7
* Puppet CA - Manage certificate signing, cleaning and autosign on a Puppet CA server
* Realm - Manage host registration to a realm (e.g. FreeIPA)
* TFTP - any UNIX based tftp server
Expand Down
3 changes: 0 additions & 3 deletions config/settings.d/puppetca.yml.example
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,3 @@
# - puppetca_hostname_whitelisting (verify CSRs based on a hostname whitelist)
# - puppetca_token_whitelisting (verify CSRs based on a token whitelist)
#:use_provider: puppetca_hostname_whitelisting

# Puppet version used
#:puppet_version: '4.1'
4 changes: 0 additions & 4 deletions config/settings.d/puppetca_puppet_cert.yml.example

This file was deleted.

1 change: 0 additions & 1 deletion lib/smart_proxy_main.rb
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ module Proxy
require 'dhcp_libvirt/dhcp_libvirt'
require 'puppetca/puppetca'
require 'puppetca_http_api/puppetca_http_api'
require 'puppetca_puppet_cert/puppetca_puppet_cert'
require 'puppetca_hostname_whitelisting/puppetca_hostname_whitelisting'
require 'puppetca_token_whitelisting/puppetca_token_whitelisting'
require 'puppet_proxy/puppet'
Expand Down
4 changes: 1 addition & 3 deletions modules/puppetca/plugin_configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,9 @@ def load_classes
end

def load_programmable_settings(settings)
raise ::Proxy::Error::ConfigurationError, "Parameter ':puppet_version' is expected to have a non-empty value" if settings[:puppet_version].to_s.empty?

use_provider = settings[:use_provider]
use_provider = [use_provider].compact unless use_provider.is_a?(Array)
use_provider << ((Gem::Version.new(settings[:puppet_version].to_s) >= Gem::Version.new('6.0')) ? :puppetca_http_api : :puppetca_puppet_cert)
use_provider << :puppetca_http_api
settings[:use_provider] = use_provider

settings
Expand Down
15 changes: 0 additions & 15 deletions modules/puppetca_puppet_cert/plugin_configuration.rb

This file was deleted.

157 changes: 0 additions & 157 deletions modules/puppetca_puppet_cert/puppetca_impl.rb

This file was deleted.

2 changes: 0 additions & 2 deletions modules/puppetca_puppet_cert/puppetca_puppet_cert.rb

This file was deleted.

11 changes: 0 additions & 11 deletions modules/puppetca_puppet_cert/puppetca_puppet_cert_plugin.rb

This file was deleted.

2 changes: 1 addition & 1 deletion test/puppet/integration_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def test_features
ssl_key = Tempfile.new('ssl_key')

begin
Proxy::DefaultModuleLoader.any_instance.expects(:load_configuration_file).with('puppet.yml').returns(enabled: true, puppet_version: '5.5.8')
Proxy::DefaultModuleLoader.any_instance.expects(:load_configuration_file).with('puppet.yml').returns(enabled: true)
Proxy::DefaultModuleLoader.any_instance.expects(:load_configuration_file).with('puppet_proxy_puppet_api.yml').returns(
puppet_url: 'https://puppet.example.com:8140',
puppet_ssl_ca: ssl_ca.path,
Expand Down
27 changes: 0 additions & 27 deletions test/puppetca/puppetca_config_test.rb

This file was deleted.

2 changes: 1 addition & 1 deletion test/puppetca_http_api/integration_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def test_features
ssl_key = Tempfile.new('ssl_key')

begin
Proxy::DefaultModuleLoader.any_instance.expects(:load_configuration_file).with('puppetca.yml').returns(enabled: true, puppet_version: '6.0.0')
Proxy::DefaultModuleLoader.any_instance.expects(:load_configuration_file).with('puppetca.yml').returns(enabled: true)
Proxy::DefaultModuleLoader.any_instance.expects(:load_configuration_file).with('puppetca_hostname_whitelisting.yml').returns({})
Proxy::DefaultModuleLoader.any_instance.expects(:load_configuration_file).with('puppetca_http_api.yml').returns(
puppet_url: 'https://puppet.example.com:8140',
Expand Down
20 changes: 0 additions & 20 deletions test/puppetca_puppet_cert/fixtures/ca/ca_crl.pem

This file was deleted.

4 changes: 0 additions & 4 deletions test/puppetca_puppet_cert/fixtures/ca/inventory.txt

This file was deleted.

1 change: 0 additions & 1 deletion test/puppetca_puppet_cert/fixtures/puppet

This file was deleted.

1 change: 0 additions & 1 deletion test/puppetca_puppet_cert/fixtures/sudo

This file was deleted.

9 changes: 0 additions & 9 deletions test/puppetca_puppet_cert/puppetca_puppet_cert_config_test.rb

This file was deleted.

Loading

0 comments on commit 6983107

Please sign in to comment.