FiXato-ubuntu-machine 0.5.3.2.7 → 0.5.3.2.9

Sign up to get free protection for your applications and to get access to all the features.
@@ -53,4 +53,9 @@ namespace :gems do
53
53
  sudo "gem install -l gems/#{File.basename(local_gem_path)}"
54
54
  end
55
55
  end
56
+
57
+ desc "Adds the --no-rdoc and --no-ri flags to the .gemrc; you don't need docs on a production server."
58
+ task :add_nodocs_to_gemrc, :roles => :app do
59
+ run "echo 'gem: --no-rdoc --no-ri' >> ~/.gemrc"
60
+ end
56
61
  end
@@ -33,4 +33,12 @@ def watch_prompt(ch, stream, data, regex_to_watch)
33
33
  end
34
34
  end
35
35
 
36
-
36
+ # Adds 1 or more commands to the cron tab of root
37
+ def sudo_add_to_crontab(commands,period)
38
+ tmp_cron="/tmp/tmp_cron"
39
+ sudo "rm -f #{tmp_cron} && crontab -l || true > #{tmp_cron}"
40
+ [*commands].each do |cmd|
41
+ run "echo '#{period} #{cmd}' >> #{tmp_cron}"
42
+ end
43
+ sudo "crontab #{tmp_cron}"
44
+ end
@@ -34,6 +34,7 @@ namespace :machine do
34
34
  postfix.install
35
35
  gems.install_rubygems
36
36
  ruby.install_enterprise
37
+ ruby.make_enterprise_default
37
38
  ruby.install_passenger
38
39
  git.install
39
40
  php.install
@@ -0,0 +1,20 @@
1
+ namespace :network do
2
+ desc "Configure /etc/resolv.conf and /etc/network/interfaces"
3
+ task :configure, :roles => :gateway do
4
+ configure_resolv_conf
5
+ configure_network_interfaces
6
+ end
7
+
8
+ desc "Configure network interfaces"
9
+ task :configure_network_interfaces, :roles => :gateway do
10
+ put File.read(network_interfaces_config), "interfaces"
11
+ sudo "mv interfaces /etc/network/interfaces"
12
+ sudo "/etc/init.d/networking restart"
13
+ end
14
+
15
+ desc "Configure /etc/resolv.conf"
16
+ task :configure_resolv_conf, :roles => :gateway do
17
+ put File.read(resolv_config), "resolv.conf"
18
+ sudo "mv resolv.conf /etc/resolv.conf"
19
+ end
20
+ end
@@ -0,0 +1,37 @@
1
+ require 'yaml'
2
+ namespace :ntp do
3
+ set :ntp_default_ntpd_opts, "NTPD_OPTS='-g'"
4
+ set :ntp_server_pool, "nl.pool.ntp.org"
5
+
6
+ desc "Install NTP"
7
+ task :install, :roles => :app do
8
+ sudo "aptitude install -y ntp"
9
+ configure
10
+ end
11
+
12
+ desc "Configure NTP"
13
+ task :configure, :roles => :app do
14
+ put render("ntpdate", binding), "ntpdate"
15
+ sudo "mv ntpdate /etc/default/ntpdate"
16
+ put render("ntp.conf", binding), "ntp.conf"
17
+ sudo "mv ntp.conf /etc/ntp.conf"
18
+ run "echo '#{ntp_default_ntpd_opts}' > ntp"
19
+ sudo "mv ntp /etc/default/ntp"
20
+ restart
21
+ end
22
+
23
+ desc "Start the NTP server"
24
+ task :start, :roles => :app do
25
+ sudo "/etc/init.d/ntp start"
26
+ end
27
+
28
+ desc "Restart the NTP server"
29
+ task :restart, :roles => :app do
30
+ sudo "/etc/init.d/ntp restart"
31
+ end
32
+
33
+ desc "Stop the NTP server"
34
+ task :stop, :roles => :app do
35
+ sudo "/etc/init.d/ntp stop"
36
+ end
37
+ end
@@ -75,8 +75,8 @@ namespace :ruby do
75
75
 
76
76
  desc "Upgrade Phusion Passenger"
77
77
  task :upgrade_passenger, :roles => :app do
