I was looking at the basic example for exporting and collecting resources
at http://docs.puppetlabs.com/guides/exported_resources.html :
class ssh {
@@sshkey { $hostname: type => dsa, key => $sshdsakey }
Sshkey <<| |>>
}
I quote:
"The above code would have every host export its SSH public key, and then
collect every host�s key and install it in the ssh_known_hosts file; this
would include the host doing the exporting."
That last statement seems untrue in my experiments.
I have the following manifest:
# Export a firewall rule, requesting access to DIR/MRC replication ports
@@firewall::rule {"xtreemfs-repl-${hostname}":
rule => [
"-A firewall-user-app -p tcp -s $primary_ipaddress --dport 35678
-j ACCEPT",
"-A firewall-user-app -p tcp -s $primary_ipaddress --dport 35676
-j ACCEPT",
],
}
# Collect all firewall rules from DIR/MRC servers
Firewall::Rule <<| tag == 'xtreemfs::dir_mrc' |>>
This class is included on two servers, let's call them serverA and serverB.
On serverA, I do get Firewall::Rule[xtreemfs-repl-serverB], but not
Firewall::Rule[xtreemfs-repl-serverA], and on serverB, it's the other way
around.
So exporting works (confirmed by looking at the database). So does
collecting, only not from the local node. What am I doing wrong?
Best regards,
Martijn Grendelman
A small addition at the bottom...
When adding the class to a third server, all servers get the
Firewall::Rule from the two others, but never from itself.
> So exporting works (confirmed by looking at the database). So does
> collecting, only not from the local node. What am I doing wrong?
Most curious...
Best regards,
Martijn Grendelman
Best regards,
Martijn.
http://projects.puppetlabs.com/issues/11049
The workaround I believe is to use explicit tags on the resource.
resource_name { "foo":
tag => "class_name",
}
Can you give that a try?
ken.