Hi,

import is largely deprecated for most uses. I haven't really used it
after Puppet 0.25.

What I learned back then was that the parser would honor all import
statements it would find. I believe that the if statements cannot be
validated until after the parsing stage, so they won't hinder importing.

Instead of relying on import based construct, make sure all your
resources are organized in trees of classes, and that each platform only
*includes* its appropriate tree root.

HTH,
Felix

On 02/14/2013 07:17 AM, Евгений Верещагин wrote:
> I try include different .pp for my systems. site.pp like:
> 
> if $operatingsystem == 'debian' {
>   import '../my/os/linux/debian.pp'
> }
> elsif $operatingsystem == 'windows' {
>   import '../my/os/windows/windows.pp'
> }
> else {
>   import '../my/os/default/default.pp'
> }
> 
> and I try CASE:
> 
> case $operatingsystem {
>        redhat: { import '../my/os/linux/redhat.pp' }
>        centos: { import '../my/os/linux/centos.pp' }
>        windows: { import '../my/os/windows/windows.pp' } 
>        default: { import '../my/os/default/default.pp' }
> }
> 
> Why it didn't work? If I run puppet-agent, it read all pp-files and
> crash on windows-parameters on Linux or on linux-parameters on Windows.
> What I do incorrect?

-- 
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+unsubscr...@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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to