On Thursday, May 16, 2019 at 10:50:45 AM UTC-5, Helmut Schneider wrote:

>
> I don't want to install netplan but if it exists do the needful: 
>


I reiterate Ben Ford's comments: This is generally considered an 
anti-pattern.

It is better from an administrative perspective for you to know which 
systems are *supposed* to have netplan, and to unconditionally ensure that 
it is both installed and properly configured on those systems.  You could 
go so far as to ensure it absent from other machines, though whether that's 
appropriate is a policy question whose answer will vary.  In any case, it 
is not only reasonable but safer for all concerned to demand that the 
identities of machines for which you are going to manage netplan 
configuration be statically known to you.

With that said, if you insist on treading this path anyway then a custom 
fact is indeed the right way to convey the wanted information to Puppet, 
whether that's the version of netplan that's installed, if any, or merely 
whether netplan is installed at all.  For that you'll want either a fact 
specific to that purpose (e.g. $::netplan_version), or a more general fact 
from which you can glean the information (e.g. $::installed_packages).  
There is no way to parameterize a fact so that it has different meaning 
depending on how it is evaluated.


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/969c389c-e862-45c8-a557-ce62b62483e1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to