Slackbot
12/14/2022, 9:24 AMKonstantin
12/14/2022, 9:30 AM$total_construction = {}
if ($specific_configs != nil) {
$specific_configs.each |$specific_config| {
notify {"Specific config is ${specific_config} and total_construction is ${total_construction}":}
$parameter = split($specific_config, "=")[0]
$value = split($specific_config, "=")[1]
$temp_construction = {$parameter => $value}
$total_construction = $total_construction + $temp_construction
notify {"parameter ${parameter} and value ${value} and total_construction ${total_construction}" :}
}
}
Server call module and set
specific_configs => ['hls_specific_location_num=2','dash_specific_location_num=2']
When code executes in logs i see this
Notice: /Stage[main]/Nginx_front/Notify[Specific config is hls_specific_location_num=2 and total_construction is {}]/message: current_value 'absent', should be 'Specific config is hls_specific_location_num=2 and total_construction is {}' (noop)
Notice: /Stage[main]/Nginx_front/Notify[parameter hls_specific_location_num and value 2 and total_construction {hls_specific_location_num => 2}]/message: current_value 'absent', should be 'parameter hls_specific_location_num and value 2 and total_construction {hls_specific_location_num => 2}' (noop)
Notice: /Stage[main]/Nginx_front/Notify[Specific config is dash_specific_location_num=2 and total_construction is {}]/message: current_value 'absent', should be 'Specific config is dash_specific_location_num=2 and total_construction is {}' (noop)
Notice: /Stage[main]/Nginx_front/Notify[parameter dash_specific_location_num and value 2 and total_construction {dash_specific_location_num => 2}]/message: current_value 'absent', should be 'parameter dash_specific_location_num and value 2 and total_construction {dash_specific_location_num => 2}' (noop)
Why i see that both times total_construction is {}, but it must be added with $temp_construction
The task i solving ist that i want to prepare hash to include it in epp:
intead of this
file { "${root_service}/${service_folder}/conf.d/${external_config}":
content => epp("${external_module_name}/${service_folder}/conf.d/${external_config}",
{'hls_specific_location_num' => "${hls_specific_location_num}",
'dash_specific_location_num' => "${dash_specific_location_num}",
}),
i want to prepare something like that
file { "${root_service}/${service_folder}/conf.d/${external_config}":
content => epp("${external_module_name}/${service_folder}/conf.d/${external_config}",
$total_construction),Konstantin
12/14/2022, 9:30 AM$total_construction = {}
if ($specific_configs != nil) {
$specific_configs.each |$specific_config| {
notify {"Specific config is ${specific_config} and total_construction is ${total_construction}":}
$parameter = split($specific_config, "=")[0]
$value = split($specific_config, "=")[1]
$temp_construction = {$parameter => $value}
$total_construction = $total_construction + $temp_construction
notify {"parameter ${parameter} and value ${value} and total_construction ${total_construction}" :}
}
}
Another module on node call this module and set
specific_configs => ['hls_specific_location_num=2','dash_specific_location_num=2']
When code executes in logs i see this
Notice: /Stage[main]/Nginx_front/Notify[Specific config is hls_specific_location_num=2 and total_construction is {}]/message: current_value 'absent', should be 'Specific config is hls_specific_location_num=2 and total_construction is {}' (noop)
Notice: /Stage[main]/Nginx_front/Notify[parameter hls_specific_location_num and value 2 and total_construction {hls_specific_location_num => 2}]/message: current_value 'absent', should be 'parameter hls_specific_location_num and value 2 and total_construction {hls_specific_location_num => 2}' (noop)
Notice: /Stage[main]/Nginx_front/Notify[Specific config is dash_specific_location_num=2 and total_construction is {}]/message: current_value 'absent', should be 'Specific config is dash_specific_location_num=2 and total_construction is {}' (noop)
Notice: /Stage[main]/Nginx_front/Notify[parameter dash_specific_location_num and value 2 and total_construction {dash_specific_location_num => 2}]/message: current_value 'absent', should be 'parameter dash_specific_location_num and value 2 and total_construction {dash_specific_location_num => 2}' (noop)
Why i see that both times total_construction is {}, but it must be added with $temp_construction
The task i solving ist that i want to prepare hash to include it in epp:
intead of this
file { "${root_service}/${service_folder}/conf.d/${external_config}":
content => epp("${external_module_name}/${service_folder}/conf.d/${external_config}",
{'hls_specific_location_num' => "${hls_specific_location_num}",
'dash_specific_location_num' => "${dash_specific_location_num}",
}),
i want to prepare something like that
file { "${root_service}/${service_folder}/conf.d/${external_config}":
content => epp("${external_module_name}/${service_folder}/conf.d/${external_config}",
$total_construction),Konstantin
12/14/2022, 9:31 AM$total_construction = {}
if ($specific_configs != nil) {
$specific_configs.each |$specific_config| {
notify {"Specific config is ${specific_config} and total_construction is ${total_construction}":}
$parameter = split($specific_config, "=")[0]
$value = split($specific_config, "=")[1]
$temp_construction = {$parameter => $value}
$total_construction = $total_construction + $temp_construction
notify {"parameter ${parameter} and value ${value} and total_construction ${total_construction}" :}
}
}
Another module on node call this module and set
specific_configs => ['hls_specific_location_num=2','dash_specific_location_num=2']
When code executes in logs i see this
Notice: /Stage[main]/Nginx_front/Notify[Specific config is hls_specific_location_num=2 and total_construction is {}]/message: current_value 'absent', should be 'Specific config is hls_specific_location_num=2 and total_construction is {}' (noop)
Notice: /Stage[main]/Nginx_front/Notify[parameter hls_specific_location_num and value 2 and total_construction {hls_specific_location_num => 2}]/message: current_value 'absent', should be 'parameter hls_specific_location_num and value 2 and total_construction {hls_specific_location_num => 2}' (noop)
Notice: /Stage[main]/Nginx_front/Notify[Specific config is dash_specific_location_num=2 and total_construction is {}]/message: current_value 'absent', should be 'Specific config is dash_specific_location_num=2 and total_construction is {}' (noop)
Notice: /Stage[main]/Nginx_front/Notify[parameter dash_specific_location_num and value 2 and total_construction {dash_specific_location_num => 2}]/message: current_value 'absent', should be 'parameter dash_specific_location_num and value 2 and total_construction {dash_specific_location_num => 2}' (noop)
Why i see that both times total_construction is {}, but i initialized it once and it must be added with $temp_construction
The task i solving ist that i want to prepare hash to include it in epp:
intead of this
file { "${root_service}/${service_folder}/conf.d/${external_config}":
content => epp("${external_module_name}/${service_folder}/conf.d/${external_config}",
{'hls_specific_location_num' => "${hls_specific_location_num}",
'dash_specific_location_num' => "${dash_specific_location_num}",
}),
i want to prepare something like that
file { "${root_service}/${service_folder}/conf.d/${external_config}":
content => epp("${external_module_name}/${service_folder}/conf.d/${external_config}",
$total_construction),Konstantin
12/14/2022, 9:31 AM$total_construction = {}
if ($specific_configs != nil) {
$specific_configs.each |$specific_config| {
notify {"Specific config is ${specific_config} and total_construction is ${total_construction}":}
$parameter = split($specific_config, "=")[0]
$value = split($specific_config, "=")[1]
$temp_construction = {$parameter => $value}
$total_construction = $total_construction + $temp_construction
notify {"parameter ${parameter} and value ${value} and total_construction ${total_construction}" :}
}
}
Another module on node call this module and set
specific_configs => ['hls_specific_location_num=2','dash_specific_location_num=2']
When code executes in logs i see this
Notice: /Stage[main]/Nginx_front/Notify[Specific config is hls_specific_location_num=2 and total_construction is {}]/message: current_value 'absent', should be 'Specific config is hls_specific_location_num=2 and total_construction is {}' (noop)
Notice: /Stage[main]/Nginx_front/Notify[parameter hls_specific_location_num and value 2 and total_construction {hls_specific_location_num => 2}]/message: current_value 'absent', should be 'parameter hls_specific_location_num and value 2 and total_construction {hls_specific_location_num => 2}' (noop)
Notice: /Stage[main]/Nginx_front/Notify[Specific config is dash_specific_location_num=2 and total_construction is {}]/message: current_value 'absent', should be 'Specific config is dash_specific_location_num=2 and total_construction is {}' (noop)
Notice: /Stage[main]/Nginx_front/Notify[parameter dash_specific_location_num and value 2 and total_construction {dash_specific_location_num => 2}]/message: current_value 'absent', should be 'parameter dash_specific_location_num and value 2 and total_construction {dash_specific_location_num => 2}' (noop)
Why i see that both times total_construction is {}, but i initialized it once and it must be added with $temp_construction on first iteration
The task i solving ist that i want to prepare hash to include it in epp:
intead of this
file { "${root_service}/${service_folder}/conf.d/${external_config}":
content => epp("${external_module_name}/${service_folder}/conf.d/${external_config}",
{'hls_specific_location_num' => "${hls_specific_location_num}",
'dash_specific_location_num' => "${dash_specific_location_num}",
}),
i want to prepare something like that
file { "${root_service}/${service_folder}/conf.d/${external_config}":
content => epp("${external_module_name}/${service_folder}/conf.d/${external_config}",
$total_construction),Slackbot
12/14/2022, 10:26 PMQuentin RATAUD
12/15/2022, 2:09 PMQuentin RATAUD
12/15/2022, 2:10 PMbastelfreak
12/15/2022, 2:10 PMSlackbot
12/15/2022, 2:11 PMQuentin RATAUD
12/15/2022, 2:13 PMQuentin RATAUD
12/15/2022, 2:15 PMQuentin RATAUD
12/15/2022, 2:34 PMSlackbot
12/15/2022, 4:04 PMvStone
12/15/2022, 4:04 PMbastelfreak
12/15/2022, 4:09 PMSlackbot
12/15/2022, 5:26 PMnatemccurdy
12/15/2022, 5:31 PMnatemccurdy
12/15/2022, 5:31 PMdsc_virtualmemory.Slackbot
12/15/2022, 6:09 PMnatemccurdy
12/15/2022, 6:46 PMnatemccurdy
12/15/2022, 6:46 PMnatemccurdy
12/15/2022, 6:49 PMtemplate() function has to copy the entire scope into the template, which is super wasteful and balloons memory usage. EPP solves that by having an explicit context that you must pass data into.
2) It's raw Ruby, which is sometimes useful but also means you're able to shoot yourself in the foot very easily.natemccurdy
12/15/2022, 6:50 PMtemplate() function has to copy the entire scope into the template (all variables, facts, etc...), which is super wasteful and balloons memory usage. EPP solves that by having an explicit context that you must pass data into.
2) It's raw Ruby, which is sometimes useful but also means you're able to shoot yourself in the foot very easily.natemccurdy
12/15/2022, 7:13 PMSlackbot
12/15/2022, 7:48 PMCorey Hickey
12/15/2022, 7:56 PMnatemccurdy
12/15/2022, 8:40 PMDr Bunsen Honeydew
12/15/2022, 9:45 PMSlackbot
12/15/2022, 10:40 PM