Try:

<% if includernw == 1 %> include "/etc/dhcp/dhcpd.rnw";<% end %>

Note the '==' :-).

ken.

On Wed, Jul 6, 2011 at 2:45 PM, Jonathan Gazeley
<jonathan.gaze...@bristol.ac.uk> wrote:
> I have a puppet class called dhcp which sets up the daemon and installs a
> base dhcpd.conf.
>
> I have also have subclasses like dhcp::pool1, dhcp::pool2 which install
> other files with DHCP code snippets to provide DHCP to different subnets
> with different address pools. The manifest for these looks like this:
>
> class dhcp::rnw {
>        include dhcp2::common
>        $includernw = '1'
>        file { "dhcpd.rnw":
>                name => "/etc/dhcp/dhcpd.rnw",
>                mode => 644,
>                owner => "root",
>                group => "root",
>                notify => Service[dhcpd],
>                source => "puppet:///modules/dhcp/dhcpd.rnw",
>        }
>
>
> In the ERB template for the base dhcpd.conf, I have lines like this:
>
> <% if includernw = 1 %> include "/etc/dhcp/dhcpd.rnw";<% end %>
>
> For some reason, the include lines always get included, even if the subclass
> hasn't been applied and therefore the $includernw hasn't been set.
>
> Am I missing something with the way variables are set and assigned, or read
> in ERB?
>
> Thanks,
> Jonathan
>
> --
> 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.

Reply via email to