[Pdns-users] CM (Chef) and automatic downloading of packages
damm
damm at livid.dk
Tue Jan 10 01:53:54 UTC 2017
Nick,
You could just use :create_if_missing like I do in my cookbook
https://github.com/damm/powerdns/blob/master/recipes/recursor.rb#L11-L14
Yes it's still in use.
On 1/5/17 2:22 AM, Nick Douma wrote:
> Hi,
>
> In December Bert tweeted the thing about the huge amount of packages
> downloaded by users.
>
> https://twitter.com/PowerDNS_Bert/status/810468178950320129
>
> It seems that my servers were responsible for at least part of the
> traffic. I'm using Chef 12 with the remote_file resource to
> automatically check if a new package is available, and if so, download
> and install it:
>
> ```
> remote_file "#{Chef::Config[:file_cache_path]}/#{pkg}" do
> source "#{package_base}/#{pkg}"
> action :create
> end
> ```
>
> Chef is by default configured to use ETag and Last-Modified headers to
> determine if a file needs to be downloaded based on the file that is
> already present on the system.
>
> The Last-Modified header mechanism doesn't seem to work properly. I
> wasn't able to determine if this is something on my end (Chef) or your
> end (nginx). Regardless, the following addition disables the
> Last-Modified checking and just uses the ETag:
>
> ```
> remote_file "#{Chef::Config[:file_cache_path]}/#{pkg}" do
> source "#{package_base}/#{pkg}"
> use_last_modified false
> action :create
> end
> ```
>
> This may be of use to other users of Chef and similar systems.
>
> Kind regards,
>
> Nick Douma
>
>
>
> _______________________________________________
> Pdns-users mailing list
> Pdns-users at mailman.powerdns.com
> https://mailman.powerdns.com/mailman/listinfo/pdns-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.powerdns.com/pipermail/pdns-users/attachments/20170109/44bb6bf7/attachment.html>
More information about the Pdns-users
mailing list