Have you tried,

---
family: "prod"
cluster: "prod"
compresslogs: "true"


?



On Monday, 23 July 2012 05:15:02 UTC+2, Aaron Nichols wrote:
>
> All,
>    I have found very few references to this error so I'm guessing I must 
> be doing something wrong. I have just started using hiera and am trying to 
> use it in the simplest way possible, I have a class that looks like this:
>
> class app_users2($compresslogs = hiera('compresslogs')) {                 
>                                                                      
>
>       #Setup Cronjob for compressing app logs                             
>                                                                      
>       if $compresslogs == "true" {                                         
>                                                                     
>         file { "/etc/cron.daily/copyLogs.cron":                           
>                                                                      
>           mode => "750",                                                   
>                                                                     
>           ensure => present,                                               
>                                                                     
>           alias => "compresslogscron",                                     
>                                                                     
>           source => "puppet:///modules/app_users2/copyLogs.sh"             
>                                                                      
>         }                                                                 
>                                                                      
>       }                                                                   
>                                                                      
> }
>
> For the node I'm running this on, hiera returns 'true' for that value when 
> I test it out:
>
> $ hiera -c hiera.yaml compresslogs loc="sd" type="app" 
> true
>
> I am using the yaml hiera backend and the yaml file this is configured in 
> looks like this:
>
> ---
> family : prod
> cluster : prod
> compresslogs : true
>
> However, when I try to execute the manifests either on the host or test 
> them using cucumber-puppet I get the following error:
>
> err: Could not retrieve catalog from remote server: Error 400 on SERVER: 
> can't convert Symbol into String at 
> /etc/puppet/modules/app_users2/manifests/init.pp:2 on node xyz
>
> I have tried quoting, unquoting the data in the yaml file & in the 
> conditional in the class. I've tried calling hiera as a parameter to the 
> class, also just as part of the conditional ( if hiera('compresslogs') == 
> true ) etc. It appears that anytime I try to reference that value from 
> puppet it throws this error. 
>
> I have found a few references in IRC logs to others having this problem 
> but they all stated "Oh, I figured it out" without explaining how - so I'm 
> a bit stuck. 
>
> I am running the following hiera versions on the puppetmaster:
>
> hiera-puppet-1.0.0-0.1rc1.el5
> hiera-1.0.0-0.1rc3.el5
>
> And the puppetmaster is running puppet v. 2.7.6.-2. I also tried updating 
> the puppet version on my host running cucumber-puppet to 2.7.18 and it 
> continues to throw this error. 
>
> Any help would be greatly appreciated. 
>
> Thanks,
> Aaron
>

-- 
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/-/w_yzv9P9fZMJ.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.

Reply via email to