78
- sudo "#{ruby_enterprise_path_prefix}/#{ruby_enterprise_version}/bin/ruby #{ruby_enterprise_path_prefix}/#{ruby_enterprise_version}/bin/gem install passenger"
79
- run "sudo #{ruby_enterprise_path_prefix}/#{ruby_enterprise_version}/bin/ruby #{ruby_enterprise_path_prefix}/#{ruby_enterprise_version}/bin/passenger-install-apache2-module --auto"
78
+ sudo "#{ruby_enterprise_path_prefix}/ruby-enterprise/bin/ruby #{ruby_enterprise_path_prefix}/ruby-enterprise/bin/gem install passenger"
79
+ run "sudo #{ruby_enterprise_path_prefix}/ruby-enterprise/bin/ruby #{ruby_enterprise_path_prefix}/ruby-enterprise/bin/passenger-install-apache2-module --auto"
80
80
 
81
81
  put render("passenger.load", binding), "/home/#{user}/passenger.load"
82
82
  put render("passenger.conf", binding), "/home/#{user}/passenger.conf"
@@ -0,0 +1,17 @@
1
+ # /etc/ntp.conf, configuration for ntpd; see ntp.conf(5) for help
2
+
3
+ driftfile /var/lib/ntp/ntp.drift
4
+ filegen clockstats file clockstats type day enable
5
+ filegen loopstats file loopstats type day enable
6
+ filegen peerstats file peerstats type day enable
7
+ restrict -4 default kod notrap nomodify nopeer noquery
8
+ restrict -6 default kod notrap nomodify nopeer noquery
9
+ restrict 10.13.0.0 mask 255.255.255.0 nomodify notrap
10
+ restrict 10.14.0.0 mask 255.255.255.0 nomodify notrap
11
+ restrict 127.0.0.1
12
+ restrict ::1
13
+ server 0.<%=ntp_server_pool%>
14
+ server 1.<%=ntp_server_pool%>
15
+ server 2.<%=ntp_server_pool%> iburst
16
+ server 3.<%=ntp_server_pool%>
17
+ statistics loopstats peerstats clockstats
@@ -0,0 +1,13 @@
1
+ # The settings in this file are used by the program ntpdate-debian, but not
2
+ # by the upstream program ntpdate.
3
+
4
+ # Set to "yes" to take the server list from /etc/ntp.conf, from package ntp,
5
+ # so you only have to keep it in one place.
6
+ NTPDATE_USE_NTP_CONF=yes
7
+
8
+ # List of NTP servers to use (Separate multiple servers with spaces.)
9
+ # Not used if NTPDATE_USE_NTP_CONF is yes.
10
+ NTPSERVERS="ntp.ubuntu.com"
11
+
12
+ # Additional options to pass to ntpdate
13
+ NTPOPTIONS=""
@@ -1,2 +1,2 @@
1
- PassengerRoot <%= ruby_enterprise_path_prefix %>/<%= ruby_enterprise_version %>/lib/ruby/gems/1.8/gems/passenger-<%= passenger_version %>
2
- PassengerRuby <%= ruby_enterprise_path_prefix %>/<%= ruby_enterprise_version %>/bin/ruby
1
+ PassengerRoot <%= ruby_enterprise_path_prefix %>/ruby-enterprise/lib/ruby/gems/1.8/gems/passenger-<%= passenger_version %>
2
+ PassengerRuby <%= ruby_enterprise_path_prefix %>/ruby-enterprise/bin/ruby
@@ -1 +1 @@
1
- LoadModule passenger_module <%= ruby_enterprise_path_prefix %>/<%= ruby_enterprise_version %>/lib/ruby/gems/1.8/gems/passenger-<%= passenger_version %>/ext/apache2/mod_passenger.so
1
+ LoadModule passenger_module <%= ruby_enterprise_path_prefix %>/ruby-enterprise/lib/ruby/gems/1.8/gems/passenger-<%= passenger_version %>/ext/apache2/mod_passenger.so
@@ -31,12 +31,6 @@ namespace :tmpfs do
31
31
  cron_commands << cmds.join(' && ')
32
32
  sudo "ln -s #{File.join(vsftpd_tmpfs_directory,target_user)} ~#{target_user}/ftp"
33
33
  end
