5 # Copyright:: 2010, OpenStreetMap Foundation.
6 # Copyright:: 2009, Opscode, Inc
8 # Licensed under the Apache License, Version 2.0 (the "License");
9 # you may not use this file except in compliance with the License.
10 # You may obtain a copy of the License at
12 # https://www.apache.org/licenses/LICENSE-2.0
14 # Unless required by applicable law or agreed to in writing, software
15 # distributed under the License is distributed on an "AS IS" BASIS,
16 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 # See the License for the specific language governing permissions and
18 # limitations under the License.
20 include_recipe "prometheus"
27 execute "dpkg-reconfigure-tzdata" do
29 command "/usr/sbin/dpkg-reconfigure -f noninteractive tzdata"
34 link "/etc/localtime" do
35 to "/usr/share/zoneinfo/#{node[:ntp][:tz]}"
38 notifies :run, "execute[dpkg-reconfigure-tzdata]", :immediately
41 template "/etc/chrony/chrony.conf" do
42 source "chrony.conf.erb"
46 notifies :restart, "service[chrony]"
49 service "systemd-timesyncd" do
50 action [:stop, :disable]
53 systemd_service "chrony-restart" do
57 notifies :restart, "service[chrony]"
61 action [:enable, :start]
64 prometheus_exporter "chrony" do
68 # chrony occasionally marks all servers offline during a network outage.
69 # force online all sources during a chef run
70 execute "chronyc-online" do
71 command "/usr/bin/chronyc online"