puppet-sudo icon indicating copy to clipboard operation
puppet-sudo copied to clipboard

Convert ERB templates to EPP

Open jay7x opened this issue 1 year ago • 3 comments

jay7x avatar Oct 21 '24 08:10 jay7x

Pls assign me to this :)

jay7x avatar Oct 21 '24 08:10 jay7x

Well.. it's harder than expected (as usual).. Main problem is epp() 2nd argument (parameters Hash).

We have 2 sets of templates here:

  1. /etc/sudoers templates with slightly different parameter sets ($wheel_config is not present in Debian templates). This is more-or-less easy.
  2. sudo::conf $template templates.. it's user-controlled, so I'm not sure how to deal with it. I'd personally not even introduce this parameter from the beginning, because it's Pandora box :) But as we have it open already, I guess, we need another $template_epp (or $epp_template) parameter.. and immediate next question is how user can pass the parameters there?

jay7x avatar Oct 21 '24 14:10 jay7x

Also sudo::defaults() function behaves differently when called from ERB vs EPP. When called from EPP it receives the Hash as it is instead of Array of Tuples. So, I guess, I'll rewrite it in Puppet DSL instead.

jay7x avatar Oct 21 '24 14:10 jay7x