From 75ad67280c2f14149ef224589bc1cc288ce8bcd2 Mon Sep 17 00:00:00 2001 From: Richard Lee Date: Mon, 7 Sep 2015 19:08:34 +0800 Subject: [PATCH] Avoid recreating group --- deploy/definitions/opsworks_deploy_user.rb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/deploy/definitions/opsworks_deploy_user.rb b/deploy/definitions/opsworks_deploy_user.rb index c294fe79e4..3926790692 100644 --- a/deploy/definitions/opsworks_deploy_user.rb +++ b/deploy/definitions/opsworks_deploy_user.rb @@ -1,7 +1,13 @@ define :opsworks_deploy_user do deploy = params[:deploy_data] - group deploy[:group] + group deploy[:group] do + not_if do + existing_groups = [] + Etc.group {|group| existing_groups << group['name']} + existing_groups.include?(deploy[:group]) + end + end user deploy[:user] do action :create