Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warnings produced when splunk resources are in catalog #86

Closed
treydock opened this issue Feb 6, 2017 · 3 comments
Closed

Warnings produced when splunk resources are in catalog #86

treydock opened this issue Feb 6, 2017 · 3 comments

Comments

@treydock
Copy link
Contributor

treydock commented Feb 6, 2017

Affected Puppet, Ruby, OS and module versions/distributions

How to reproduce (e.g Puppet code you use)

Include splunk or splunk::forwarder class on a system

What are you seeing

[root@splunk ~]# puppet agent --test --noop
Info: Retrieving pluginfacts
Info: Retrieving plugin
Info: Loading facts
Info: Redefining rhsm_register in Puppet::Type
Info: Redefining augeasprovider in Puppet::Type
Info: Redefining shellvar in Puppet::Type
Info: Redefining datacat_fragment in Puppet::Type
Info: Redefining ini_setting in Puppet::Type
Info: Redefining firewall in Puppet::Type
Info: Redefining firewallchain in Puppet::Type
Info: Redefining foreman_resource in Puppet::Type
Info: Redefining idmapd_config in Puppet::Type
Info: Redefining gpg_key in Puppet::Type
Info: Redefining rhsm_repo in Puppet::Type
Warning: The dns_rr resource type is deprecated. Use resource_record instead
Info: Redefining file_line in Puppet::Type
Warning: The a2mod provider is deprecated, please use apache::mod instead
Info: Redefining anchor in Puppet::Type
Info: Redefining datacat_collector in Puppet::Type
Info: Caching catalog for splunk.infra.osc.edu
Info: Applying configuration version '1486415397'

What behaviour did you expect instead

Output produced by commenting out profile that includes splunk class and resources.

[root@splunk ~]# puppet agent --test --noop
Info: Retrieving pluginfacts
Info: Retrieving plugin
Info: Loading facts
Info: Caching catalog for splunk.infra.osc.edu
Info: Applying configuration version '1486415694'

Any additional information you'd like to impart

@jameslikeslinux
Copy link
Contributor

I am seeing the same issue on my systems after trying to include the splunk::forwarder class, except in my case, the agent is trying to redefine a module with a Ruby dependency that isn't installed on the client, resulting in the agent run failing:

Info: Retrieving pluginfacts
Info: Retrieving plugin
Info: Loading facts
Warning: The a2mod provider is deprecated, please use apache::mod instead
Info: Redefining anchor in Puppet::Type
Info: Redefining file_line in Puppet::Type
Info: Redefining firewall in Puppet::Type
Info: Redefining firewallchain in Puppet::Type
Info: Redefining ini_setting in Puppet::Type
Error: Could not autoload puppet/provider/make_server_update/ruby: cannot load such file -- net/http/post/multipart
Error: Could not autoload puppet/type/splunk_config: Could not autoload puppet/provider/make_server_update/ruby: cannot load such file -- net/http/post/multipart
Error: Could not retrieve catalog from remote server: Could not intern from text/pson: Could not autoload puppet/type/splunk_config: Could not autoload puppet/provider/make_server_update/ruby: cannot load such file -- net/http/post/multipart
Warning: Not using cache on failed catalog
Error: Could not retrieve catalog; skipping run

This is with Puppet 4.2.2 as bundled in the puppet-agent 1.2.5 package.

@jameslikeslinux
Copy link
Contributor

Looks like this is because the splunk_config type loads all of the types in the environment with:

# Require all of our types so the class names are resolvable for purging
Dir[File.dirname(__FILE__) + '/*.rb'].each do |file|
  require file unless file == __FILE__
end

It should be changed to just load the splunk types, like:

# Require all of our types so the class names are resolvable for purging
Dir[File.dirname(__FILE__) + '/splunk*.rb'].each do |file|
  require file unless file == __FILE__
end

I'll do some testing and submit a pull request.

treydock added a commit to treydock/puppet-splunk that referenced this issue Feb 28, 2017
@treydock
Copy link
Contributor Author

@iamjamestl That change works, the only types getting redefined are splunk module types, oddly only a couple types get redefined.

Info: Loading facts
Info: Redefining splunkforwarder_input in Puppet::Type
Info: Redefining splunkforwarder_deploymentclient in Puppet::Type

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants