On Friday, February 9, 2018 at 4:00:48 PM UTC-6, Albert Shih wrote: > > Hi, > > I would like to know how you or what's best practice to manage tag in > exported resources. > > For example I have two hosts H1 and H2->100, and I want export file_line > from H2->100 > to H1. > > So or I use a standardized tag (like "for_${::fqdn}" whatever the kind of > resource) than in H1 I can very easily imported those resource. Or I need > share a information between those two hosts (and I don't know how to do > that properly when I have lot of exported resources). > > What's best way ? >
I would start by generalizing the problem a bit. *Why* do you want to export a resource from H1 to H2->100? There are two aspects that I would recommend being reflected by one or more tags: 1. File_line is a very generic resource. It will likely be helpful, therefore, to tag instances with something that narrows that type in a meaningful way. For example, if there were not already a Host resource type, then you might use File_line tagged with something like "hosts_line" for the same purpose. 2. Since you specifically want one host to collect this resource, it sounds like there is a question of scope that might be appropriately reflected by a tag. It is unlikely that H1's *identity* is an appropriate descriptor for that scope, however. The scope in question might be a data center, a compute cluster, an application, or similar. That's what should be reflected by tagging. Or maybe you don't actually need a scope narrower than your whole site after all. This permits you to decouple H1 and H2->100 from each other, making the whole arrangement both clearer and more flexible. H2->100 does not need to know or care which node(s), if any, are going to collect the resources it exports, and it doesn't need to do anything differently if that changes. On the H1 side, the purpose of collecting the particular resources it does is clearer. John -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/513f17a8-473c-4b4d-bf09-7b6a8cf376eb%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.