On Friday, October 12, 2012 9:51:22 AM UTC-5, guymatz
wrote:>
> Hi! Sorry if this has already been discussed . . .
>
> I have a requirement to disallow root logins on my UK servers, but allow
> them on my US servers. I have an sshd_config template and am hoping to use
> hiera to get a Yes/No depending on the country. However It seems that
> hiera is having a hard time dealing with Yes/No:
>
>
Try wrapping the Yes/No in single quotes, I''ve found that it makes a
difference with true/false, at least on hiera 0.30.
> [root@gmatzpupmaster hieradata] $ grep estate_root_perm 70-country/u*
> 70-country/uk.yaml:estate_root_perm: No
> 70-country/us.yaml:estate_root_perm: Yes
> [root@gmatzpupmaster hieradata] $ hiera estate_root_perm mserv_loc=uk
>
/opt/puppet/lib/ruby/gems/1.8/gems/hiera-puppet-0.3.0/lib/hiera/backend/puppet_backend.rb:41:in
> `lookup'': uninitialized constant
Hiera::Backend::Puppet_backend::Puppet
> (NameError)
> from
> /opt/puppet/lib/ruby/gems/1.8/gems/hiera-0.3.0/lib/hiera/backend.rb:160:in
> `lookup''
> from
> /opt/puppet/lib/ruby/gems/1.8/gems/hiera-0.3.0/lib/hiera/backend.rb:157:in
> `each''
> from
> /opt/puppet/lib/ruby/gems/1.8/gems/hiera-0.3.0/lib/hiera/backend.rb:157:in
> `lookup''
> from /opt/puppet/lib/ruby/gems/1.8/gems/hiera-0.3.0/lib/hiera.rb:59:in
> `lookup''
> from /opt/puppet/lib/ruby/gems/1.8/gems/hiera-0.3.0/bin/hiera:208
> from /opt/puppet/bin/hiera:19:in `load''
> from /opt/puppet/bin/hiera:19
> [root@gmatzpupmaster hieradata] $ hiera estate_root_perm mserv_loc=us
> true
>
> If I change the value to something else it works:
>
> [root@gmatzpupmaster hieradata] $ vi 70-country/u*
> 2 files to edit
> [root@gmatzpupmaster hieradata] $ grep estate_root_perm 70-country/u*
> 70-country/uk.yaml:estate_root_perm: ukukukuk
> 70-country/us.yaml:estate_root_perm: usususus
> [root@gmatzpupmaster hieradata] $ hiera estate_root_perm mserv_loc=uk
> ukukukuk
> [root@gmatzpupmaster hieradata] $ hiera estate_root_perm mserv_loc=us
> usususus
>
>
> Any thoughts?
>
> Thanks a lot,
> Guy
>
--
You received this message because you are subscribed to the Google Groups
"Puppet Users" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/puppet-users/-/dda0lXy3o3MJ.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to
puppet-users+unsubscribe@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/puppet-users?hl=en.