ubuntu-machine 0.5.3.2.25

Sign up to get free protection for your applications and to get access to all the features.
Files changed (44) hide show
  1. data/MIT-LICENSE +20 -0
  2. data/README +15 -0
  3. data/lib/capistrano/ext/ubuntu-machine.rb +30 -0
  4. data/lib/capistrano/ext/ubuntu-machine/apache.rb +118 -0
  5. data/lib/capistrano/ext/ubuntu-machine/aptitude.rb +99 -0
  6. data/lib/capistrano/ext/ubuntu-machine/extras.rb +39 -0
  7. data/lib/capistrano/ext/ubuntu-machine/ffmpeg.rb +43 -0
  8. data/lib/capistrano/ext/ubuntu-machine/gems.rb +41 -0
  9. data/lib/capistrano/ext/ubuntu-machine/git.rb +15 -0
  10. data/lib/capistrano/ext/ubuntu-machine/helpers.rb +36 -0
  11. data/lib/capistrano/ext/ubuntu-machine/iptables.rb +20 -0
  12. data/lib/capistrano/ext/ubuntu-machine/lmsensors.rb +26 -0
  13. data/lib/capistrano/ext/ubuntu-machine/machine.rb +50 -0
  14. data/lib/capistrano/ext/ubuntu-machine/mysql.rb +64 -0
  15. data/lib/capistrano/ext/ubuntu-machine/network.rb +42 -0
  16. data/lib/capistrano/ext/ubuntu-machine/ntp.rb +37 -0
  17. data/lib/capistrano/ext/ubuntu-machine/odbc.rb +44 -0
  18. data/lib/capistrano/ext/ubuntu-machine/php.rb +8 -0
  19. data/lib/capistrano/ext/ubuntu-machine/postfix.rb +7 -0
  20. data/lib/capistrano/ext/ubuntu-machine/rails3.rb +7 -0
  21. data/lib/capistrano/ext/ubuntu-machine/ruby.rb +86 -0
  22. data/lib/capistrano/ext/ubuntu-machine/ssh.rb +64 -0
  23. data/lib/capistrano/ext/ubuntu-machine/templates/apache2.erb +7 -0
  24. data/lib/capistrano/ext/ubuntu-machine/templates/deflate.conf.erb +3 -0
  25. data/lib/capistrano/ext/ubuntu-machine/templates/freetds.conf.erb +8 -0
  26. data/lib/capistrano/ext/ubuntu-machine/templates/iptables.erb +46 -0
  27. data/lib/capistrano/ext/ubuntu-machine/templates/my.cnf.erb +3 -0
  28. data/lib/capistrano/ext/ubuntu-machine/templates/new_db.erb +5 -0
  29. data/lib/capistrano/ext/ubuntu-machine/templates/ntp.conf.erb +16 -0
  30. data/lib/capistrano/ext/ubuntu-machine/templates/ntpdate.erb +13 -0
  31. data/lib/capistrano/ext/ubuntu-machine/templates/odbc.ini.erb +8 -0
  32. data/lib/capistrano/ext/ubuntu-machine/templates/odbcinst.ini.erb +7 -0
  33. data/lib/capistrano/ext/ubuntu-machine/templates/passenger.conf.erb +2 -0
  34. data/lib/capistrano/ext/ubuntu-machine/templates/passenger.load.erb +1 -0
  35. data/lib/capistrano/ext/ubuntu-machine/templates/sources.jaunty.erb +55 -0
  36. data/lib/capistrano/ext/ubuntu-machine/templates/sources.lucid.erb +22 -0
  37. data/lib/capistrano/ext/ubuntu-machine/templates/sshd_config.erb +80 -0
  38. data/lib/capistrano/ext/ubuntu-machine/templates/vhost.erb +17 -0
  39. data/lib/capistrano/ext/ubuntu-machine/templates/vsftpd.conf.erb +158 -0
  40. data/lib/capistrano/ext/ubuntu-machine/templates/xsendfile.load.erb +1 -0
  41. data/lib/capistrano/ext/ubuntu-machine/tmpfs.rb +17 -0
  42. data/lib/capistrano/ext/ubuntu-machine/utils.rb +49 -0
  43. data/lib/capistrano/ext/ubuntu-machine/vsftpd.rb +63 -0
  44. metadata +130 -0
