From 534f640ed487ccd1c56d26fe64ebacd96fd6a62b Mon Sep 17 00:00:00 2001 From: Brian Dwyer Date: Fri, 20 Mar 2015 16:13:43 -0400 Subject: [PATCH] Bug Fix -Adjust logic to not fail if user is changed or does not exist - Do not change the user after initial deployment... The permissions will be off! --- recipes/install.rb | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/recipes/install.rb b/recipes/install.rb index a55fde7..3bc5495 100644 --- a/recipes/install.rb +++ b/recipes/install.rb @@ -28,10 +28,8 @@ # Create file to indicate user upgrade change (Applicable to 0.1.16 to 0.1.17 upgrade) file ::File.join(wildfly['base'], '.chef_useracctchange') do - owner wildfly['user'] - group wildfly['group'] - action :create_if_missing - only_if { ::File.exist?(::File.join(wildfly['base'], '.chef_deployed')) && Dir.home('wildfly') != wildfly['base'] } + action :touch + only_if { ::File.exist?(::File.join(wildfly['base'], '.chef_deployed')) && `getent passwd #{wildfly['user']} | cut -d: -f6`.chomp != wildfly['base'] } notifies :stop, "service[#{wildfly['service']}]", :immediately end