diff --git a/cookbooks/base/default.rb b/cookbooks/base/default.rb index 97ad48e..1704b7a 100644 --- a/cookbooks/base/default.rb +++ b/cookbooks/base/default.rb @@ -54,17 +54,18 @@ include_recipe './fortune.rb' # timezone configurations: include_recipe './timezone.rb' -# ntp configurations: -include_recipe './ntp.rb' - # kernel configurations: include_recipe './kernel.rb' # Install mc command: include_recipe './mc.rb' -# unnecessary configurations: +# recipes for Ubuntu 16.04 if node['platform_version'].to_f == 16.04 + # ntp configurations + include_recipe './ntp.rb' + + # misc recipe include_recipe './unnecessary.rb' end diff --git a/cookbooks/base/ntp.rb b/cookbooks/base/ntp.rb index aaf520d..be36310 100644 --- a/cookbooks/base/ntp.rb +++ b/cookbooks/base/ntp.rb @@ -1,18 +1,13 @@ -case run_command('grep VERSION_ID /etc/os-release | awk -F\" \'{print $2}\'').stdout.chomp -when "18.04" - # do nothing -else - package 'ntp' +package 'ntp' - remote_file '/etc/ntp.conf' do - owner 'root' - group 'root' - mode '644' +remote_file '/etc/ntp.conf' do + owner 'root' + group 'root' + mode '644' - notifies :restart, 'service[ntp]' - end - - service 'ntp' do - action :nothing - end + notifies :restart, 'service[ntp]' +end + +service 'ntp' do + action :nothing end