Sha256: 1fd80e242d958bca7ecd927d910e0ab766ae1a0473865560122d15c428a6cca8

Contents?: true

Size: 1.71 KB

Versions: 5

Compression:

Stored size: 1.71 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_servers)           { default_server_name }
        _cset(:web_servers)           { default_server_name }
        _cset(:db_servers)            { 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_servers
    role :app,                  app_servers
    role :db,                   db_servers, :primary => true
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
chicken_soup-0.5.3 lib/chicken_soup/capabilities/unix/unix-defaults.rb
chicken_soup-0.5.2 lib/chicken_soup/capabilities/unix/unix-defaults.rb
chicken_soup-0.5.0 lib/chicken_soup/capabilities/unix/unix-defaults.rb
chicken_soup-0.4.1 lib/chicken_soup/capabilities/unix/unix-defaults.rb
chicken_soup-0.4.0 lib/chicken_soup/capabilities/unix/unix-defaults.rb