I have code like this: case "$operatingsystem" { "redhat": { include gu_splunk::redhat } "solaris": { include gu_splunk::solaris_old include gu_splunk::solaris } } In gu_splunk::solaris_old I have an Exec like this: exec { "download_pkgrm_adminfile": command => "wget -q -O /tmp/$pkgrm_adminfile http://... ", timeout => 60, creates => "/tmp/$pkgrm_adminfile", } Running puppet agent on a RedHat machine causes the Exec to execute and the file to get downloaded!! Why? Thanks a lot. Mohamed. -- 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+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Mohamed Lrhazi
2011-Apr-17 18:17 UTC
[Puppet Users] Re: Confused about conditional "include"
Oh... is it because I have this in my site.pp: stage { pre: before => Stage[main] } class { "gu_splunk::solaris_old": stage => pre } If so then whats the correct way of doing what I am trying to do? Thanks a lot, Mohamed. On Sun, Apr 17, 2011 at 2:15 PM, Mohamed Lrhazi <lrhazi@gmail.com> wrote:> I have code like this: > > case "$operatingsystem" { > "redhat": { > include gu_splunk::redhat > } > "solaris": { > include gu_splunk::solaris_old > include gu_splunk::solaris > } > } > > In gu_splunk::solaris_old I have an Exec like this: > > exec { "download_pkgrm_adminfile": > command => "wget -q -O /tmp/$pkgrm_adminfile http://... ", > timeout => 60, > creates => "/tmp/$pkgrm_adminfile", > } > > Running puppet agent on a RedHat machine causes the Exec to execute > and the file to get downloaded!! > > Why? > > Thanks a lot. > Mohamed. >-- 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+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Stefan Schulte
2011-Apr-17 19:40 UTC
Re: [Puppet Users] Re: Confused about conditional "include"
On Sun, Apr 17, 2011 at 02:17:59PM -0400, Mohamed Lrhazi wrote:> Oh... is it because I have this in my site.pp: > > stage { pre: before => Stage[main] } > class { "gu_splunk::solaris_old": stage => pre } > > > If so then whats the correct way of doing what I am trying to do? > > Thanks a lot, > Mohamed.remove the entry in site.pp. In your manifest replace the include: case "$operatingsystem" { "redhat": { include gu_splunk::redhat } "solaris": { class { "gu_splunk::solaris_old": stage => pre } include gu_splunk::solaris } } include can only be used when you don''t want to pass parameters. -Stefan
Hi, I''m pretty sure you need to remove the quotation marks from $operatinngsystem and from redhat and solaris case matches. Cheers, Den On 18/04/2011, at 4:15, Mohamed Lrhazi <lrhazi@gmail.com> wrote:> I have code like this: > > case "$operatingsystem" { > "redhat": { > include gu_splunk::redhat > } > "solaris": { > include gu_splunk::solaris_old > include gu_splunk::solaris > } > } > > In gu_splunk::solaris_old I have an Exec like this: > > exec { "download_pkgrm_adminfile": > command => "wget -q -O /tmp/$pkgrm_adminfile http://... ", > timeout => 60, > creates => "/tmp/$pkgrm_adminfile", > } > > Running puppet agent on a RedHat machine causes the Exec to execute > and the file to get downloaded!! > > Why? > > Thanks a lot. > Mohamed. > > -- > 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+unsubscribe@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+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Mohamed Lrhazi
2011-Apr-17 21:52 UTC
Re: [Puppet Users] Confused about conditional "include"
Thanks Stefan. That worked. Denmat, the quotes seem to work fine for both the fact name and the values. On Sun, Apr 17, 2011 at 5:04 PM, Denmat <tu2bgone@gmail.com> wrote:> Hi, > > I''m pretty sure you need to remove the quotation marks from $operatinngsystem and from redhat and solaris case matches. > > Cheers, > Den > > On 18/04/2011, at 4:15, Mohamed Lrhazi <lrhazi@gmail.com> wrote: > >> I have code like this: >> >> case "$operatingsystem" { >> "redhat": { >> include gu_splunk::redhat >> } >> "solaris": { >> include gu_splunk::solaris_old >> include gu_splunk::solaris >> } >> } >> >> In gu_splunk::solaris_old I have an Exec like this: >> >> exec { "download_pkgrm_adminfile": >> command => "wget -q -O /tmp/$pkgrm_adminfile http://... ", >> timeout => 60, >> creates => "/tmp/$pkgrm_adminfile", >> } >> >> Running puppet agent on a RedHat machine causes the Exec to execute >> and the file to get downloaded!! >> >> Why? >> >> Thanks a lot. >> Mohamed. >> >> -- >> 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+unsubscribe@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+unsubscribe@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+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.