----- Original Message ----- > From: "Steph Gosling" <st...@chuci.org> > To: puppet-users@googlegroups.com > Sent: Wednesday, June 20, 2012 1:20:12 PM > Subject: [Puppet Users] Custom facts and hyphens > > Hi all, > > Possibly related to http://projects.puppetlabs.com/issues/10146 but I > wanted to get a second opinion. > > I have a custom fact that iteratse through the disks on a > given EC2 node and creates facts for block devices based on > their /dev/disk/by-path/ links. I had to come up with this as a > work-around for an existing RH bug in which a kernel upgrade can > magically move block device names and terminally break an awful lot. > Anyway, the fact is simple, produces output like this: > > xen-vbd-2049 => /dev/xvda1 > xen-vbd-2050 => /dev/xvda2 > xen-vbd-2051 => /dev/xvda3 > > Those facts in conjunction with a virtual resource like this: > > @disks::virtual::setlabel { "root": > > devicename => "$::xen-vbd-2049", > devicelabel => "root", > > } > > lets me work around the problem on first run regardless whether that > block device is called /dev/xvda1, /dev/xvdf1, /dev/foobarbaz1 or > whatever > after a reboot. > > Anyway, this worked certainly in Puppet <= 2.7.14 but now breaks in > .16 > and .17. It does appear to be variable related as the exec that is > called by the realize is this: > > debug: Exec[e2label -vbd-2049 root](provider=posix): Executing check > 'test -e -vbd-2049' > > so clearly the variable isn't being treated correctly. I tried $:: > {xen-vbd-2049} but no dice there. > > Are hyphens now officially bad practice? I have a nagging half-memory > that I read that they're not good in facts, indeed all of the normal > facts are underscore'd but I can't remember where I read it.
They've always been a bad idea, used to be documented to be supported for a short while but they never worked well, I think the agreement is that they will just not be allowed soon in any variable or class name -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.