X-Git-Url: https://git.openstreetmap.org/chef.git/blobdiff_plain/76204c98eefa4940f9cc1e7a101d0c782e6a0508..f6b63c0bdcfde35f28573ea4a3444daff2c1fe80:/cookbooks/hardware/recipes/default.rb diff --git a/cookbooks/hardware/recipes/default.rb b/cookbooks/hardware/recipes/default.rb index 8f08db8f1..5cbb13eb0 100644 --- a/cookbooks/hardware/recipes/default.rb +++ b/cookbooks/hardware/recipes/default.rb @@ -52,7 +52,7 @@ end units = [] -if node[:roles].include?("bytemark") +if node[:roles].include?("bytemark") || node[:roles].include?("exonetric") units << "0" end @@ -67,7 +67,7 @@ when "TYAN Computer Corporation" units << "0" when "Supermicro" case product - when "H8DGU", "X9SCD", "X7DBU", "X7DW3", "X9DR7/E-(J)LN4F", "X9DR3-F", "X9DRW" + when "H8DGU", "X9SCD", "X7DBU", "X7DW3", "X9DR7/E-(J)LN4F", "X9DR3-F", "X9DRW", "SYS-2028U-TN24R4T+" units << "1" else units << "0" @@ -77,23 +77,29 @@ when "IBM" end units.sort.uniq.each do |unit| - file "/etc/init/ttySttyS#{unit}.conf" do - action :delete - end + if node[:lsb][:release].to_f >= 16.04 + service "serial-getty@ttyS#{unit}" do + action [:enable, :start] + end + else + file "/etc/init/ttySttyS#{unit}.conf" do + action :delete + end - template "/etc/init/ttyS#{unit}.conf" do - source "tty.conf.erb" - owner "root" - group "root" - mode 0644 - variables :unit => unit - end + template "/etc/init/ttyS#{unit}.conf" do + source "tty.conf.erb" + owner "root" + group "root" + mode 0644 + variables :unit => unit + end - service "ttyS#{unit}" do - provider Chef::Provider::Service::Upstart - action [:enable, :start] - supports :status => true, :restart => true, :reload => false - subscribes :restart, "template[/etc/init/ttyS#{unit}.conf]" + service "ttyS#{unit}" do + provider Chef::Provider::Service::Upstart + action [:enable, :start] + supports :status => true, :restart => true, :reload => false + subscribes :restart, "template[/etc/init/ttyS#{unit}.conf]" + end end end