Sha256: 842ac9cd6a4cc185e8499b2be8d9ee025437daad46274134708b6c6116710d0c

Contents?: true

Size: 1.75 KB

Versions: 2

Compression:

Stored size: 1.75 KB

Contents

######################################################################
#                         UNIX SERVER DEFAULTS                       #
######################################################################
Capistrano::Configuration.instance(:must_exist).load do
  namespace :capabilities do
    namespace :defaults do
      desc "[internal] Sets intelligent defaults for unix server deployments."
      task :unix do
        _cset :deployment_username,   "deploy"
        _cset :manager_username,      "manage"
        _cset :user,                  deployment_username

        _cset :user_home,             "/home/#{user}"
        _cset :manager_user_home,     "/home/#{manager_username}"
        _cset :deployment_user_home,  "/home/#{deployment_username}"
        _cset :deploy_base_dir,       "/var/www"
        _cset :deploy_site_name,      domain
        set   :deploy_to,             "#{deploy_base_dir}/#{deploy_site_name}"

        _cset :app_server_ip,         default_server_ip
        _cset :web_server_ip,         default_server_ip
        _cset :db_server_ip,          default_server_ip

        _cset :default_server_name,   domain

        _cset(:app_server_name)       { default_server_name }
        _cset(:web_server_name)       { default_server_name }
        _cset(:db_server_name)        { default_server_name }

        # Evidently roles can't be assigned in a namespace :-/
        set_unix_server_roles
      end
    end
  end

  desc "[internal] This task is only here because `role` cannot be used within a `namespace`"
  task :set_unix_server_roles do
    role :web,                  web_server_name, :primary => true
    role :app,                  app_server_name, :primary => true
    role :db,                   db_server_name,  :primary => true
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
chicken_soup-0.3.0 lib/chicken_soup/capabilities/unix/unix-defaults.rb
chicken_soup-0.2.0 lib/chicken_soup/capabilities/unix/unix-defaults.rb