natemccurdy
08/04/2022, 9:46 PMtype()
function: https://puppet.com/docs/puppet/7/function.html#type
e.g.
$foo = ["bar"]
notify { 'what is it':
message => "foo is a ${type($foo)}",
}
Patrick Rynhart
08/04/2022, 9:47 PMnatemccurdy
08/04/2022, 9:47 PMtype()
function: https://puppet.com/docs/puppet/7/function.html#type
e.g.
$foo = ["bar"]
notify { 'what is it':
message => "foo is a ${type($foo)}",
}
Patrick Rynhart
08/04/2022, 9:54 PMPatrick Rynhart
08/04/2022, 9:55 PMNotice: The dumped variable is Struct[{'developmentb' => Struct[{'someattribute' => String, 'anotherattribute' => String}], 'developmentc' => Struct[{'someattribute' => String, 'anotherattribute' => String}]}]
natemccurdy
08/04/2022, 9:55 PMnatemccurdy
08/04/2022, 9:56 PMmessage => "The dumped variable is ${type($foo, 'generalized')}",
Patrick Rynhart
08/04/2022, 10:02 PMJoost
08/04/2022, 10:04 PMkenyon
08/04/2022, 10:23 PMgem install r10k
, or better, use the puppet-r10k module to install itBrian Schonecker
08/04/2022, 10:27 PMmod 'abrader-gms',
:git => '<https://github.com/bjvrielink/abrader-gms.git>',
:ref => 'fixup'
Brian Schonecker
08/04/2022, 10:27 PMmod 'abrader-gms',
:git => '<https://github.com/bjvrielink/abrader-gms.git>',
:ref => 'fixup'
Patrick Rynhart
08/04/2022, 10:31 PMPatrick Rynhart
08/04/2022, 10:31 PMprofile::stream_web::config:
muc:
- 'developmentb':
someattribute: 'here'
anotherattribute: 'here'
- 'developmentc':
someattribute: 'here'
anotherattribute: 'here'
natemccurdy
08/04/2022, 10:32 PMnatemccurdy
08/04/2022, 10:32 PM$profile::stream_web::config
would be a hash, to clarify.natemccurdy
08/04/2022, 10:33 PM$profile::stream_web::config
would be a hash, to clarify.Patrick Rynhart
08/04/2022, 10:33 PMPatrick Rynhart
08/04/2022, 10:33 PMnatemccurdy
08/04/2022, 10:33 PM$muc
is an array of hashes.Patrick Rynhart
08/04/2022, 10:33 PMPatrick Rynhart
08/04/2022, 10:33 PMPatrick Rynhart
08/04/2022, 10:34 PMnatemccurdy
08/04/2022, 10:35 PMprofile::stream_web::config:
muc:
- developmentb:
someattribute: 'here'
anotherattribute: 'here'
- developmentc:
someattribute: 'here'
anotherattribute: 'here'
Slackbot
08/04/2022, 10:38 PMPatrick Rynhart
08/04/2022, 10:43 PMPatrick Rynhart
08/04/2022, 10:44 PMPatrick Rynhart
08/04/2022, 10:44 PMclass profile::stream_web (
$config = [],
) {
$muc = $config['muc']
$muc.each |Hash $value| {
$d1 = $value['someattribute']
notify { "$d1": }
}
Patrick Rynhart
08/04/2022, 10:46 PMPatrick Rynhart
08/04/2022, 10:46 PMclass profile::stream_web (
$config = [],
) {
$muc = $config['muc']
$muc.each |Hash $value| {
notify {"$value":}
#$d1 = $value['someattribute']
#notify { "$d1": }
}