On Wednesday, October 2, 2013 8:57:07 AM UTC-5, Dan
wrote:>
> Hi
>
> I''m just getting into hiera and have now configured it, my
attempts at
> migrating to hiera have been frustratingly hard as I''m not able to
get the
> write syntax. Can someone help me in converting the below from a class
> declaration to hiera?
>
Um, what?
Hiera is an external data access service. Puppet 3 leverages it to access
class parameter data for automated parameter value binding, and you can use
it as most of a data-driven external node classifier (ENC), but although it
may allow you to simplify class declarations, it does not replace them.
> Current declarations in my declare.pp file:
>
Whose purpose is what, exactly?
> class profile::web {
> class { ''nsswitch'':
> automount => ''files'',
> hosts => [''files'',''dns''],
> }
> }
>
That class definition should be in file
<module_path>/profile/manifests/web.pp.
> class { ''sudo'': }
> sudo::conf { ''web-users'':
> sudo_config_dir => ''/etc/sudoers.d/'',
> source => ''puppet:///files/web/web-users.conf'',
> }
>
>
Those declarations (and though the formatting obscures it, there are two)
probably belong inside a class or node definition.
I''m very unclear about what you are actually trying to accomplish, but
here''s one thing that may nudge you in the right direction. If you are
using hiera''s YAML back end, connected, say, only with a single data
file
common.yaml, and that file contains
---
nsswitch::automount: files
nsswitch::hosts:
- files
- dns
then you should be able to shorten your profile::web class definition to
just
class profile::web {
include nsswitch
# or class { ''nsswitch'': }
}
to achieve the same result that the current declaration does.
John
--
You received this message because you are subscribed to the Google Groups
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to puppet-users+unsubscribe@googlegroups.com.
To post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users.
For more options, visit https://groups.google.com/groups/opt_out.