From df91d538215359a64ceb09888697d3b7d360f533 Mon Sep 17 00:00:00 2001 From: axeloz Date: Wed, 25 Oct 2017 15:07:17 +0200 Subject: [PATCH] Using chef commands --- cookbooks/lamp/recipes/default.rb | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/cookbooks/lamp/recipes/default.rb b/cookbooks/lamp/recipes/default.rb index 0e3c3fb..67065df 100644 --- a/cookbooks/lamp/recipes/default.rb +++ b/cookbooks/lamp/recipes/default.rb @@ -186,10 +186,10 @@ template '/etc/init.d/mailcatcher' do source 'mailcatcher' end -execute 'create_mailcatcher_user' do - user 'root' - command 'useradd -M -r mailcatcher' - not_if 'cat /etc/passwd |grep mailcatcher' +user 'mailcatcher' do + comment 'The mailcatcher user' + system true + action :create end execute 'mailcatcher_script_executable' do @@ -198,15 +198,8 @@ execute 'mailcatcher_script_executable' do not_if 'test -x /etc/init.d/mailcatcher' end -execute 'adding_mailcatcher_boot' do - user 'root' - command 'update-rc.d mailcatcher defaults' - not_if 'ls /etc/rc0.d/ |grep mailcatcher' -end - -execute 'starting_mailcatcher' do - user 'root' - command 'service mailcatcher start' +service 'mailcatcher' do + action [:enable, :start] end #####################################