@@ -0,0 +1 @@
1
+ LoadModule xsendfile_module /usr/lib/apache2/modules/mod_xsendfile.so
@@ -0,0 +1,17 @@
1
+ namespace :tmpfs do
2
+ _cset(:tmpfs_directories) do
3
+ abort "Please specify the tmpfs directories:\n set :tmpfs_directories do\n{\n'/tmpfs' => {:size => '2G', :mode => '0744'},\n}\nend"
4
+ end
5
+
6
+ desc "Create tmpfs directories"
7
+ task :create_directories, :roles => :app do
8
+ tmpfs_directories.each do |dir,options|
9
+ options[:size] ||= '2G'
10
+ options[:mode] ||= '0744'
11
+ sudo "mkdir -p #{dir}"
12
+ fstab_line = "tmpfs #{dir} tmpfs size=#{options[:size]},mode=#{options[:mode]} 0 0"
13
+ sudo_add_to_file('/etc/fstab',fstab_line)
14
+ sudo "mount #{dir}"
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,49 @@
1
+ namespace :utils do
2
+
3
+ desc "Reboot the system."
4
+ task :reboot, :roles => :gateway do
5
+ sure = Capistrano::CLI.ui.ask("Are you sure you want to reboot now? (y/n) : ")
6
+ sudo "reboot" if sure=="y"
7
+ end
8
+
9
+ desc "Force a reboot of the system."
10
+ task :force_reboot, :roles => :gateway do
11
+ sudo "reboot"
12
+ end
13
+
14
+ desc "Show the amount of free disk space."
15
+ task :disk_space, :roles => :gateway do
16
+ run "df -h /"
17
+ end
18
+
19
+ desc "Display amount of free and used memory in the system."
20
+ task :free, :roles => :gateway do
21
+ run "free -m"
22
+ end
23
+
24
+ desc "Display passenger status information."
25
+ task :passenger_status, :roles => :gateway do
26
+ sudo "/opt/ruby-enterprise/bin/passenger-status"
27
+ end
28
+
29
+ desc "Display passenger memory usage information."
30
+ task :passenger_memory, :roles => :gateway do
31
+ sudo "/opt/ruby-enterprise/bin/passenger-memory-stats"
32
+ end
33
+
34
+ desc "Activate Phusion Passenger Enterprise Edition."
35
+ task :passenger_enterprise, :roles => :gateway do
36
+
37
+ sudo_and_watch_prompt("/opt/ruby-enterprise/bin/passenger-make-enterprisey", [/Key\:/, /again\:/])
38
+ end
39
+
40
+
41
+ desc "Copy sources list"
42
+ task :copy_sources, :roles => :gateway do
43
+ put render("sources.lucid", binding), "sources.list"
44
+ sudo "mv sources.list /etc/apt/sources.list"
45
+ sudo "apt-get update"
46
+ end
47
+
48
+
49
+ end
@@ -0,0 +1,63 @@
1
+ namespace :vsftpd do
2
+ set :vsftpd_user_shell, '/usr/sbin/nologin'
3
+ set :vsftpd_group, 'ftpusers'
4
+ _cset(:vsftpd_users) { abort "Please specify the VSFTPd users:\n set :vsftpd_users, ['user1', 'user2']" }
5
+
6
+ desc "Install VSFTPd"
7
+ task :install do
8
+ sudo "aptitude install -y vsftpd"
9
+ configure
10
+ add_nologin_shell
11
+ create_group
12
+ add_user_to_group
13
+ create_users
14
+ end
15
+
16
+ desc "Install VSFTPd configuration file"
17
+ task :configure do
18
+ # TODO: Don't use a template for the config, or append it to the existing config.
19
+ # TODO: Other solution could be to allow setting a local config file which will be uploaded.
20
+ put render("vsftpd.conf", binding), "vsftpd.conf"
21
+ sudo "mv vsftpd.conf /etc/vsftpd.conf"
22
+ restart
23
+ end
24
+
25
+ desc "Add the :vsftpd_user_shell to /etc/shells"
26
+ task :add_nologin_shell do
27
+ sudo_add_to_file('/etc/shells',vsftpd_user_shell)
28
+ end
29
+
30
+ desc "Create VSFTPd-only users"
31
+ task :create_users do
32
+ vsftpd_users.each do |user_to_create|
33
+ sudo "useradd --shell #{vsftpd_user_shell} --groups #{vsftpd_group} -m #{user_to_create}"
34
+ puts "Changing password for #{user_to_create}:"
35
+ sudo_and_watch_prompt("passwd #{user_to_create}", [/Enter new UNIX password/, /Retype new UNIX password:/, /\[\]\:/, /\[y\/N\]/i])
36
+ end
37
+ end
38
+
39
+ desc "Create VSFTPd group"
40
+ task :create_group do
41
+ sudo "groupadd -f #{vsftpd_group}"
42
+ end
43
+
44
+ desc "Adds current user to VSFTPd group"
45
+ task :add_user_to_group do
46
+ sudo "usermod -a -G #{vsftpd_group} #{user}"
47
+ end
48
+
49
+ desc "Start the vsftpd server"
50
+ task :start do
51
+ sudo "/etc/init.d/vsftpd start"
52
+ end
53
+
54
+ desc "Restart the vsftpd server"
55
+ task :restart do
56
+ sudo "/etc/init.d/vsftpd restart"
57
+ end
58
+
59
+ desc "Stop the vsftpd server"
60
+ task :stop do
61
+ sudo "/etc/init.d/vsftpd stop"
62
+ end
63
+ end
metadata ADDED
@@ -0,0 +1,130 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: ubuntu-machine
3
+ version: !ruby/object:Gem::Version
4
+ hash: 205
5
+ prerelease: false
6
+ segments:
7
+ - 0
8
+ - 5
9
+ - 3
10
+ - 2
11
+ - 25
12
+ version: 0.5.3.2.25
13
+ platform: ruby
14
+ authors:
15
+ - Thomas Balthazar
16
+ - Tarik Alkasab
17
+ - Filip H.F. 'FiXato' Slagter
18
+ - Wes Oldenbeuving
19
+ - Rachid Al Maach
20
+ autorequire:
21
+ bindir: bin
22
+ cert_chain: []
23
+
24
+ date: 2010-12-17 00:00:00 +01:00
25
+ default_executable:
26
+ dependencies:
27
+ - !ruby/object:Gem::Dependency
28
+ name: capistrano
29
+ prerelease: false
30
+ requirement: &id001 !ruby/object:Gem::Requirement
31
+ none: false
32
+ requirements:
33
+ - - ">"
34
+ - !ruby/object:Gem::Version
35
+ hash: 31
36
+ segments:
37
+ - 2
38
+ - 5
39
+ - 2
40
+ version: 2.5.2
41
+ type: :runtime
42
+ version_requirements: *id001
43
+ description: Capistrano recipes for setting up and deploying to a Ubuntu Machine
44
+ email: fixato@gmail.com
45
+ executables: []
46
+
47
+ extensions: []
48
+
49
+ extra_rdoc_files: []
50
+
51
+ files:
52
+ - README
53
+ - MIT-LICENSE
54
+ - lib/capistrano/ext/ubuntu-machine.rb
55
+ - lib/capistrano/ext/ubuntu-machine/apache.rb
56
+ - lib/capistrano/ext/ubuntu-machine/aptitude.rb
57
+ - lib/capistrano/ext/ubuntu-machine/extras.rb
58
+ - lib/capistrano/ext/ubuntu-machine/ffmpeg.rb
59
+ - lib/capistrano/ext/ubuntu-machine/gems.rb
60
+ - lib/capistrano/ext/ubuntu-machine/git.rb
61
+ - lib/capistrano/ext/ubuntu-machine/helpers.rb
62
+ - lib/capistrano/ext/ubuntu-machine/iptables.rb
63
+ - lib/capistrano/ext/ubuntu-machine/lmsensors.rb
64
+ - lib/capistrano/ext/ubuntu-machine/machine.rb
65
+ - lib/capistrano/ext/ubuntu-machine/mysql.rb
66
+ - lib/capistrano/ext/ubuntu-machine/network.rb
67
+ - lib/capistrano/ext/ubuntu-machine/ntp.rb
68
+ - lib/capistrano/ext/ubuntu-machine/odbc.rb
69
+ - lib/capistrano/ext/ubuntu-machine/php.rb
70
+ - lib/capistrano/ext/ubuntu-machine/postfix.rb
71
+ - lib/capistrano/ext/ubuntu-machine/ruby.rb
72
+ - lib/capistrano/ext/ubuntu-machine/ssh.rb
73
+ - lib/capistrano/ext/ubuntu-machine/tmpfs.rb
74
+ - lib/capistrano/ext/ubuntu-machine/utils.rb
75
+ - lib/capistrano/ext/ubuntu-machine/vsftpd.rb
76
+ - lib/capistrano/ext/ubuntu-machine/rails3.rb
77
+ - lib/capistrano/ext/ubuntu-machine/templates/apache2.erb
78
+ - lib/capistrano/ext/ubuntu-machine/templates/deflate.conf.erb
79
+ - lib/capistrano/ext/ubuntu-machine/templates/freetds.conf.erb
80
+ - lib/capistrano/ext/ubuntu-machine/templates/iptables.erb
81
+ - lib/capistrano/ext/ubuntu-machine/templates/my.cnf.erb
82
+ - lib/capistrano/ext/ubuntu-machine/templates/new_db.erb
83
+ - lib/capistrano/ext/ubuntu-machine/templates/ntpdate.erb
84
+ - lib/capistrano/ext/ubuntu-machine/templates/ntp.conf.erb
85
+ - lib/capistrano/ext/ubuntu-machine/templates/odbc.ini.erb
86
+ - lib/capistrano/ext/ubuntu-machine/templates/odbcinst.ini.erb
87
+ - lib/capistrano/ext/ubuntu-machine/templates/passenger.conf.erb
88
+ - lib/capistrano/ext/ubuntu-machine/templates/passenger.load.erb
89
+ - lib/capistrano/ext/ubuntu-machine/templates/sshd_config.erb
90
+ - lib/capistrano/ext/ubuntu-machine/templates/vhost.erb
91
+ - lib/capistrano/ext/ubuntu-machine/templates/vsftpd.conf.erb
92
+ - lib/capistrano/ext/ubuntu-machine/templates/xsendfile.load.erb
93
+ - lib/capistrano/ext/ubuntu-machine/templates/sources.jaunty.erb
94
+ - lib/capistrano/ext/ubuntu-machine/templates/sources.lucid.erb
95
+ has_rdoc: true
96
+ homepage: https://github.com/rachid/ubuntu-machine
97
+ licenses: []
98
+
99
+ post_install_message:
100
+ rdoc_options: []
101
+
102
+ require_paths:
103
+ - lib
104
+ required_ruby_version: !ruby/object:Gem::Requirement
105
+ none: false
106
+ requirements:
107
+ - - ">="
108
+ - !ruby/object:Gem::Version
109
+ hash: 3
110
+ segments:
111
+ - 0
112
+ version: "0"
113
+ required_rubygems_version: !ruby/object:Gem::Requirement
114
+ none: false
115
+ requirements:
116
+ - - ">="
117
+ - !ruby/object:Gem::Version
118
+ hash: 3
119
+ segments:
120
+ - 0
121
+ version: "0"
122
+ requirements: []
123
+
124
+ rubyforge_project:
125
+ rubygems_version: 1.3.7
126
+ signing_key:
127
+ specification_version: 3
128
+ summary: Capistrano recipes for setting up and deploying to a Ubuntu Machine. Fork of SuitMyMind's ubuntu-machine
129
+ test_files: []
130
+