Ask Your Question
0

concat::fragment not inserting content in vhost

asked 2015-05-19 09:11:14 -0500

AntonioCS gravatar image

So I have a vhost config in my puppet manifest file

apache::vhost { 'site.dev':
    port => '80',
    docroot => '/home/vagrant/projects/Personal/php/site/public',
    serveradmin => 'admin@admin.dev',
    options => ['Indexes','FollowSymLinks','MultiViews'],
    setenv => ["APP_ENV dev"],
    override => ['All'],
}

Now I want to add these options

EnableSendfile Off
EnableMMAP Off

I googled and found that concat::fragment might just be what I need, so I tried the following:

concat::fragment { "site.dev-static":
      target  => '25-site.dev.conf',
      order   => '01',
      content => '
        EnableSendfile Off
        EnableMMAP Off
      ',
}

NOTE In the target I have also tried with the full path: /etc/apache2/sites-available/25-site.dev.conf (with same results)

When I do vagrant provision I get this:

-- snip --
==> acs_dev: Warning: Scope(Concat::Fragment[Listen 80]): The $ensure parameter to concat::fragment is deprecated and has no effect.
-- snip --

I assume this worked fine but when I go to the vhos file at /etc/apache2/sites-available/25-site.dev.conf the EnableSendfile and EnableMMAP are not there.

I am using version 2.0.0 of puppetlabs concat module.

What do I need to do to make this work??

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2015-05-19 18:11:32 -0500

GregLarkin gravatar image

Looking at the source code for the apache::vhost defined type (https://github.com/puppetlabs/puppetlabs-apache/blob/master/manifests/vhost.pp, the concat type is configured with numeric order.

I wonder if changing your order => '01' attribute to order => 5 would work better? I would expect the 01 to be converted to numeric, but perhaps the Ruby code that is assembling the fragments silently drops that one.

edit flag offensive delete link more

Comments

I found out that you can just add custom_fragment => '# Fragment content', in the vhost and add what you want :)

AntonioCS gravatar imageAntonioCS ( 2015-05-20 04:38:42 -0500 )edit

Ah, I missed that one! Glad that will work for you.

GregLarkin gravatar imageGregLarkin ( 2015-05-20 11:35:33 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2015-05-19 09:11:14 -0500

Seen: 412 times

Last updated: May 19 '15