_ntp.rb 376 B

123456789101112131415
  1. #
  2. # Cookbook:: gateway
  3. # Recipe:: _ntp
  4. #
  5. # Copyright:: 2022, The Authors, All Rights Reserved.
  6. package 'systemd-timesyncd'
  7. execute 'timedatectl set-ntp true' do
  8. only_if '[ "$(timedatectl show --value --property=NTP)" == "no" ]'
  9. end
  10. execute 'timedatectl set-timezone Europe/Paris' do
  11. not_if '[ "$(readlink -f /etc/localtime)" = "/usr/share/zoneinfo/Europe/Paris" ]'
  12. end