[Puppet Users] Why IF-ELSE not work?

Евгений Верещагин
Thu, 14 Feb 2013 06:17:24 -0000

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?