Empact-deprec 1.99.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (148) hide show
  1. data/CHANGELOG +170 -0
  2. data/COPYING +19 -0
  3. data/LICENSE +339 -0
  4. data/README +136 -0
  5. data/THANKS +5 -0
  6. data/bin/depify +133 -0
  7. data/docs/ANNOUNCE.deprec2 +47 -0
  8. data/docs/README.install +88 -0
  9. data/docs/README.nagios +28 -0
  10. data/docs/README.rails +20 -0
  11. data/docs/README.svn +31 -0
  12. data/docs/ROADMAP.txt +74 -0
  13. data/docs/deprec-1.x/deprec-1.x.quickstart +50 -0
  14. data/docs/deprec-1.x/notes.txt +12 -0
  15. data/docs/deprec_banner.gif +0 -0
  16. data/lib/deprec.rb +8 -0
  17. data/lib/deprec/capistrano_extensions.rb +378 -0
  18. data/lib/deprec/recipes.rb +40 -0
  19. data/lib/deprec/recipes/aoe.rb +117 -0
  20. data/lib/deprec/recipes/apache.rb +179 -0
  21. data/lib/deprec/recipes/ar_sendmail.rb +65 -0
  22. data/lib/deprec/recipes/canonical.rb +57 -0
  23. data/lib/deprec/recipes/deprec.rb +155 -0
  24. data/lib/deprec/recipes/deprecated.rb +71 -0
  25. data/lib/deprec/recipes/example.rb +115 -0
  26. data/lib/deprec/recipes/git.rb +168 -0
  27. data/lib/deprec/recipes/gitosis.rb +47 -0
  28. data/lib/deprec/recipes/god.rb +107 -0
  29. data/lib/deprec/recipes/heartbeat.rb +138 -0
  30. data/lib/deprec/recipes/iptables.rb +53 -0
  31. data/lib/deprec/recipes/logrotate.rb +51 -0
  32. data/lib/deprec/recipes/lvm.rb +20 -0
  33. data/lib/deprec/recipes/memcached.rb +102 -0
  34. data/lib/deprec/recipes/mongrel.rb +209 -0
  35. data/lib/deprec/recipes/monit.rb +130 -0
  36. data/lib/deprec/recipes/mysql.rb +115 -0
  37. data/lib/deprec/recipes/nagios.rb +302 -0
  38. data/lib/deprec/recipes/network.rb +84 -0
  39. data/lib/deprec/recipes/nginx.rb +154 -0
  40. data/lib/deprec/recipes/ntp.rb +96 -0
  41. data/lib/deprec/recipes/php.rb +99 -0
  42. data/lib/deprec/recipes/postfix.rb +105 -0
  43. data/lib/deprec/recipes/rails.rb +302 -0
  44. data/lib/deprec/recipes/ruby.rb +66 -0
  45. data/lib/deprec/recipes/sphinx.rb +83 -0
  46. data/lib/deprec/recipes/ssh.rb +93 -0
  47. data/lib/deprec/recipes/svn.rb +169 -0
  48. data/lib/deprec/recipes/swiftiply.rb +108 -0
  49. data/lib/deprec/recipes/thin.rb +201 -0
  50. data/lib/deprec/recipes/trac.rb +277 -0
  51. data/lib/deprec/recipes/ubuntu.rb +20 -0
  52. data/lib/deprec/recipes/users.rb +90 -0
  53. data/lib/deprec/recipes/utils.rb +39 -0
  54. data/lib/deprec/recipes/xen.rb +259 -0
  55. data/lib/deprec/templates/aoe/aoe-init +55 -0
  56. data/lib/deprec/templates/aoe/fence_aoemask +351 -0
  57. data/lib/deprec/templates/apache/httpd-vhost-app.conf.erb +144 -0
  58. data/lib/deprec/templates/apache/httpd.conf +465 -0
  59. data/lib/deprec/templates/apache/index.html.erb +37 -0
  60. data/lib/deprec/templates/apache/master.css +72 -0
  61. data/lib/deprec/templates/ar_sendmail/logrotate.conf.erb +9 -0
  62. data/lib/deprec/templates/ar_sendmail/monit.conf.erb +5 -0
  63. data/lib/deprec/templates/coraid/aoe-init +55 -0
  64. data/lib/deprec/templates/deprec/caprc.erb +14 -0
  65. data/lib/deprec/templates/god/god-init-script +71 -0
  66. data/lib/deprec/templates/god/god-notifications +0 -0
  67. data/lib/deprec/templates/god/god_mongrel.erb +81 -0
  68. data/lib/deprec/templates/god/god_mysql.erb +50 -0
  69. data/lib/deprec/templates/god/god_nginx.erb +61 -0
  70. data/lib/deprec/templates/god/god_thin.erb +80 -0
  71. data/lib/deprec/templates/heartbeat/authkeys.erb +2 -0
  72. data/lib/deprec/templates/heartbeat/ha.cf.erb +15 -0
  73. data/lib/deprec/templates/heartbeat/haresources.erb +1 -0
  74. data/lib/deprec/templates/iptables/iptables.up.erb +41 -0
  75. data/lib/deprec/templates/logrotate/logrotate.conf.erb +32 -0
  76. data/lib/deprec/templates/memcached/memcached-init-script +65 -0
  77. data/lib/deprec/templates/memcached/memcached.conf.erb +46 -0
  78. data/lib/deprec/templates/mongrel/logrotate.conf.erb +11 -0
  79. data/lib/deprec/templates/mongrel/mongrel_cluster-init-script +54 -0
  80. data/lib/deprec/templates/mongrel/mongrel_cluster.logrotate.d +14 -0
  81. data/lib/deprec/templates/mongrel/mongrel_cluster.yml.erb +10 -0
  82. data/lib/deprec/templates/mongrel/monit.conf.erb +17 -0
  83. data/lib/deprec/templates/monit/monit-init-script +104 -0
  84. data/lib/deprec/templates/monit/monitrc.erb +227 -0
  85. data/lib/deprec/templates/monit/nothing +0 -0
  86. data/lib/deprec/templates/mysql/create_databases.sql +20 -0
  87. data/lib/deprec/templates/mysql/database.yml.prod +6 -0
  88. data/lib/deprec/templates/mysql/database.yml.stage +6 -0
  89. data/lib/deprec/templates/mysql/my.cnf.erb +140 -0
  90. data/lib/deprec/templates/mysql/sphinx.conf.prod +542 -0
  91. data/lib/deprec/templates/mysql/sphinx.conf.stage +542 -0
  92. data/lib/deprec/templates/nagios/cgi.cfg.erb +321 -0
  93. data/lib/deprec/templates/nagios/commands.cfg.erb +240 -0
  94. data/lib/deprec/templates/nagios/contacts.cfg.erb +75 -0
  95. data/lib/deprec/templates/nagios/hosts.cfg.erb +70 -0
  96. data/lib/deprec/templates/nagios/htpasswd.users +1 -0
  97. data/lib/deprec/templates/nagios/localhost.cfg.erb +157 -0
  98. data/lib/deprec/templates/nagios/nagios.cfg.erb +1274 -0
  99. data/lib/deprec/templates/nagios/nagios_apache_vhost.conf.erb +45 -0
  100. data/lib/deprec/templates/nagios/nrpe.cfg.erb +208 -0
  101. data/lib/deprec/templates/nagios/nrpe.xinetd.erb +16 -0
  102. data/lib/deprec/templates/nagios/resource.cfg.erb +34 -0
  103. data/lib/deprec/templates/nagios/services.cfg.erb +7 -0
  104. data/lib/deprec/templates/nagios/templates.cfg.erb +190 -0
  105. data/lib/deprec/templates/nagios/timeperiods.cfg.erb +94 -0
  106. data/lib/deprec/templates/network/hostname.erb +1 -0
  107. data/lib/deprec/templates/network/hosts.erb +2 -0
  108. data/lib/deprec/templates/network/interfaces.erb +18 -0
  109. data/lib/deprec/templates/nginx/logrotate.conf.erb +13 -0
  110. data/lib/deprec/templates/nginx/mime.types.erb +70 -0
  111. data/lib/deprec/templates/nginx/nginx-init-script +62 -0
  112. data/lib/deprec/templates/nginx/nginx.conf.erb +53 -0
  113. data/lib/deprec/templates/nginx/nginx.logrotate.d +12 -0
  114. data/lib/deprec/templates/nginx/nothing.conf +1 -0
  115. data/lib/deprec/templates/nginx/rails_nginx_vhost.conf.erb +45 -0
  116. data/lib/deprec/templates/ntp/ntp.conf.erb +42 -0
  117. data/lib/deprec/templates/postfix/aliases.erb +3 -0
  118. data/lib/deprec/templates/postfix/dynamicmaps.cf.erb +8 -0
  119. data/lib/deprec/templates/postfix/main.cf.erb +41 -0
  120. data/lib/deprec/templates/postfix/master.cf.erb +77 -0
  121. data/lib/deprec/templates/rails/database.yml.erb +6 -0
  122. data/lib/deprec/templates/sphinx/monit.conf.erb +5 -0
  123. data/lib/deprec/templates/ssh/ssh_config.erb +50 -0
  124. data/lib/deprec/templates/ssh/sshd_config.erb +78 -0
  125. data/lib/deprec/templates/subversion/svn.apache.vhost.erb +43 -0
  126. data/lib/deprec/templates/swiftiply/swiftiply-init-script +61 -0
  127. data/lib/deprec/templates/swiftiply/swiftiply.yml.erb +11 -0
  128. data/lib/deprec/templates/thin/thin-init-script +51 -0
  129. data/lib/deprec/templates/thin/thin.yml.erb +11 -0
  130. data/lib/deprec/templates/trac/apache_vhost.conf.erb +24 -0
  131. data/lib/deprec/templates/trac/nginx_vhost.conf.erb +26 -0
  132. data/lib/deprec/templates/trac/trac.ini.erb +169 -0
  133. data/lib/deprec/templates/trac/trac_deprec.png +0 -0
  134. data/lib/deprec/templates/trac/tracd-init.erb +43 -0
  135. data/lib/deprec/templates/trac/users.htdigest.erb +0 -0
  136. data/lib/deprec/templates/xen/15-disable-hwclock +40 -0
  137. data/lib/deprec/templates/xen/network-bridge-wrapper +3 -0
  138. data/lib/deprec/templates/xen/xen-tools.conf.erb +220 -0
  139. data/lib/deprec/templates/xen/xend-config.sxp.erb +195 -0
  140. data/lib/deprec/templates/xen/xend-init.erb +69 -0
  141. data/lib/deprec/templates/xen/xendomains.erb +137 -0
  142. data/lib/deprec/templates/xen/xm.tmpl.erb +85 -0
  143. data/lib/vmbuilder_plugins/all.rb +20 -0
  144. data/lib/vmbuilder_plugins/apt.rb +93 -0
  145. data/lib/vmbuilder_plugins/emerge.rb +76 -0
  146. data/lib/vmbuilder_plugins/gem.rb +90 -0
  147. data/lib/vmbuilder_plugins/std.rb +203 -0
  148. metadata +207 -0
