From 6ea5544a66f8606c8770a59670b767280adb9a5e Mon Sep 17 00:00:00 2001 From: Vincent Untz Date: Thu, 27 Feb 2014 11:06:24 +0100 Subject: [PATCH] Add attributes to choose whether to install graphical UI or not It might not make sense to install that for everyone, so make this an option disabled by default. --- attributes/default.rb | 2 +- recipes/default.rb | 20 +++++++++++++------- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/attributes/default.rb b/attributes/default.rb index 8e4bff1..fcd342c 100644 --- a/attributes/default.rb +++ b/attributes/default.rb @@ -19,7 +19,7 @@ when 'suse' # pacemaker-mgmt-client provides hb_gui, which it's useful # to run over ssh. - default[:pacemaker][:platform][:packages] += %w( + default[:pacemaker][:platform][:graphical_packages] = %w( pacemaker-mgmt-client xorg-x11-xauth ) else diff --git a/recipes/default.rb b/recipes/default.rb index 89237bd..5ad3b58 100644 --- a/recipes/default.rb +++ b/recipes/default.rb @@ -22,13 +22,19 @@ node[:pacemaker][:platform][:packages].each do |pkg| package pkg end -# required to run hb_gui -if platform_family? "suse" - cmd = "SuSEconfig --module gtk2" - execute cmd do - user "root" - command cmd - not_if { File.exists? "/etc/gtk-2.0/gdk-pixbuf64.loaders" } +if node[:pacemaker][:setup_hb_gui] + node[:pacemaker][:platform][:graphical_packages].each do |pkg| + package pkg + end + + # required to run hb_gui + if platform_family? "suse" + cmd = "SuSEconfig --module gtk2" + execute cmd do + user "root" + command cmd + not_if { File.exists? "/etc/gtk-2.0/gdk-pixbuf64.loaders" } + end end end