Refactoring: move and integrate helper method
Suppress duplicated slash when specified prefix with /xxxx format
Extract common logic and split resource and command
Fix rubocop violation
Fix helpers to appropriate helper
Include common helper instead of extend helper
Return directory without subdirectory to suppress duplicate directory
Add configure event/role to create .s3cfg on ap-server