I am now in a quandary as I cannot put plain text password in params.pp and
overriding just the password field in Foreman causes edits in 2 places for
new hosts that are added in params.pp. I want to avoid this. How can I,
with native Foreman smart var stuff, encrypt this password?
Or what would be a better way to do this while avoiding edits in 2 places:
params.pp and foreman UI.
Also, I am trying to prevent overriding all from foreman UI as there are
several parameters
and it is much easier to specify them in params.pp
>
> Hi Folks:
>
> I have several parameters (30+) defined in params.pp as such
>
> class testclass::params {
>
> case $::hostname {
>
> /ABhostXY/: {
>
> $testvar1 = "0"
> $passwd = "passwordtest"
> …
> …
>
> }
>
> }
>
> I am now in a quandary as I cannot put plain text password in params.pp
and overriding just the password field in Foreman causes edits in 2 places
for new hosts that are added in params.pp. I want to avoid this. How can I,
with native Foreman smart var stuff, encrypt this password?
>
> Or what would be a better way to do this while avoiding edits in 2
places: params.pp and foreman UI.
>
> Also, I am trying to prevent overriding all from foreman UI as there are
several parameters and it is much easier to specify them in params.pp
It's only the case statement that is causing you 2 edits. I use a pattern
like this:
class mymodule::myclass (
$passwd = 'notarealpassword'
) {
…
}
Foreman is quite capable of supplying this $passwd string based on any
matchers you like using the Smart Class Parameters matchers. So for
example, I might have: