puppet-splunk icon indicating copy to clipboard operation
puppet-splunk copied to clipboard

Exported resources getting automatically collected

Open rbclark opened this issue 7 years ago • 1 comments

Affected Puppet, Ruby, OS and module versions/distributions

  • Puppet: 4.10.6
  • Ruby: 2.0.0p648
  • Distribution: RedHat
  • Module version: 7.2.0

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

@@splunk_server { 'clustering/master_uri':
  value => "https://${::fqdn}:8089",
}

What are you seeing

The resource is automatically realized on the node it is declared on.

What behaviour did you expect instead

According to the documentation on exported resources it should not be realized until it is collected, however even with no collectors declared in my code it is automatically being collected.

Declaring an exported resource causes that resource to be added to the catalog and marked with an “exported” flag, which prevents Puppet agent from managing the resource (unless it was collected).

Output log

Notice: /Stage[main]/Profile::Splunk::Cluster_master/Splunk_server[clustering/master_uri]/ensure: created

rbclark avatar Sep 19 '18 17:09 rbclark

Just to provide some more info. I have declared the example ini_setting block (which I believe this module is based on)

@@ini_setting { 'sample_setting':
  ensure => present,
  path    => '/tmp/foo.ini',
  section => 'bar',
  setting  => 'baz',
  value    => 'quux',
}

And the problem does not manifest itself there. Also, as a workaround for now I have added ensure => absent to all of my exported resources and then added ensure => present to my resource collector to work around this.

rbclark avatar Sep 19 '18 17:09 rbclark