----- Original Message -----
> From: "Tim Mooney" <tim.moo...@ndsu.edu>
> To: puppet-users@googlegroups.com
> Sent: Wednesday, May 2, 2012 10:39:08 PM
> Subject: Re: [Puppet Users] mixing source & content (templates) in 
> concat::fragment
> 
> In regard to: Re: [Puppet Users] mixing source & content (templates)
> in...:
> 
> >> All-
> >>
> >> We're using puppet 2.7.11.
> >>
> >> Our custom firewall module currently builds the RHEL
> >> /etc/sysconfig/iptables (and ip6tables) from multiple fragments
> >> using
> >> concat::fragment.
> >>
> >> The base part of the firewall is constructed like this:
> >>
> >> class firewall {
> >>    include concat::setup
> >>
> >>    $firewall_config  = '/etc/sysconfig/iptables'
> >>
> >>    concat::fragment { "firewall-base":
> >>      target => "$firewall_config",
> >>      source => [
> >>        "puppet:///modules/firewall/firewall-base.$fqdn",
> >>        "puppet:///modules/firewall/firewall-base"
> >>      ],
> >>      order => '01',
> >>    }
> >>
> >>    concat::fragment {"firewall-end":
> >>      target  => "$firewall_config",
> >>      content => "COMMIT\n",
> >>      order   => '99',
> >>    }
> >> }
> >>
> >>
> >> As you can see, we use source to look for a per-box custom
> >> firewall
> >> base first, and then fall back to a stock firewall-base file
> >> fragment.
> >>
> >> I want to modify this config so that the fall-back fragment comes
> >> from a template, rather than a file fragment.  The problem is that
> >> it
> >> appears I can't do this:
> >>
> >
> > the file type in puppet does not provide a way to do this, so
> > unfortunately
> > the concat cant do it either - since its just relying on the file
> > type
> 
> Thanks R.I. (and thanks for concat).  I guess I'll switch all of our
> host-specific base fragments to be a templates, even when there's no
> template code in them, and use
> 
>    concat::fragment { 'firewall-base':
>      target => $firewall_config,
>      content => [
>        template("firewall/firewall-base.${::fqdn}.erb"),
>        template('firewall/firewall-base'),
>      ],
>      order => '01',
>    }
> 

puppet does not support this either :)

what you'll get there is a concat of the 2 templates

-- 
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