From a5356e1286dff8f4ad228a411e2efe3bd6114cc0 Mon Sep 17 00:00:00 2001 From: Peter Palfrader Date: Fri, 18 Aug 2017 14:52:35 +0200 Subject: [PATCH] split grub and kernel serial --- modules/grub/manifests/init.pp | 17 +++++++++++++---- .../grub/templates/puppet-grub-serial.cfg.erb | 6 ------ .../grub/templates/puppet-kernel-serial.cfg.erb | 5 +++++ 3 files changed, 18 insertions(+), 10 deletions(-) create mode 100644 modules/grub/templates/puppet-kernel-serial.cfg.erb diff --git a/modules/grub/manifests/init.pp b/modules/grub/manifests/init.pp index 05d6f1f23..f5e21c41e 100644 --- a/modules/grub/manifests/init.pp +++ b/modules/grub/manifests/init.pp @@ -1,15 +1,18 @@ class grub { if ($::kernel == 'Linux' and $::is_virtual and $::virtual == 'kvm') { $grub_manage = true - $grub_do_serial = true + $grub_do_kernel_serial = true + $grub_do_grub_serial = true $grub_do_ifnames = true } elsif $::hostname in [ubc-enc2bl01,ubc-enc2bl02,ubc-enc2bl09,ubc-enc2bl10,casulana,mirror-anu,sallinen,storace,mirror-skroutz] { $grub_manage = true - $grub_do_serial = true + $grub_do_kernel_serial = true + $grub_do_grub_serial = true $grub_do_nopat = true } elsif $::hostname in [mirror-accumu] { $grub_manage = true - $grub_do_serial = true + $grub_do_kernel_serial = true + $grub_do_grub_serial = true $grub_do_nopat = true } else { $grub_manage = false @@ -28,11 +31,17 @@ class grub { } file { '/etc/default/grub.d/puppet-grub-serial.cfg': - ensure => $grub_do_serial ? { true => 'present', default => 'absent' }, + ensure => $grub_do_kernel_serial ? { true => 'present', default => 'absent' }, content => template('grub/puppet-grub-serial.cfg.erb'), notify => Exec['update-grub'] } + file { '/etc/default/grub.d/puppet-kernel-serial.cfg': + ensure => $grub_do_grub_serial ? { true => 'present', default => 'absent' }, + content => template('grub/puppet-kernel-serial.cfg.erb'), + notify => Exec['update-grub'] + } + file { '/etc/default/grub.d/puppet-net-ifnames.cfg': ensure => $grub_do_ifnames ? { true => 'present', default => 'absent' }, content => template('grub/puppet-net-ifnames.cfg.erb'), diff --git a/modules/grub/templates/puppet-grub-serial.cfg.erb b/modules/grub/templates/puppet-grub-serial.cfg.erb index 42597a9d7..dd1f8022e 100644 --- a/modules/grub/templates/puppet-grub-serial.cfg.erb +++ b/modules/grub/templates/puppet-grub-serial.cfg.erb @@ -1,8 +1,2 @@ -<%- if scope.lookupvar('::debarchitecture') == "arm64" -%> -GRUB_CMDLINE_LINUX="$GRUB_CMDLINE_LINUX console=ttyAMA0,115200n8" -<% else -%> -GRUB_CMDLINE_LINUX="$GRUB_CMDLINE_LINUX console=tty0 console=ttyS0,115200n8" -<%- end -%> - GRUB_TERMINAL="serial console" GRUB_SERIAL_COMMAND="serial --unit=0 --speed=115200 --word=8 --parity=no --stop=1" diff --git a/modules/grub/templates/puppet-kernel-serial.cfg.erb b/modules/grub/templates/puppet-kernel-serial.cfg.erb new file mode 100644 index 000000000..4b5026d90 --- /dev/null +++ b/modules/grub/templates/puppet-kernel-serial.cfg.erb @@ -0,0 +1,5 @@ +<%- if scope.lookupvar('::debarchitecture') == "arm64" -%> +GRUB_CMDLINE_LINUX="$GRUB_CMDLINE_LINUX console=ttyAMA0,115200n8" +<% else -%> +GRUB_CMDLINE_LINUX="$GRUB_CMDLINE_LINUX console=tty0 console=ttyS0,115200n8" +<%- end -%> -- 2.20.1