jcbollinger wrote:
> 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 pe
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
Chris Taylor wrote:
> if $operatingsystem == "Ubuntu" {
> if versioncmp($facts['os']['release']['full'], '18') >= 0 {
> package { 'netplan':
> ensure => present,
> }
> file { "/etc/netplan/windows-dhcp.yaml":
> mode=> '0644',
> owner => "${rootUID}",
>
You'd be better declaring netplan as a requires:
if $operatingsystem == "Ubuntu" {
if versioncmp($facts['os']['release']['full'], '18') >= 0 {
package { 'netplan':
ensure => present,
}
file { "/etc/netplan/windows-dhcp.yaml":
mode=> '0644',
owner => "${roo
Ben Ford wrote:
> To be sure, this pattern doesn't always work and you don't always have
> control over the full system. What's your use case that you're trying
> to solve?
if $operatingsystem == "Ubuntu" {
if versioncmp($facts['os']['release']['full'], '18') >= 0 {
file { "/etc/netplan/win
You cannot pass a variable to facter, because that's not how its model is
designed. Facter is a tool that runs to gather relatively static system
information, called facts. A fact with a given name has a given value. In
other words, you need one unique fact for every value you're gathering.
(though
Hi,
before I reinvent the wheel:
Does anyone know a custom fact that returns the version of an installed
package (if it is installed)?
I assume it would be something like
Facter.add(:package_version) do
setcode do
osfamily = Facter.value(:osfamily)
case osfamily
when /ubuntu|debia