Skip to content
This repository was archived by the owner on Oct 19, 2024. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion lib/recap/tasks/bootstrap.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,15 @@ module Recap::Tasks::Bootstrap
# account should be dedicated to running this application.
desc 'Sets up the server account used by the application, including home directory and environment support'
task :application do

# If the group doesn't already exist on the server, the task creates it.
if exit_code("getent group #{application_user}").strip != "0"
sudo "/usr/sbin/groupadd #{application_user}"
end

# If the account doesn't already exist on the server, the task creates it.
if exit_code("id #{application_user}").strip != "0"
sudo "useradd #{application_user} -d #{application_home}"
sudo "/usr/sbin/useradd #{application_user} -d #{application_home} -g #{application_user}"
end

# If the home directory doesn't exist, or isn't both readable and writable by members of the application
Expand Down