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 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", "family"=>"RedHat", "release"=>{"major"=>"7", 
> >>>"minor"=>"2", "full"=>"7.2.1511"}, "lsb"=>{"distcodename"=>"Core", 
> >>>"distid"=>"CentOS", "distdescription"=>"CentOS Linux release 7.2.1511 
> >>>(Core) ", "release"=>":core-4.1-amd64:core-4.1-noarch", 
> >>>"distrelease"=>"7.2.1511", "majdistrelease"=>"7", "minordistrelease"=>"2"}}
> >>>Notice: /Stage[main]/Main/Notify[{"name"=>"CentOS", "family"=>"RedHat", 
> >>>"release"=>{"major"=>"7", "minor"=>"2", "full"=>"7.2.1511"}, 
> >>>"lsb"=>{"distcodename"=>"Core", "distid"=>"CentOS", 
> >>>"distdescription"=>"CentOS Linux release 7.2.1511 (Core) ", 
> >>>"release"=>":core-4.1-amd64:core-4.1-noarch", "distrelease"=>"7.2.1511", 
> >>>"majdistrelease"=>"7", "minordistrelease"=>"2"}}]/message: defined 
> >>>'message' as '{"name"=>"CentOS", "family"=>"RedHat", 
> >>>"release"=>{"major"=>"7", "minor"=>"2", "full"=>"7.2.1511"}, 
> >>>"lsb"=>{"distcodename"=>"Core", "distid"=>"CentOS", 
> >>>"distdescription"=>"CentOS Linux release 7.2.1511 (Core) ", 
> >>>"release"=>":core-4.1-amd64:core-4.1-noarch", "distrelease"=>"7.2.1511", 
> >>>"majdistrelease"=>"7", "minordistrelease"=>"2"}}'
> >>>Notice: Finished catalog run in 0.70 seconds
> >>>$ sudo puppet apply -e 'notify{"foo ${facts}":}'
> >>>Notice: Compiled catalog for host in environment production in 0.03 seconds
> >>>Notice: foo
> >>>Notice: /Stage[main]/Main/Notify[foo ]/message: defined 'message' as 'foo '
> >>>Notice: Finished catalog run in 0.81 seconds
> >>>$ sudo puppet --version
> >>>3.8.6
> >>>
> >>>Unfortunately, I cannot see here whether ${os} is actually a string,
> >>>can I?
> >>>
> >>
> >>When you notice ${os} it turns the value into the printed string. That
> >>string looks like a hash, so you are indeed seeing a structure value where
> >>you should be able to access $os[name] etc.
> >
> >How would it look like if ${os} were actually a hash?
> >
> Like in the output you got (above).
> i.e. { "name" => "CentOS", "family" => " ...", ... }

We're turning around in circles. So I cannot see in a notify whether I
am notifying a hash or a stringyfied hash.

Greetings
Marc

-- 
-----------------------------------------------------------------------------
Marc Haber         | "I don't trust Computers. They | Mailadresse im Header
Leimen, Germany    |  lose things."    Winona Ryder | Fon: *49 6224 1600402
Nordisch by Nature |  How to make an American Quilt | Fax: *49 6224 1600421

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/20160602135524.GL14027%40torres.zugschlus.de.
For more options, visit https://groups.google.com/d/optout.

Reply via email to