Another way to handle this is to have class-level logic: class something { if ( $operatingsystem == "windows" ) { include something::windows } if ( $operatingsystem == "redhat" ) { include something::redhat } }
Then put your resources in something::windows, something::redhat, etc. You may duplicate some code this way, but when the OS'es are very different you'll ultimately save coding time and increase readability by avoiding resource-level logic. On Mon, Nov 21, 2011 at 10:11 AM, Evan Hisey <ehi...@gmail.com> wrote: > On Sun, Nov 20, 2011 at 8:05 PM, Mohamed Lrhazi <lrh...@gmail.com> wrote: >> I stated tweaking my puppet modules and site.pp to support the new >> OS.. things like: >> >> if ( $operatingsystem == "windows" ) { >> Exec { path => >> "C:\\Windows\\system32;C:\\Windows;C:\\Windows\\System32\\Wbem;C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\;C:\\Ruby187\\bin" >> } >> } else { >> >> And now am thinking, would be better to just have an independent >> "environment" for all my Windows clients? what would be the draw backs >> of that? >> >> Thanks a lot, >> Mohamed. >> > > I use multiple environments for separating development and production > systems. The only really draw back I encounter is the need to make the > same change twice for certain things that are shared between both > environments. I ma sure there is wa way around that, but it has not > become enough of an issue to make me find it. > > evan > > -- > You received this message because you are subscribed to the Google Groups > "Puppet Users" group. > 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. > > -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. 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.