Skip to content

Instantly share code, notes, and snippets.

@garlandkr
Last active December 14, 2015 00:49
Show Gist options
  • Save garlandkr/5001603 to your computer and use it in GitHub Desktop.
Save garlandkr/5001603 to your computer and use it in GitHub Desktop.
puppet template
daemon_opts=(-a -w "$logfile" -D -F "{ \"remote_addr\": \"%h\",
\"remote_user\": \"%u\",
\"x_forwarded_for\": \"%{X-Forwarded-For}i\",
\"hit_miss\": \"%{Varnish:hitmiss}x\",
\"body_bytes_sent\": \"%b\",
\"request_time\": \"%{Varnish:time_firstbyte}x\",
\"status\": \"%s\",
\"request\": \"%r\",\"host\": \"%{host}i\",
\"request_method\": \"%m\",
\"time_first_byte\": \"%{Varnish:time_firstbyte}x\",
\"handling\": \"%{Varnish:handling}x\",
\"http_referrer\": \"%{Referrer}i\",
\"http_user_agent\": \"%{User-agent}i\"}\"")
@garlandkr
Copy link
Author

This is the exact text as it should be in /etc/init.d/varnishncsa

puppet needs Hiera 1.0.x or newer to properly interpret %{}

The work around is to put all instances of %{} directly into the template file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment