I fixed the problem by restarting puppetmaster and all dynamic facter 
variables are parsed properly. Thanks a lot to people who respond my 
question during Christmas. Now I need to explain to my wife where I am 
 during Christmas:-)

Cheers,

carl

On Monday, December 24, 2012 10:31:18 PM UTC-5, roadtest wrote:
>
> Hello, 
>
> I follow http://puppetlabs.com/blog/first-look-installing-and-using-hiera/to  
> try hiera on my 3.0.1 puppet master.  I follow the instruction except 
> my environment is ubuntu.  Here is my /etc/hiera.yaml
> ---
> :hierarchy:
>   - %{operatingsystem}
>   - common
> :backends:
>   - yaml
>
> :yaml:
>   :datadir: '/var/lib/hiera'
>
> Here is my backends
> $more /var/lib/hiera/Ubuntu.yaml
> ---
> ssh_packages : - 'openssh-server'
>
> Here is section of ssh class 
> $more /etc/puppet/modules/ssh/manifests/init.pp
> class ssh {
>   #  $ssh_packages      = ['openssh','openssh-clients','openssh-server']
>   #   $ssh_packages      = ['openssh-server']
>   #  $permit_root_login = 'no'
>   #$ssh_users         = ['root','jeff','gary','hunter']
>   *$ssh_packages = hiera('ssh_packages')*
>   $permit_root_login = hiera('permit_root_login')
>   $ssh_users         = hiera('ssh_users')
>
>   package { $ssh_packages:
>     ensure => present,
>     before => File['/etc/ssh/sshd_config'],
>   }
> file { '/etc/ssh/sshd_config':
>     ensure  => present,
>     owner   => 'root',
>     group   => 'root',
>     mode    => '0644',
>     # Template uses $permit_root_login and $ssh_users
>     content => template('ssh/sshd_config.erb'),
>   }
>
>   service { 'sshd':
>     ensure     => running,
>     enable     => true,
>     hasstatus  => true,
>     hasrestart => true,
>   }
> }
>
> when  my ubuntu client is trying to pull the catalog, it has following 
> errors.
> Dec 24 22:17:07 vm2 puppet-agent[18103]: Could not retrieve catalog from 
> remote server: Error 400 on SERVER: Could not find data item ssh_packages 
> in any Hiera data file and no default supplied at 
> /etc/puppet/modules/ssh/manifests/init.pp:6 on node vm2
>
> It appears to me that %{operatingsystem} in hiera.yaml is invalid and 
> ssh_packages can't be properly assigned even it is valid on the client 
> machine.
> vm2# facter | grep operatingsystem
> operatingsystem => Ubuntu
> operatingsystemrelease => 12.04
>
> I can't figure out what wrong with my configuration. Thanks for any 
> suggestions!
>
> carl
>
>
>

-- 
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/-/jIR-Ii7ZP7IJ.
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