Re: [Puppet Users] How to access $facts['os'] in a manifest

2016-06-03 Thread Marc Haber
On Thu, Jun 02, 2016 at 06:10:42PM +0200, Henrik Lindberg wrote: > With future parser you can do: > > notice($os =~ Hash) > > Which will notice 'true' if $os is a hash $ sudo puppet apply -e '$hmpf=is_hash($os) notify{"foo ${hmpf}":}' Notice: Compiled catalog for hostname in environment

Re: [Puppet Users] How to access $facts['os'] in a manifest

2016-06-02 Thread Henrik Lindberg
On 02/06/16 15:55, Marc Haber wrote: On Thu, Jun 02, 2016 at 03:41:35PM +0200, Henrik Lindberg wrote: On 02/06/16 14:58, Marc Haber wrote: On Thu, Jun 02, 2016 at 02:42:17PM +0200, Henrik Lindberg wrote: On 02/06/16 09:22, Marc Haber wrote: On Wed, Jun 01, 2016 at 05:34:59PM +0200, Henrik

Re: [Puppet Users] How to access $facts['os'] in a manifest

2016-06-02 Thread Marc Haber
On Thu, Jun 02, 2016 at 03:41:35PM +0200, Henrik Lindberg wrote: > On 02/06/16 14:58, Marc Haber wrote: > >On Thu, Jun 02, 2016 at 02:42:17PM +0200, Henrik Lindberg wrote: > >>On 02/06/16 09:22, Marc Haber wrote: > >>>On Wed, Jun 01, 2016 at 05:34:59PM +0200, Henrik Lindberg wrote: > First

Re: [Puppet Users] How to access $facts['os'] in a manifest

2016-06-02 Thread Henrik Lindberg
On 02/06/16 14:58, Marc Haber wrote: Hi, thanks for your answers. They're helpful. On Thu, Jun 02, 2016 at 02:42:17PM +0200, Henrik Lindberg wrote: On 02/06/16 09:22, Marc Haber wrote: On Wed, Jun 01, 2016 at 05:34:59PM +0200, Henrik Lindberg wrote: First check what you get in puppet with a

Re: [Puppet Users] How to access $facts['os'] in a manifest

2016-06-02 Thread Marc Haber
Hi, thanks for your answers. They're helpful. On Thu, Jun 02, 2016 at 02:42:17PM +0200, Henrik Lindberg wrote: > On 02/06/16 09:22, Marc Haber wrote: > >On Wed, Jun 01, 2016 at 05:34:59PM +0200, Henrik Lindberg wrote: > >>First check what you get in puppet with a simple manifest: > >> >

Re: [Puppet Users] How to access $facts['os'] in a manifest

2016-06-02 Thread Henrik Lindberg
On 02/06/16 09:22, Marc Haber wrote: On Wed, Jun 01, 2016 at 05:34:59PM +0200, Henrik Lindberg wrote: First check what you get in puppet with a simple manifest: notice($facts) $ sudo puppet apply -e 'notify{"${os}":}' Notice: Compiled catalog for host in environment production in 0.02

Re: [Puppet Users] How to access $facts['os'] in a manifest

2016-06-02 Thread Marc Haber
On Wed, Jun 01, 2016 at 05:34:59PM +0200, Henrik Lindberg wrote: > First check what you get in puppet with a simple manifest: > > notice($facts) $ sudo puppet apply -e 'notify{"${os}":}' Notice: Compiled catalog for host in environment production in 0.02 seconds Notice: {"name"=>"CentOS",

Re: [Puppet Users] How to access $facts['os'] in a manifest

2016-06-01 Thread Henrik Lindberg
On 01/06/16 16:43, Marc Haber wrote: Hi, I have the following code: if( $facts['os']['family'] == 'RedHat' and $facts['os']['release']['major'] == '7' ) { file { "...": ensure => 'file', path=> "...", content => "...", }

[Puppet Users] How to access $facts['os'] in a manifest

2016-06-01 Thread Marc Haber
Hi, I have the following code: if( $facts['os']['family'] == 'RedHat' and $facts['os']['release']['major'] == '7' ) { file { "...": ensure => 'file', path=> "...", content => "...", } } My agent is puppet 3.8.4, my