data/README ADDED
@@ -0,0 +1,136 @@
1
+ ------------------------------------------
2
+ deprec - Deployment Recipes for Capistrano
3
+ ------------------------------------------
4
+
5
+ == Introduction
6
+
7
+ The deprec [1] gem is a set of tasks for Capistrano [2]. These tasks provide
8
+ for the installation, configuration and control of system services. Deprec
9
+ was created in 2006 by Mike Bailey to setup an environment for running Ruby
10
+ on Rails web applications on Ubuntu dapper servers. Since then its uses have
11
+ grown to installing mail, monitoring, high availability IP failover and other
12
+ services.
13
+
14
+ The tasks are run at the command line on your workstation and connect to
15
+ remote servers via ssh to run commands and copy out files.
16
+
17
+ Deprec-2.x is a complete rewrite of the project that achieves the following:
18
+
19
+ - support for Capistrano 2
20
+ - support for more services (heartbeat, nagios, nginx, ntp, postfix, etc)
21
+ - creation of a standard base set of task names
22
+ - tasks are cleanly separated into namespaced units (one file per service)
23
+ - service config files are stored locally to enable edits and version control
24
+ - interactive prompting for missing config values
25
+
26
+ One idea that is in the trash can is supporting other distros/OS's. While I got
27
+ caught up in the excitement of The Big Rewrite I've decided I don't need it. If
28
+ you want to deploy to something other than Ubuntu I suggest you look for other
29
+ alternatives.
30
+
31
+ Deprec and Capistrano are written in the Ruby programming language [3] however
32
+ no knowledge of Ruby is required to use it. Users should be able to write
33
+ new tasks and modify existing options without prior knowledge of Ruby.
34
+
35
+
36
+ == Installation
37
+
38
+ Deprec can be obtained from rubyforge[4] and installed using rubygems[5].
39
+
40
+ sudo gem install deprec # installs deprec and dependancies
41
+ cap depify . # creates ~/.caprc which you may edit
42
+ cap -T # should list lots of deprec tasks
43
+
44
+ The .caprc file is loaded every time you use Capistrano. It in turn loads
45
+ the deprec tasks so you always have them available. Editing the .caprc file
46
+ in your home directory allows you to specify the location of your ssh key
47
+ and enable some other useful options (documented in the comments). You can
48
+ also put tasks here that you want to always have access to.
49
+
50
+
51
+ == Getting a Ruby on Rails app running on a fresh Ubuntu server
52
+
53
+ This is still what brings people to deprec. You can install a full Rails stack
54
+ and get multiple apps running on it in much less time than it would take to
55
+ do it manually. Think an hour vs. a weekend. (The irony is I'm up writing this
56
+ on a Saturday night.)
57
+
58
+ export HOSTS=<target.host.name>
59
+
60
+ # Install Rails stack
61
+ cap deprec:rails:install_rails_stack
62
+
63
+ # Install mysql (if it's running on the same box)
64
+ cap deprec:mysql:install
65
+ cap deprec:mysql:config_gen
66
+ cap deprec:mysql:config
67
+
68
+ # Install your Rails app
69
+ cap deploy:setup
70
+ cap deploy
71
+ cap deprec:db:create
72
+ cap deprec:db:migrate
73
+ cap deprec:nginx:restart
74
+ cap deprec:mongrel:restart
75
+
76
+ You can find documentation on the deprec site. http://www.deprec.org/
77
+
78
+
79
+ == Installing other things
80
+
81
+ I plan to document other things I use deprec for on http://www.deprec.org/.
82
+ Feel free to poke around and see what's there. I use deprec to provision and
83
+ manage servers so you might find some things in there I haven't documented. Lucky you.
84
+
85
+
86
+ == Disclaimer
87
+
88
+ The tasks run commands that may make changes to your workstation and remote server.
89
+ You are advised to read the source and use at your own risk.
90
+
91
+
92
+ == Credits
93
+
94
+ Deprec is written and maintained by Mike Bailey <mike@bailey.net.au>.
95
+ More about me here: [http://mike.bailey.net.au/]
96
+
97
+ Deprec was inspired and uses the brilliantly executed Capistrano. Thanks Jamis!
98
+ This gem includes a modified copy of Neil Wilson's very useful vmbuilder_plugins gem.
99
+
100
+
101
+ == Thanks
102
+
103
+ Eric Harris-Braun: great testing, bug reports and suggestions
104
+ Gus Gollings: helped restore www.deprec.org
105
+ Craig Ambrose: testing, documentation and beer
106
+
107
+
108
+ == License
109
+
110
+ Deprec is licenced under the GPL. This means that you can use it in commercial
111
+ or open source applications. More details found here:
112
+ http://www.gnu.org/licenses/gpl.html
113
+
114
+ deprec - deployment recipes for capistrano
115
+ Copyright (C) 2006-2008 Mike Bailey
116
+
117
+ This program is free software; you can redistribute it and/or
118
+ modify it under the terms of the GNU General Public License
119
+ as published by the Free Software Foundation; either version 2
120
+ of the License, or (at your option) any later version.
121
+
122
+ This program is distributed in the hope that it will be useful,
123
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
124
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
125
+ GNU General Public License for more details.
126
+
127
+ You should have received a copy of the GNU General Public License
128
+ along with this program; if not, write to the Free Software
129
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
130
+
131
+
132
+ [1] http://www.deprec.org
133
+ [2] http://www.capify.org
134
+ [3] http://www.ruby-lang.org/en/
135
+ [4] http://rubyforge.org/
136
+ [5] http://rubygems.org/
data/THANKS ADDED
@@ -0,0 +1,5 @@
1
+ Big thanks go to the following people. Apologies to any I have missed! - Mike
2
+
3
+ 20080226 Chris Turner for an excellent HOWTO http://crackthenut.cracklabs.com/deprec2-your-slice-from-windows/
4
+ 20080206 Eric Harris-Braun for some great testing, bug reports and suggestions.
5
+ 20071004 Gus Gollings for helping restore www.deprec.org
@@ -0,0 +1,133 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'optparse'
4
+
5
+ OptionParser.new do |opts|
6
+ opts.banner = "Usage: #{File.basename($0)} [path]"
7
+
8
+ opts.on("-h", "--help", "Displays this help info") do
9
+ puts opts
10
+ exit 0
11
+ end
12
+
13
+ begin
14
+ opts.parse!(ARGV)
15
+ rescue OptionParser::ParseError => e
16
+ warn e.message
17
+ puts opts
18
+ exit 1
19
+ end
20
+ end
21
+
22
+ if ARGV.empty?
23
+ abort "Please specify the directory to depify, e.g. `#{File.basename($0)} .'"
24
+ elsif !File.exists?(ARGV.first)
25
+ abort "`#{ARGV.first}' does not exist."
26
+ elsif !File.directory?(ARGV.first)
27
+ abort "`#{ARGV.first}' is not a directory."
28
+ elsif ARGV.length > 1
29
+ abort "Too many arguments; please specify only the directory to capify."
30
+ end
31
+
32
+ def unindent(string)
33
+ indentation = string[/\A\s*/]
34
+ string.strip.gsub(/^#{indentation}/, "")
35
+ end
36
+
37
+
38
+ caprc = unindent(<<-FILE)
39
+ # .caprc - Capistrano configs (added by deprec gem [www.deprec.org])
40
+ #
41
+ # Include settings that you want active whenever you use Capistrano
42
+ # You can over ride these for particular projects by putting entries
43
+ # into Capfile or deploy.rb for those projects
44
+ #
45
+ # Uncomment any of the following entries to enable them.
46
+ #
47
+ # Include deprec - deployment recipes for Capistrano (www.deprec.org)
48
+ #
49
+ require 'deprec'
50
+ #
51
+ # SSH options
52
+ #
53
+ # Use ssh keys instead of typing password every time
54
+ # Replace with the path to your ssh public key
55
+ # ssh_options[:keys] = %w(/path/to/your_home_dir/.ssh/id_rsa)
56
+ #
57
+ # Allow ssh keys to be forwarded (to scm server, through :gateway, etc)
58
+ # ssh_options[:forward_agent] = true
59
+ #
60
+ # Stop some annoying warnings
61
+ # ssh_options[:paranoid] = false
62
+ FILE
63
+
64
+ files = {
65
+ "Capfile" => unindent(<<-FILE),
66
+ load 'deploy' if respond_to?(:namespace) # cap2 differentiator
67
+ Dir['vendor/plugins/*/recipes/*.rb'].each { |plugin| load(plugin) }
68
+ Dir['config/*/recipes.rb'].each { |plugin| load(plugin) }
69
+ load 'config/deploy'
70
+ FILE
71
+
72
+ "config/deploy.rb" => unindent(<<-FILE),
73
+ require 'deprec'
74
+
75
+ set :application, "set your application name here"
76
+ set :domain, "set domain name project will be served on here"
77
+ set :repository, "svn+ssh://\#{domain}/var/www/apps/\#{application}/repos/trunk"
78
+ # set :gems_for_project, %w(dr_nic_magic_models swiftiply) # list of gems to be installed
79
+
80
+ # Update these if you're not running everything on one host.
81
+ role :app, domain
82
+ role :web, domain
83
+ role :db, domain, :primary => true
84
+ role :scm, domain # used by deprec if you want to install subversion
85
+
86
+ # If you aren't deploying to /var/www/apps/\#{application} on the target
87
+ # servers (which is the deprec default), you can specify the actual location
88
+ # via the :deploy_to variable:
89
+ # set :deploy_to, "/var/www/\#{application}"
90
+
91
+ # If you aren't using Subversion to manage your source code, specify
92
+ # your SCM below:
93
+ # set :scm, :subversion
94
+
95
+ namespace :deploy do
96
+ task :restart, :roles => :app, :except => { :no_release => true } do
97
+ top.deprec.mongrel.restart
98
+ end
99
+ end
100
+
101
+ FILE
102
+ }
103
+
104
+ def create_file(file, content)
105
+ if !File.exists?(File.dirname(file))
106
+ puts "[add] creating directory `#{File.dirname(file)}'"
107
+ Dir.mkdir(File.dirname(file))
108
+ end
109
+ if File.exists?(file)
110
+ warn "[skip] `#{file}' already exists"
111
+ elsif File.exists?(file.downcase)
112
+ warn "[skip] `#{file.downcase}' exists, which could conflict with `#{file}'"
113
+ else
114
+ puts "[add] writing `#{file}'"
115
+ File.open(file, "w") { |f| f.write(content) }
116
+ end
117
+ end
118
+
119
+ create_file(File.join(ENV['HOME'], '.caprc'), caprc)
120
+
121
+ base = ARGV.shift
122
+ config_dir = File.join(base,'config')
123
+ if File.directory?(config_dir)
124
+ files.each do |file, content|
125
+ create_file(File.join(base, file), content)
126
+ end
127
+ else
128
+ warn "[warn] directory `#{config_dir}' does not exist"
129
+ warn "[skip] '#{base}/Capfile'"
130
+ warn "[skip] '#{base}/config/deploy.rb'"
131
+ end
132
+
133
+ puts "[done] depified!"
@@ -0,0 +1,47 @@
1
+ == Configuration
2
+
3
+ deprec2 has a two stage process for generating/deploying configuration files.
4
+ Configuration files for web, app, db servers (and more) are generated from
5
+ templates and put under the config/ tree in your Rails apps source tree.
6
+ Alternatively you could create a non-rails-app tree to hold them. The second
7
+ stage is pushing the files out to the destination servers. This used to be a
8
+ one stage process in deprec1 however the change has been made so that:
9
+
10
+ - all config files for a project can be kept under source control
11
+ - you can make changes to config files that are not available through deprec
12
+
13
+ Many of the settings in these config files are based on values in the projects
14
+ deploy.rb file. Others reflect defaults in deprec that you can override by adding
15
+ fields to deploy.rb. This means you may never need to edit the generated config
16
+ files directly. You can generate a set of config files with the following:
17
+
18
+ cap deprec:nginx:config_gen # generates config files for trac from templates
19
+
20
+ config_gen is re-runnable and will prompt you before overwriting a file. It will
21
+ also show you what changes overwriting would make (in diff format) to help you
22
+ decide whether you want it to do so.
23
+
24
+ Changes to service configuration should never be made on the server. Deprec
25
+ acknowledges this by offering no assistance to people who want to copy config
26
+ files back from servers. But pushing the files out couldn't be simpler!
27
+
28
+ cap deprec:nginx:config # pushes out all config files for trac
29
+
30
+ deprec2 takes into consideration the fact that that some services are used to
31
+ host more than one application. For example, a webserver will often have one
32
+ main configuration and a number of virtual host configurations. Monit has a
33
+ single config file (/etc/monitrc) but will also load other configs it finds in
34
+ a certain directory (/etc/monit.d).
35
+
36
+ When you deploy a Ruby on Rails app with deprec it drops configs for your project
37
+ into the config/ directory for your project and symlinks them into a shared path
38
+ on the server. This means you can install multiple apps on a remote server and
39
+ they shouldn't stop on each other.
40
+
41
+ == Extra services
42
+
43
+ - nginx
44
+ - monit
45
+ - postfix
46
+ - nagios
47
+ - more...
@@ -0,0 +1,88 @@
1
+ == Installation and initial setup for deprec2
2
+
3
+ Install deprec with the following command (requires ruby and rubygems installed)
4
+
5
+ sudo gem install deprec
6
+
7
+ Let's create a directory to manage all our host config details
8
+ This supports as many hosts as you need to manage and will be the dir
9
+ you run your deprec commands from when managing the servers. Note that
10
+ you don't need to do this if you just want to deploy a single Ruby on
11
+ Rails application. In this case the config/ dir in your project can
12
+ serve the same purpose. For those who aren't interested in Ruby on Rails
13
+ or want to use deprec for more than just deploying one rails app, the
14
+ following may come in handy.
15
+
16
+ mkdir -p sys/config # change 'sys' to whatever you want
17
+ cd sys #
18
+ depify . # create Capfile and config/deploy.rb
19
+ cap deprec:ssh:config_gen # generates ssh server configs
20
+
21
+ If you have an authorized_keys file, copy it to a location where deprec
22
+ can find it. Deprec will then offer to copy it out to remote hosts when
23
+ you setup new accounts for yourself. If you don't have authorized_keys,
24
+ copy out your id_rsa.pub or id_dsa.pub.
25
+
26
+ You can also put the authorized_keys of colleagues in this dir and deprec
27
+ will offer to copy them out when creating accounts for them too.
28
+
29
+ We name these files using the username of their owner.
30
+
31
+ cp ~/.ssh/authorized_keys config/ssh/authorized_keys/${USER}
32
+
33
+ Define an environment variable for the server we'll be working on
34
+
35
+ export HOSTS=<your.slice.address>
36
+
37
+ Change the root password you received for your new slice.
38
+
39
+ cap deprec:users:passwd USER=root
40
+
41
+ Enter user to change password for |root|
42
+ Password:
43
+ Enter new UNIX password:
44
+ Retype new UNIX password:
45
+
46
+
47
+ Create an account with sudo access for mysql^H^Hself
48
+
49
+ cap deprec:users:add USER=root
50
+
51
+ Enter userid for new user |root|
52
+ mbailey
53
+ Should this be an admin account? |no|
54
+ yes
55
+ I've found an authorized_keys file for mbailey. Should I copy it out? |yes|
56
+ Password:
57
+ Setting pasword for new account
58
+ Enter new UNIX password:
59
+ Retype new UNIX password:
60
+
61
+
62
+ Create another account without sudo access for a colleague.
63
+ Notice how I longer need to specify USER=root? That's because I'm using the
64
+ account I just created.
65
+
66
+ cap deprec:users:add
67
+
68
+ Enter userid for new user |mbailey|
69
+ ben
70
+ Should this be an admin account? |no|
71
+ Password:
72
+ Setting pasword for new account
73
+ Enter new UNIX password:
74
+ Retype new UNIX password:
75
+
76
+ I prefer to disallow ssh password based login for security reasons. I also
77
+ turn off DNS lookups by sshd as they are often responsible for a 2 second
78
+ lag on login. Be warned that turning off ssh passwords will prevent someone
79
+ without an ssh key setup from logging in so use this with caution. Deprec
80
+ makes it painless to upload their key when you create their account though
81
+ so you've got no excuse to leave passwords turned on.
82
+
83
+ You can upload the ssh configs currently residing in config/ssh/etc/ssh by
84
+ running this:
85
+
86
+ cap deprec:ssh:config
87
+
88
+ You can now continue to the other READMEs
@@ -0,0 +1,28 @@
1
+ deprec: Install and configure Nagios on Ubuntu 7.10 (gutsy)
2
+ ===========================================================
3
+ by Mike Bailey
4
+ * Quickstart
5
+
6
+ # You need the following items defined (in config/deploy.rb)
7
+ set :application, 'nagios'
8
+ set :domain, 'nagios.host.name'
9
+ role :nagios, domain
10
+ role :app, 'nagios'
11
+ role :web, nil # must be defined but content not important
12
+
13
+ # Run the following on your workstation
14
+ export HOSTS=nagios.domain.name # replace with desired domain
15
+ cap deprec:apache:install
16
+ cap deprec:apache:activate
17
+ cap deprec:nagios:install
18
+ cap deprec:nagios:activate
19
+ cap deprec:nagios_plugins:install
20
+ cap deprec:nagios:config_gen
21
+ cap deprec:nagios:htpass # create web logins
22
+ cap deprec:nagios:config
23
+ cap deprec:apache:restart
24
+
25
+
26
+ * The detail
27
+
28
+ TBC
@@ -0,0 +1,20 @@
1
+ deprec: Install Ruby on Rails app on fresh Ubuntu 7.10 (gutsy)
2
+ ==============================================================
3
+ by Mike Bailey
4
+
5
+ * Quickstart
6
+
7
+ cd /rails/project/root
8
+ depify .
9
+ # edit config/deploy.rb
10
+ cap deprec:rails:install_rails_stack HOSTS=target.host.name
11
+ cap deploy:setup
12
+ cap deploy
13
+ cap deprec:db:create
14
+ cap deprec:db:migrate
15
+ cap deprec:nginx:restart
16
+
17
+
18
+ * The detail
19
+
20
+ TBC