-
Notifications
You must be signed in to change notification settings - Fork 222
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes #30857 - Merge puppet_proxy_puppet_api into mod
In 7e7015a the legacy provider was dropped. Since then, there is only one provider. The provider code was kept since it didn't need any changes to configuration files. However, having a module with just a single provider is complex. Both from a code perspective and as an admin. The implications are that the puppet.yaml and puppet_proxy_puppet_api.yaml files are merged (after being split in df0fc72). This means installer and manual updates are needed to reflect this.
- Loading branch information
Showing
25 changed files
with
131 additions
and
361 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,14 @@ | ||
--- | ||
# Can be true, false, or http/https to enable just one of the protocols | ||
:enabled: false | ||
|
||
# URL of the puppet master itself for API requests. | ||
#:puppet_url: https://puppet.example.com:8140 | ||
|
||
# SSL certificates used to access the puppet API | ||
#:puppet_ssl_ca: /etc/puppetlabs/puppet/ssl/certs/ca.pem | ||
#:puppet_ssl_cert: /etc/puppetlabs/puppet/ssl/certs/puppet.example.com.pem | ||
#:puppet_ssl_key: /etc/puppetlabs/puppet/ssl/private_keys/puppet.example.com.pem | ||
|
||
# Smart Proxy api timeout when Puppet's environment classes api is used and classes cache is disabled | ||
#:api_timeout: 30 |
This file was deleted.
Oops, something went wrong.
88 changes: 0 additions & 88 deletions
88
extra/migrations/20160413000000_migrate_puppet_settings.rb
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 4 additions & 6 deletions
10
...puppet_proxy_puppet_api/v3_api_request.rb → modules/puppet_proxy/apiv3.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,37 @@ | ||
module ::Proxy::Puppet | ||
class ConfigurationLoader | ||
def load_programmable_settings(settings) | ||
settings[:use_provider] = [:puppet_proxy_puppet_api] | ||
settings | ||
end | ||
|
||
def load_classes | ||
require 'puppet_proxy_common/errors' | ||
require 'puppet_proxy/errors' | ||
require 'puppet_proxy/dependency_injection' | ||
require 'puppet_proxy/puppet_api' | ||
require 'puppet_proxy/environment' | ||
require 'puppet_proxy/puppet_class' | ||
require 'puppet_proxy_common/api_request' | ||
require 'puppet_proxy/apiv3' | ||
require 'puppet_proxy/v3_environments_retriever' | ||
require 'puppet_proxy/v3_environment_classes_api_classes_retriever' | ||
end | ||
|
||
def load_dependency_injection_wirings(container_instance, settings) | ||
container_instance.dependency :environment_retriever_impl, | ||
(lambda do | ||
api = Proxy::Puppet::Apiv3.new( | ||
settings[:puppet_url], | ||
settings[:puppet_ssl_ca], | ||
settings[:puppet_ssl_cert], | ||
settings[:puppet_ssl_key]) | ||
::Proxy::Puppet::V3EnvironmentsRetriever.new(api) | ||
end) | ||
|
||
container_instance.singleton_dependency :class_retriever_impl, | ||
(lambda do | ||
::Proxy::Puppet::V3EnvironmentClassesApiClassesRetriever.new( | ||
settings[:puppet_url], | ||
settings[:puppet_ssl_ca], | ||
settings[:puppet_ssl_cert], | ||
settings[:puppet_ssl_key], | ||
settings[:api_timeout]) | ||
end) | ||
end | ||
end | ||
end |
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
module Proxy::Puppet | ||
class V3EnvironmentsRetriever | ||
def initialize(api) | ||
@api = api | ||
end | ||
|
||
def get(an_environment) | ||
found = all.find { |e| e.name == an_environment } | ||
raise Proxy::Puppet::EnvironmentNotFound.new("Could not find environment '#{an_environment}'") unless found | ||
found | ||
end | ||
|
||
def all | ||
response = @api.find_environments | ||
raise Proxy::Puppet::DataError.new("No environments list in Puppet API response") unless response['environments'] | ||
environments = response['environments'].each_with_object({}) do |item, envs| | ||
envs[item.first] = item.last['settings']['modulepath'] if item.last && item.last['settings'] && item.last['settings']['modulepath'] | ||
end | ||
environments.map { |env, path| Proxy::Puppet::Environment.new(env, path) } | ||
end | ||
end | ||
end |
25 changes: 0 additions & 25 deletions
25
modules/puppet_proxy_common/environments_retriever_base.rb
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
15 changes: 0 additions & 15 deletions
15
modules/puppet_proxy_puppet_api/puppet_proxy_puppet_api_plugin.rb
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.