On Saturday, 27 August 2016 18:51:09 UTC+1, Marc Haber wrote:
>
> On Fri, Aug 26, 2016 at 08:40:49AM -0700, Luke Bigum wrote: 
> > My Dell XPS 13, 2016 model: 
> > 
> >  /sys/class/net/docker0 
> > /sys/class/net/enp0s20u1u3i5 
> > E: ID_NET_NAME_MAC=enx9cebe824ebee 
> > E: ID_NET_NAME_PATH=enp0s20u1u3i5 
>
> What a name! 
>

http://accessories.euro.dell.com/sna/productdetail.aspx?c=uk&l=en&s=bsd&cs=ukbsdt1&sku=452-bboo
 

> > For both the Dell R720 and R730, there's no NET_NAME stuff: 
> > 
> > [root@r720 ~]# udevadm info -q all -p /sys/class/net/p4p2 
> > P: /devices/pci0000:40/0000:40:02.0/0000:42:00.1/net/p4p2 
> > E: UDEV_LOG=3 
> > E: DEVPATH=/devices/pci0000:40/0000:40:02.0/0000:42:00.1/net/p4p2 
> > E: INTERFACE=p4p2 
> > E: IFINDEX=7 
> > E: SUBSYSTEM=net 
>
> Maybe OS too old? The interface name "p4p2" also looks fishy. 
>

Nope, CentOS 6 (which I guess is pretty old now).
 

> > Yes, we definitely don't define resources, and don't include component / 
> > base level classes.  I think we pulled it from an early Gary Larizza 
> post, 
> > along with "roles don't have parameters, if you need to configure a role 
> > you've got two different roles". 
>
> Yes, but dropping a supplementary file does not mean that a role has 
> parameters. And also, it would be duplication if one had two distinct 
> roles that would only differ in single setting? 
>

Mmmm that's one of the two big questions in all our Puppet design 
discussions here. Do I introduce some sort of boolean switch to drop a new 
file,
or do I create a new role / profile. (The other big question is "Should 
this value be hard coded in a profile or as a parameter in Hiera?")

If it is just one file difference, then I would be persuaded to allow a 
boolean switch in the profile. If the file did functionality differences
inside a given location/environment, or or was necessary in this location 
but not others, I'd be ok with the boolean being set in Hiera for those 
locations/environments.

If on the other hand it the role needed to be used in two different ways 
inside an environment (maybe the file was the difference between Master and 
Slave) then I would
advocate two roles. In my mind that's quite clear that there are two 
different "jobs to do" here, rather than something being done slightly 
differently in a different location:

class  role::master {
   class { 'profile::something': master => true }
}
class  role::slave {
   class { 'profile::something': master => false }
}

The problem I've found with such boolean switches is once someone sees one 
of them as a potential solution, they tend to explode into a mass of if 
statements and 
make things really complicated to read. I think it's because it's easy - I 
can just solve my problem right now with an if statement here, rather than 
spend a few hours
thinking about and refactoring all the related classes.

Getting a good balance between duplication (and testing) versus purist 
design is difficult, and I don't think there will ever be a right answer.

-Luke

-- 
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/3ca61fb4-389d-4738-be23-d63b7a4b3d0d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to