Puppet Module Hash as Foreman Parameter?

Greetings again, apologies for becoming such an active questioner on this
list…

I'm looking to use an openssh puppet module, with which I've developed a
simple hash in my ERB template for the sshd_config file. Basically for
each of the platforms, I take their default config file and add this ERB
snippet and make it a template:

Values managed by puppet…

<% options.each do |key, value| -%>
<%= key %> <%= value %>
<% end -%>

The idea, when I used puppet without an ENC, was that openssh_options = {
param1 => value, param2 => value, param3 => value, etc. } for each host I
had defined in the puppet nodes manifest.

It would seem that with Foreman the Ruby Hash becomes a string if I try and
specify it as a parameter for a host group, or host. If I look at the
puppet class within Foreman the Smart Class Parameter "options" is typed as
a string. If I attempt to override that type as a Hash, and click submit,
the values don't change. As a result all I've been able to do to use this
Hash is to specify it globally in site.pp.

Any ideas on what I'm doing wrong or whether this is a bug?

P.S. I'm running Puppet 3.1.1 and Foreman 1.1.

Thanks.

This thread might be of use to you.

https://groups.google.com/d/msg/foreman-users/ntubzQSzRio/iQnhdQLxM14J

··· On Thursday, May 30, 2013 4:16:19 PM UTC-4, Sean Alderman wrote: > > Greetings again, apologies for becoming such an active questioner on this > list... > > I'm looking to use an openssh puppet module, with which I've developed a > simple hash in my ERB template for the sshd_config file. Basically for > each of the platforms, I take their default config file and add this ERB > snippet and make it a template: > > # Values managed by puppet... > <% options.each do |key, value| -%> > <%= key %> <%= value %> > <% end -%> > > The idea, when I used puppet without an ENC, was that openssh_options = { > param1 => value, param2 => value, param3 => value, etc. } for each host I > had defined in the puppet nodes manifest. > > It would seem that with Foreman the Ruby Hash becomes a string if I try > and specify it as a parameter for a host group, or host. If I look at the > puppet class within Foreman the Smart Class Parameter "options" is typed as > a string. If I attempt to override that type as a Hash, and click submit, > the values don't change. As a result all I've been able to do to use this > Hash is to specify it globally in site.pp. > > Any ideas on what I'm doing wrong or whether this is a bug? > > P.S. I'm running Puppet 3.1.1 and Foreman 1.1. > > Thanks. > >

Andy,
Thanks for the response. So it would appear I can convert a string to a
hash in the ERB template…

I'll have to figure out how store the hash as a string in the Foreman
Parameter.

··· -- Sean M. Alderman Senior Engineer, UDit Systems Integration and Engineering University of Dayton

On Tue, Jun 4, 2013 at 3:01 PM, Andy Bohne andy.bohne@gmail.com wrote:

This thread might be of use to you.

https://groups.google.com/d/msg/foreman-users/ntubzQSzRio/iQnhdQLxM14J

On Thursday, May 30, 2013 4:16:19 PM UTC-4, Sean Alderman wrote:

Greetings again, apologies for becoming such an active questioner on this
list…

I’m looking to use an openssh puppet module, with which I’ve developed a
simple hash in my ERB template for the sshd_config file. Basically for
each of the platforms, I take their default config file and add this ERB
snippet and make it a template:

Values managed by puppet…

<% options.each do |key, value| -%>
<%= key %> <%= value %>
<% end -%>

The idea, when I used puppet without an ENC, was that openssh_options = {
param1 => value, param2 => value, param3 => value, etc. } for each host I
had defined in the puppet nodes manifest.

It would seem that with Foreman the Ruby Hash becomes a string if I try
and specify it as a parameter for a host group, or host. If I look at the
puppet class within Foreman the Smart Class Parameter “options” is typed as
a string. If I attempt to override that type as a Hash, and click submit,
the values don’t change. As a result all I’ve been able to do to use this
Hash is to specify it globally in site.pp.

Any ideas on what I’m doing wrong or whether this is a bug?

P.S. I’m running Puppet 3.1.1 and Foreman 1.1.

Thanks.


You received this message because you are subscribed to the Google Groups
"Foreman users" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to foreman-users+unsubscribe@googlegroups.com.
To post to this group, send email to foreman-users@googlegroups.com.
Visit this group at http://groups.google.com/group/foreman-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.

Hello,

I had to do this with the puppetlabs mysql module v1.0.0<https://github.com/puppetlabs/puppetlabs-mysql/tree/1.0.0>because it uses a hash as a parameter. I put the line below into the
Default Value area for the mysql::server config_hash parameter.

root_password: foo

I am assuming that for more parameters you just add another line. Hope this
helps.

Cheers!
Brandon Bradley

··· On Wednesday, June 5, 2013 3:31:43 PM UTC-5, Sean Alderman wrote: > > Andy, > Thanks for the response. So it would appear I can convert a string to a > hash in the ERB template... > > I'll have to figure out how store the hash as a string in the Foreman > Parameter. > > > -- > Sean M. Alderman > Senior Engineer, UDit Systems Integration and Engineering > University of Dayton > > > On Tue, Jun 4, 2013 at 3:01 PM, Andy Bohne <andy....@gmail.com > > wrote: > >> This thread might be of use to you. >> >> https://groups.google.com/d/msg/foreman-users/ntubzQSzRio/iQnhdQLxM14J >> >> >> On Thursday, May 30, 2013 4:16:19 PM UTC-4, Sean Alderman wrote: >>> >>> Greetings again, apologies for becoming such an active questioner on >>> this list... >>> >>> I'm looking to use an openssh puppet module, with which I've developed a >>> simple hash in my ERB template for the sshd_config file. Basically for >>> each of the platforms, I take their default config file and add this ERB >>> snippet and make it a template: >>> >>> # Values managed by puppet... >>> <% options.each do |key, value| -%> >>> <%= key %> <%= value %> >>> <% end -%> >>> >>> The idea, when I used puppet without an ENC, was that openssh_options = >>> { param1 => value, param2 => value, param3 => value, etc. } for each host I >>> had defined in the puppet nodes manifest. >>> >>> It would seem that with Foreman the Ruby Hash becomes a string if I try >>> and specify it as a parameter for a host group, or host. If I look at the >>> puppet class within Foreman the Smart Class Parameter "options" is typed as >>> a string. If I attempt to override that type as a Hash, and click submit, >>> the values don't change. As a result all I've been able to do to use this >>> Hash is to specify it globally in site.pp. >>> >>> Any ideas on what I'm doing wrong or whether this is a bug? >>> >>> P.S. I'm running Puppet 3.1.1 and Foreman 1.1. >>> >>> Thanks. >>> >>> -- >> You received this message because you are subscribed to the Google Groups >> "Foreman users" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to foreman-user...@googlegroups.com . >> To post to this group, send email to forema...@googlegroups.com >> . >> Visit this group at http://groups.google.com/group/foreman-users?hl=en. >> For more options, visit https://groups.google.com/groups/opt_out. >> >> >> > >