Issue #23392 has been reported by Laurent Bigonville.
----------------------------------------
Bug #23392: No way to set default tags for exported ressources
https://projects.puppetlabs.com/issues/23392
* Author: Laurent Bigonville
* Status: Unreviewed
* Priority: Normal
* Assignee:
* Category: exported resources
* Target version:
* Affected Puppet version: 3.3.1
* Keywords:
* Branch:
----------------------------------------
Hi,
In our manifest, we are trying to set a default tag for all our "Nagios_host",
to achieve this we are adding the following code in the site.pp:
<pre>
Nagios_host {
tag => 'local',
}
</pre>
And the somewhere else in our code, we are exporting the resources and the
trying to collect them using the tag:
<pre>
@@nagios_host{'foo': params}
Nagios_host <<| tag == 'local' |>>
</pre>
The problem here is that, nothing is realized because the tag is not exported
properly, querying puppetdb directly shows the following:
<pre>
# curl localhost:8080/v3/resources/Nagios_host
[ {
"parameters" : {
"statusmap_image" : "os/Ubuntu.png",
"action_url" : "/pnp4nagios/graph?host=$HOSTNAME$",
"notifications_enabled" : "1",
"target" : "/etc/icinga/objects/hosts/host-mon2.example.com.cfg",
"check_command" : "check-host-alive",
"address" : "192.168.3.129",
"icon_image" : "os/Ubuntu.png",
"notification_period" : "24x7",
"max_check_attempts" : "4",
"tag" : "local",
"hostgroups" : "default",
"ensure" : "present",
"icon_image_alt" : "Ubuntu"
},
"line" : 78,
"file" : "/etc/puppet/environments/prod/modules/icinga/manifests/collect.pp",
"exported" : true,
"tags" : [ "example", "default", "node", "mon2.example.com", "icingaclient",
"example::icingaclient", "collect", "nagios_host", "icinga::collect", "class",
"icinga" ],
"title" : "mon2.example.com",
"type" : "Nagios_host",
"resource" : "806ed13544851d4ede203cbe3a9eceed6964c5ab",
"certname" : "mon2.example.com"
} ]
</pre>
As you can see, the "local" tag is only present in the "parameters" part and
not it "tags"
If I'm explicitly adding the tag to the resource that will be exported, the tag
is present in both "tag" and "tags" and the resources are properly realized.
--
You have received this notification because you have either subscribed to it,
or are involved in it.
To change your notification preferences, please click here:
http://projects.puppetlabs.com/my/account
--
You received this message because you are subscribed to the Google Groups
"Puppet Bugs" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/puppet-bugs.
For more options, visit https://groups.google.com/groups/opt_out.