Sha256: b896dd97bfde8a37ee46a5cb9d209de116142fd67eada5b36d8015c0437e7f7a

Contents?: true

Size: 1.84 KB

Versions: 8

Compression:

Stored size: 1.84 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 :default_server_name,   domain
        _cset(:default_server_ip)     { lookup_ip_for default_server_name }

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

        _cset(:app_server_ip)         { lookup_ip_for app_server_name }
        _cset(:web_server_ip)         { lookup_ip_for web_server_name }
        _cset(:db_server_ip)          { lookup_ip_for db_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
    role :app,                  app_server_name
    role :db,                   db_server_name, :primary => true
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
chicken_soup-0.9.0 lib/chicken_soup/capabilities/unix/unix-defaults.rb
chicken_soup-0.8.6 lib/chicken_soup/capabilities/unix/unix-defaults.rb
chicken_soup-0.8.5 lib/chicken_soup/capabilities/unix/unix-defaults.rb
chicken_soup-0.8.4 lib/chicken_soup/capabilities/unix/unix-defaults.rb
chicken_soup-0.8.3 lib/chicken_soup/capabilities/unix/unix-defaults.rb
chicken_soup-0.8.2 lib/chicken_soup/capabilities/unix/unix-defaults.rb
chicken_soup-0.8.1 lib/chicken_soup/capabilities/unix/unix-defaults.rb
chicken_soup-0.8.0 lib/chicken_soup/capabilities/unix/unix-defaults.rb