34
-
35
- tmp_cron="/tmp/tmp_cron"
36
- sudo "rm -f #{tmp_cron} && crontab -l || true > #{tmp_cron}"
37
- cron_commands.compact.each do |cmd|
38
- run "echo '@reboot #{cmd}' >> #{tmp_cron}"
39
- end
40
- sudo "crontab #{tmp_cron}"
34
+ sudo_add_to_crontab(cron_commands.compact,'@reboot')
41
35
  end
42
36
  end
@@ -36,5 +36,11 @@ namespace :utils do
36
36
 
37
37
  sudo_and_watch_prompt("#{ruby_enterprise_path_prefix}/ruby-enterprise/bin/passenger-make-enterprisey", [/Key\:/, /again\:/])
38
38
  end
39
-
39
+
40
+ desc "Force fsck to check the disk at every boot."
41
+ task :force_fsck_at_every_boot, :roles => :gateway do
42
+ run "df"
43
+ partition = Capistrano::CLI.ui.ask("Which partition do you want to run a filesystem check on, on every boot? ")
44
+ sudo "tune2fs -c 1 #{partition}"
45
+ end
40
46
  end
@@ -17,6 +17,8 @@ Capistrano::Configuration.instance.load {load("#{File.dirname(__FILE__)}/ubuntu-
17
17
  Capistrano::Configuration.instance.load {load("#{File.dirname(__FILE__)}/ubuntu-machine/lmsensors.rb")}
18
18
  Capistrano::Configuration.instance.load {load("#{File.dirname(__FILE__)}/ubuntu-machine/machine.rb")}
19
19
  Capistrano::Configuration.instance.load {load("#{File.dirname(__FILE__)}/ubuntu-machine/mysql.rb")}
20
+ Capistrano::Configuration.instance.load {load("#{File.dirname(__FILE__)}/ubuntu-machine/network.rb")}
21
+ Capistrano::Configuration.instance.load {load("#{File.dirname(__FILE__)}/ubuntu-machine/ntp.rb")}
20
22
  Capistrano::Configuration.instance.load {load("#{File.dirname(__FILE__)}/ubuntu-machine/php.rb")}
21
23
  Capistrano::Configuration.instance.load {load("#{File.dirname(__FILE__)}/ubuntu-machine/postfix.rb")}
22
24
  Capistrano::Configuration.instance.load {load("#{File.dirname(__FILE__)}/ubuntu-machine/ruby.rb")}
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: FiXato-ubuntu-machine
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.3.2.7
4
+ version: 0.5.3.2.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thomas Balthazar
@@ -11,7 +11,7 @@ autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
13
 
14
- date: 2009-06-18 00:00:00 -07:00
14
+ date: 2009-06-22 00:00:00 -07:00
15
15
  default_executable:
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
@@ -47,6 +47,8 @@ files:
47
47
  - lib/capistrano/ext/ubuntu-machine/lmsensors.rb
48
48
  - lib/capistrano/ext/ubuntu-machine/machine.rb
49
49
  - lib/capistrano/ext/ubuntu-machine/mysql.rb
50
+ - lib/capistrano/ext/ubuntu-machine/network.rb
51
+ - lib/capistrano/ext/ubuntu-machine/ntp.rb
50
52
  - lib/capistrano/ext/ubuntu-machine/php.rb
51
53
  - lib/capistrano/ext/ubuntu-machine/postfix.rb
52
54
  - lib/capistrano/ext/ubuntu-machine/ruby.rb
@@ -58,6 +60,8 @@ files:
58
60
  - lib/capistrano/ext/ubuntu-machine/templates/iptables.erb
59
61
  - lib/capistrano/ext/ubuntu-machine/templates/my.cnf.erb
60
62
  - lib/capistrano/ext/ubuntu-machine/templates/new_db.erb
63
+ - lib/capistrano/ext/ubuntu-machine/templates/ntpdate.erb
64
+ - lib/capistrano/ext/ubuntu-machine/templates/ntp.conf.erb
61
65
  - lib/capistrano/ext/ubuntu-machine/templates/passenger.conf.erb
62
66
  - lib/capistrano/ext/ubuntu-machine/templates/passenger.load.erb
63
67
  - lib/capistrano/ext/ubuntu-machine/templates/sshd_config.erb