vchepkov
07/15/2022, 4:12 PMclass ntp (
String $service_name,
) {
file { '/some/file':
content => epp("${module_name}/template.epp, {
service_name => $service_name,
)}
}
}
vchepkov
07/15/2022, 4:13 PMclass ntp (
String $service_name,
) {
file { '/some/file':
content => epp("${module_name}/template.epp, {
service_name => $service_name,
)}
}
}
Jason Grammenos
07/15/2022, 4:18 PMJason Grammenos
07/15/2022, 4:19 PMvchepkov
07/15/2022, 4:24 PM$manifest_variable = lookup('ntp::service_name')
.erb
<%= @manifest_variable %>
Jason Grammenos
07/15/2022, 4:24 PMJason Grammenos
07/15/2022, 4:26 PMJason Grammenos
07/15/2022, 4:27 PMDr Bunsen Honeydew
07/15/2022, 4:27 PMSkylar Thompson
07/15/2022, 4:30 PMlookup
boiler-plate to every class that uses the template, you could write a function that accepts whatever other parameters need to be in-scope for the template, does the lookup
, and then renders the template.natemccurdy
07/15/2022, 4:39 PMlookup()
in an ERB template, but I’m not going to recommend that.
IMO, your ERB templates should be dumb and as simple as possible, only taking inputs from a single place and scope (which ideally would be where the template()
function is called).
Adding another data lookup inside the template itself muddies the waters and makes things harder to troubleshoot and refactor.natemccurdy
07/15/2022, 4:39 PMlookup()
in an ERB template, but I’m not going to recommend that.
IMO, your ERB templates should be dumb and as simple as possible, only taking inputs from a single place and scope (which ideally would be where the template()
function is called).
Adding another data lookup inside the template itself muddies the waters and makes things harder to troubleshoot and refactor.jhoblitt
07/15/2022, 5:13 PMerror while loading shared libraries: libreadline.so.6: cannot open shared object file: No such file or directory
jhoblitt
07/15/2022, 5:14 PMerror while loading shared libraries: libreadline.so.6: cannot open shared object file: No such file or directory
jhoblitt
07/15/2022, 5:16 PMvchepkov
07/15/2022, 5:18 PMjhoblitt
07/15/2022, 5:18 PMSlackbot
07/15/2022, 7:11 PMromil surti
07/15/2022, 9:30 PMSlackbot
07/15/2022, 9:32 PMromil surti
07/15/2022, 10:15 PM<vm hostname>
Info: Using configured environment 'pre_prod'
Info: Retrieving pluginfacts
Info: Retrieving plugin
Info: Loading facts
Info: Caching catalog for <vm hostname>
Info: Applying configuration version '<config version>'
Notice: /Stage[main]/Profiles::Base::Linux::Sudo/Exec[chmod 0440 *]/returns: executed successfully (corrective)
Notice: Applied catalog in 4.43 seconds
Fri Jul 15 20:14:22 GMT 2022
ERROR [execute-4]: HHH000315: Exception executing batch [java.sql.BatchUpdateException: Duplicate entry 'a0750v2rapp0441-91c6d8c9-4071-4d86-b1f7-74554d416558' for key 'PRIMARY'], SQL: insert into resource_log (exit_status, system_user, timer, time_stamp, resource_name, run_id) values (?, ?, ?, ?, ?, ?)
ERROR [execute-4]: Duplicate entry 'a0750v2rapp0441-91c6d8c9-4071-4d86-b1f7-74554d416558' for key 'PRIMARY'
ERROR [execute-4]: javax.persistence.PersistenceException: org.hibernate.exception.ConstraintViolationException: could not execute batch
natemccurdy
07/15/2022, 10:20 PM--http_debug
to it, then see if that SQL error comes back?
e.g.
sudo puppet agent -t --http_debug
sameer
07/17/2022, 9:48 AMSlackbot
07/17/2022, 9:49 AMsameer
07/17/2022, 9:51 AMsameer
07/17/2022, 9:52 AMMoe
07/17/2022, 5:46 PMit is just display name
07/18/2022, 4:01 PMit is just display name
07/18/2022, 4:02 PMit is just display name
07/18/2022, 5:02 PM