poolparty 1.3.4 → 1.3.6
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.
- data/Rakefile +2 -2
- data/VERSION.yml +1 -1
- data/bin/cloud-bootstrap +1 -0
- data/bin/cloud-configure +1 -0
- data/bin/cloud-contract +1 -0
- data/bin/cloud-misc +34 -0
- data/bin/cloud-setup +36 -0
- data/bin/cloud-ssh +4 -1
- data/config/jeweler.rb +4 -3
- data/examples/monitored_cloud.rb +1 -1
- data/examples/thrift/thrift_example.rb +5 -3
- data/examples/vmware.rb +28 -0
- data/lib/cloud_providers/cloud_provider_instance.rb +14 -5
- data/lib/cloud_providers/connections.rb +1 -1
- data/lib/core/file.rb +12 -0
- data/lib/core/object.rb +2 -2
- data/lib/dependency_resolvers/base.rb +1 -1
- data/lib/dependency_resolvers/chef.rb +9 -7
- data/lib/dependency_resolvers/proxy_object.rb +11 -3
- data/lib/mixins/askable.rb +16 -7
- data/lib/poolparty/base.rb +8 -7
- data/lib/poolparty/cloud.rb +77 -7
- data/lib/poolparty/default.rb +1 -0
- data/lib/poolparty/installer.rb +8 -4
- data/lib/poolparty/installers/ec2.rb +75 -5
- data/lib/poolparty/installers/vmware.rb +17 -5
- data/lib/poolparty/plugin.rb +1 -5
- data/lib/poolparty/plugins/apache.rb +10 -7
- data/lib/poolparty/plugins/apache2/base.conf.erb +2 -2
- data/lib/poolparty/plugins/apache2/browser_fixes.conf.erb +1 -1
- data/lib/poolparty/plugins/apache2/passenger_site.rb +2 -2
- data/lib/poolparty/plugins/collectd/templates/collectd.conf.erb +369 -0
- data/lib/poolparty/plugins/collectd.rb +24 -0
- data/lib/poolparty/plugins/hermes.rb +89 -0
- data/lib/poolparty/pool.rb +33 -3
- data/lib/poolparty/resource.rb +32 -18
- data/lib/poolparty/resources/directory.rb +5 -1
- data/lib/poolparty/resources/exec.rb +2 -2
- data/lib/poolparty/resources/file.rb +8 -2
- data/lib/poolparty/resources/gem_package.rb +2 -2
- data/lib/poolparty/resources/line.rb +23 -6
- data/lib/poolparty/resources/mount.rb +2 -2
- data/lib/poolparty/resources/package.rb +2 -2
- data/lib/poolparty/resources/service.rb +2 -2
- data/lib/poolparty/resources/user.rb +2 -2
- data/lib/poolparty/resources/variable.rb +4 -3
- data/lib/poolparty.rb +5 -3
- data/lib/proto/command_interface_handler.rb +17 -1
- data/lib/proto/gen-py/cloudthrift/CommandInterface.pyc +0 -0
- data/lib/proto/gen-py/cloudthrift/__init__.pyc +0 -0
- data/lib/proto/gen-py/cloudthrift/constants.pyc +0 -0
- data/lib/proto/gen-py/cloudthrift/ttypes.pyc +0 -0
- data/lib/proto/gen-py/thrift/Thrift.pyc +0 -0
- data/lib/proto/gen-py/thrift/__init__.pyc +0 -0
- data/lib/proto/gen-py/thrift/protocol/TBinaryProtocol.pyc +0 -0
- data/lib/proto/gen-py/thrift/protocol/TProtocol.pyc +0 -0
- data/lib/proto/gen-py/thrift/protocol/__init__.pyc +0 -0
- data/lib/proto/gen-py/thrift/transport/TSocket.pyc +0 -0
- data/lib/proto/gen-py/thrift/transport/TTransport.pyc +0 -0
- data/lib/proto/gen-py/thrift/transport/__init__.pyc +0 -0
- data/test/lib/dependency_resolvers/chef_test.rb +92 -100
- data/test/lib/poolparty/base_test.rb +13 -0
- data/test/lib/poolparty/cloud_test.rb +50 -2
- data/test/lib/poolparty/monitor_test.rb +2 -2
- data/test/lib/poolparty/resource_test.rb +5 -0
- data/test/lib/poolparty/resources/line_test.rb +3 -3
- data/test/lib/poolparty/resources/service_test.rb +1 -1
- data/test/lib/poolparty/resources/variable_test.rb +33 -10
- data/vendor/gems/net-ssh/CHANGELOG.rdoc +127 -0
- data/vendor/gems/net-ssh/Manifest +104 -0
- data/vendor/gems/net-ssh/README.rdoc +110 -0
- data/vendor/gems/net-ssh/Rakefile +26 -0
- data/vendor/gems/net-ssh/THANKS.rdoc +16 -0
- data/vendor/gems/net-ssh/lib/net/ssh/authentication/agent.rb +176 -0
- data/vendor/gems/net-ssh/lib/net/ssh/authentication/constants.rb +18 -0
- data/vendor/gems/net-ssh/lib/net/ssh/authentication/key_manager.rb +193 -0
- data/vendor/gems/net-ssh/lib/net/ssh/authentication/methods/abstract.rb +60 -0
- data/vendor/gems/net-ssh/lib/net/ssh/authentication/methods/hostbased.rb +71 -0
- data/vendor/gems/net-ssh/lib/net/ssh/authentication/methods/keyboard_interactive.rb +66 -0
- data/vendor/gems/net-ssh/lib/net/ssh/authentication/methods/password.rb +39 -0
- data/vendor/gems/net-ssh/lib/net/ssh/authentication/methods/publickey.rb +92 -0
- data/vendor/gems/net-ssh/lib/net/ssh/authentication/pageant.rb +183 -0
- data/vendor/gems/net-ssh/lib/net/ssh/authentication/session.rb +134 -0
- data/vendor/gems/net-ssh/lib/net/ssh/buffer.rb +340 -0
- data/vendor/gems/net-ssh/lib/net/ssh/buffered_io.rb +149 -0
- data/vendor/gems/net-ssh/lib/net/ssh/config.rb +181 -0
- data/vendor/gems/net-ssh/lib/net/ssh/connection/channel.rb +625 -0
- data/vendor/gems/net-ssh/lib/net/ssh/connection/constants.rb +33 -0
- data/vendor/gems/net-ssh/lib/net/ssh/connection/session.rb +596 -0
- data/vendor/gems/net-ssh/lib/net/ssh/connection/term.rb +178 -0
- data/vendor/gems/net-ssh/lib/net/ssh/errors.rb +85 -0
- data/vendor/gems/net-ssh/lib/net/ssh/key_factory.rb +102 -0
- data/vendor/gems/net-ssh/lib/net/ssh/known_hosts.rb +129 -0
- data/vendor/gems/net-ssh/lib/net/ssh/loggable.rb +61 -0
- data/vendor/gems/net-ssh/lib/net/ssh/packet.rb +102 -0
- data/vendor/gems/net-ssh/lib/net/ssh/prompt.rb +93 -0
- data/vendor/gems/net-ssh/lib/net/ssh/proxy/errors.rb +14 -0
- data/vendor/gems/net-ssh/lib/net/ssh/proxy/http.rb +94 -0
- data/vendor/gems/net-ssh/lib/net/ssh/proxy/socks4.rb +70 -0
- data/vendor/gems/net-ssh/lib/net/ssh/proxy/socks5.rb +129 -0
- data/vendor/gems/net-ssh/lib/net/ssh/ruby_compat.rb +7 -0
- data/vendor/gems/net-ssh/lib/net/ssh/service/forward.rb +267 -0
- data/vendor/gems/net-ssh/lib/net/ssh/test/channel.rb +129 -0
- data/vendor/gems/net-ssh/lib/net/ssh/test/extensions.rb +152 -0
- data/vendor/gems/net-ssh/lib/net/ssh/test/kex.rb +44 -0
- data/vendor/gems/net-ssh/lib/net/ssh/test/local_packet.rb +51 -0
- data/vendor/gems/net-ssh/lib/net/ssh/test/packet.rb +81 -0
- data/vendor/gems/net-ssh/lib/net/ssh/test/remote_packet.rb +38 -0
- data/vendor/gems/net-ssh/lib/net/ssh/test/script.rb +157 -0
- data/vendor/gems/net-ssh/lib/net/ssh/test/socket.rb +59 -0
- data/vendor/gems/net-ssh/lib/net/ssh/test.rb +89 -0
- data/vendor/gems/net-ssh/lib/net/ssh/transport/algorithms.rb +384 -0
- data/vendor/gems/net-ssh/lib/net/ssh/transport/cipher_factory.rb +80 -0
- data/vendor/gems/net-ssh/lib/net/ssh/transport/constants.rb +30 -0
- data/vendor/gems/net-ssh/lib/net/ssh/transport/hmac/abstract.rb +78 -0
- data/vendor/gems/net-ssh/lib/net/ssh/transport/hmac/md5.rb +12 -0
- data/vendor/gems/net-ssh/lib/net/ssh/transport/hmac/md5_96.rb +11 -0
- data/vendor/gems/net-ssh/lib/net/ssh/transport/hmac/none.rb +15 -0
- data/vendor/gems/net-ssh/lib/net/ssh/transport/hmac/sha1.rb +13 -0
- data/vendor/gems/net-ssh/lib/net/ssh/transport/hmac/sha1_96.rb +11 -0
- data/vendor/gems/net-ssh/lib/net/ssh/transport/hmac.rb +31 -0
- data/vendor/gems/net-ssh/lib/net/ssh/transport/identity_cipher.rb +55 -0
- data/vendor/gems/net-ssh/lib/net/ssh/transport/kex/diffie_hellman_group1_sha1.rb +208 -0
- data/vendor/gems/net-ssh/lib/net/ssh/transport/kex/diffie_hellman_group_exchange_sha1.rb +77 -0
- data/vendor/gems/net-ssh/lib/net/ssh/transport/kex.rb +13 -0
- data/vendor/gems/net-ssh/lib/net/ssh/transport/openssl.rb +128 -0
- data/vendor/gems/net-ssh/lib/net/ssh/transport/packet_stream.rb +230 -0
- data/vendor/gems/net-ssh/lib/net/ssh/transport/server_version.rb +60 -0
- data/vendor/gems/net-ssh/lib/net/ssh/transport/session.rb +276 -0
- data/vendor/gems/net-ssh/lib/net/ssh/transport/state.rb +201 -0
- data/vendor/gems/net-ssh/lib/net/ssh/verifiers/lenient.rb +30 -0
- data/vendor/gems/net-ssh/lib/net/ssh/verifiers/null.rb +12 -0
- data/vendor/gems/net-ssh/lib/net/ssh/verifiers/strict.rb +53 -0
- data/vendor/gems/net-ssh/lib/net/ssh/version.rb +62 -0
- data/vendor/gems/net-ssh/lib/net/ssh.rb +215 -0
- data/vendor/gems/net-ssh/net-ssh.gemspec +33 -0
- data/vendor/gems/net-ssh/setup.rb +1585 -0
- data/vendor/gems/net-ssh/test/authentication/methods/common.rb +28 -0
- data/vendor/gems/net-ssh/test/authentication/methods/test_abstract.rb +51 -0
- data/vendor/gems/net-ssh/test/authentication/methods/test_hostbased.rb +114 -0
- data/vendor/gems/net-ssh/test/authentication/methods/test_keyboard_interactive.rb +98 -0
- data/vendor/gems/net-ssh/test/authentication/methods/test_password.rb +50 -0
- data/vendor/gems/net-ssh/test/authentication/methods/test_publickey.rb +127 -0
- data/vendor/gems/net-ssh/test/authentication/test_agent.rb +205 -0
- data/vendor/gems/net-ssh/test/authentication/test_key_manager.rb +105 -0
- data/vendor/gems/net-ssh/test/authentication/test_session.rb +93 -0
- data/vendor/gems/net-ssh/test/common.rb +106 -0
- data/vendor/gems/net-ssh/test/configs/eqsign +3 -0
- data/vendor/gems/net-ssh/test/configs/exact_match +8 -0
- data/vendor/gems/net-ssh/test/configs/wild_cards +14 -0
- data/vendor/gems/net-ssh/test/connection/test_channel.rb +452 -0
- data/vendor/gems/net-ssh/test/connection/test_session.rb +488 -0
- data/vendor/gems/net-ssh/test/test_all.rb +6 -0
- data/vendor/gems/net-ssh/test/test_buffer.rb +336 -0
- data/vendor/gems/net-ssh/test/test_buffered_io.rb +63 -0
- data/vendor/gems/net-ssh/test/test_config.rb +84 -0
- data/vendor/gems/net-ssh/test/test_key_factory.rb +67 -0
- data/vendor/gems/net-ssh/test/transport/hmac/test_md5.rb +39 -0
- data/vendor/gems/net-ssh/test/transport/hmac/test_md5_96.rb +25 -0
- data/vendor/gems/net-ssh/test/transport/hmac/test_none.rb +34 -0
- data/vendor/gems/net-ssh/test/transport/hmac/test_sha1.rb +34 -0
- data/vendor/gems/net-ssh/test/transport/hmac/test_sha1_96.rb +25 -0
- data/vendor/gems/net-ssh/test/transport/kex/test_diffie_hellman_group1_sha1.rb +146 -0
- data/vendor/gems/net-ssh/test/transport/kex/test_diffie_hellman_group_exchange_sha1.rb +92 -0
- data/vendor/gems/net-ssh/test/transport/test_algorithms.rb +302 -0
- data/vendor/gems/net-ssh/test/transport/test_cipher_factory.rb +171 -0
- data/vendor/gems/net-ssh/test/transport/test_hmac.rb +34 -0
- data/vendor/gems/net-ssh/test/transport/test_identity_cipher.rb +40 -0
- data/vendor/gems/net-ssh/test/transport/test_packet_stream.rb +435 -0
- data/vendor/gems/net-ssh/test/transport/test_server_version.rb +57 -0
- data/vendor/gems/net-ssh/test/transport/test_session.rb +315 -0
- data/vendor/gems/net-ssh/test/transport/test_state.rb +173 -0
- metadata +116 -4
- data/bin/install-poolparty +0 -20
|
@@ -4,7 +4,8 @@ module PoolParty
|
|
|
4
4
|
|
|
5
5
|
def steps
|
|
6
6
|
[
|
|
7
|
-
:
|
|
7
|
+
:find_ec2_directory, :ask_for_access_key, :ask_for_private_access_key,
|
|
8
|
+
:show_env_setup
|
|
8
9
|
]
|
|
9
10
|
end
|
|
10
11
|
|
|
@@ -16,15 +17,84 @@ module PoolParty
|
|
|
16
17
|
"Ec2 installer"
|
|
17
18
|
end
|
|
18
19
|
|
|
19
|
-
def
|
|
20
|
+
def find_ec2_directory
|
|
21
|
+
msg = "We found the following vmware files in the default vmware directory.\nChoose one of these to use as your vmrun file or select other\n<line>"
|
|
22
|
+
|
|
23
|
+
directories = {}
|
|
24
|
+
default_ec2_directories.each_with_index do |file,idx|
|
|
25
|
+
directories.merge!(idx+1 => file)
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
base = choose(msg, directories)
|
|
29
|
+
@ec2_directory = base == :other ? ask_for_ec2_directory : base
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
def ask_for_access_key
|
|
33
|
+
access_key_help =<<-EOV
|
|
34
|
+
EC2 uses an access key to identify you and allows you to start and stop instances.
|
|
35
|
+
EOV
|
|
36
|
+
|
|
37
|
+
access_key = <<-EOE
|
|
38
|
+
What is your access key?
|
|
39
|
+
EOE
|
|
40
|
+
ask_with_help :message => access_key, :help => access_key_help do |k|
|
|
41
|
+
@access_key = k
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
def ask_for_private_access_key
|
|
46
|
+
private_access_key_help =<<-EOV
|
|
47
|
+
EC2 uses a private access key to identify you and allows you to start and stop instances.
|
|
48
|
+
EOV
|
|
49
|
+
|
|
50
|
+
private_access_key = <<-EOE
|
|
51
|
+
What is your private access key?
|
|
52
|
+
EOE
|
|
53
|
+
ask_with_help :message => private_access_key, :help => private_access_key_help do |k|
|
|
54
|
+
@secret_access_key = k
|
|
55
|
+
end
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
def ask_for_ec2_directory
|
|
60
|
+
ec2_directory_help =<<-EOV
|
|
61
|
+
Ec2 needs to know where you store your certificates and private keys. Amazon expects these to be in the ~/.ec2 directory. We suggest a subdirectory of the ~/.ec2 directory so you can separate ec2 accounts.
|
|
62
|
+
EOV
|
|
63
|
+
|
|
64
|
+
ec2_directory_msg = <<-EOE
|
|
65
|
+
What's path to your ec2 directory with your cert and pk files?
|
|
66
|
+
EOE
|
|
67
|
+
ask_with_help :message => ec2_directory_msg, :help => ec2_directory_help
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
def show_env_setup
|
|
20
72
|
colored_say <<-EOE
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
73
|
+
<line>
|
|
74
|
+
|
|
75
|
+
Setup your environment:
|
|
76
|
+
|
|
77
|
+
export EC2_ACCESS_KEY=#{@access_key}
|
|
78
|
+
export EC2_SECRET_KEY=#{@secret_access_key}
|
|
79
|
+
|
|
80
|
+
export EC2_PRIVATE_KEY=$(ls #{@ec2_directory}/pk-*.pem)
|
|
81
|
+
export EC2_CERT=$(ls #{@ec2_directory}/cert-*.pem)
|
|
82
|
+
|
|
83
|
+
<line>
|
|
24
84
|
EOE
|
|
25
85
|
exit 0
|
|
26
86
|
end
|
|
27
87
|
|
|
88
|
+
private
|
|
89
|
+
|
|
90
|
+
def default_ec2_directories
|
|
91
|
+
@default_ec2_directories ||= find_default_ec2_directories rescue nil
|
|
92
|
+
end
|
|
93
|
+
|
|
94
|
+
def find_default_ec2_directories
|
|
95
|
+
Dir["#{::File.expand_path("~")}/.ec2/*"].reject {|f| File.file?(f) }
|
|
96
|
+
end
|
|
97
|
+
|
|
28
98
|
end
|
|
29
99
|
end
|
|
30
100
|
end
|
|
@@ -59,9 +59,14 @@ Awesome. What's the path to your vmwarevm file?
|
|
|
59
59
|
ip_help =<<-EOV
|
|
60
60
|
Right now, vmrun, the remoter base needs an explicitly set ip. Log into your vm and type ifconfig. Copy and paste that here.
|
|
61
61
|
EOV
|
|
62
|
-
@ip = ask_with_help :message => "
|
|
62
|
+
@ip = ask_with_help :message => "what's the ip of your vm?", :help => ip_help
|
|
63
63
|
|
|
64
|
-
|
|
64
|
+
if @ip =~ /\b\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\b/
|
|
65
|
+
@ip
|
|
66
|
+
else
|
|
67
|
+
colored_say "<red>You must enter a valid ip</red>"
|
|
68
|
+
get_vm_ip
|
|
69
|
+
end
|
|
65
70
|
end
|
|
66
71
|
|
|
67
72
|
def get_key
|
|
@@ -70,9 +75,16 @@ Finally, we'll set somethings up here shortly, but first we'll need to know wher
|
|
|
70
75
|
at ~/.ssh/id_rsa.pub. If this is true, then just press enter. Otherwise, enter the path of your public key.
|
|
71
76
|
EOV
|
|
72
77
|
|
|
73
|
-
ask_with_help :message => "What keypair would you like to use? (default: ~/.ssh/id_rsa.pub)",
|
|
74
|
-
|
|
75
|
-
|
|
78
|
+
ask_with_help :message => "What keypair would you like to use? (default: ~/.ssh/id_rsa.pub)", :help => key_help do |responded_key|
|
|
79
|
+
responded_key = "~/.ssh/id_rsa.pub" if responded_key.empty?
|
|
80
|
+
|
|
81
|
+
@key = File.expand_path(responded_key)
|
|
82
|
+
if File.file?(@key)
|
|
83
|
+
@key
|
|
84
|
+
else
|
|
85
|
+
colored_say "<red>You must enter a valid path to a keyfile</red>"
|
|
86
|
+
get_key
|
|
87
|
+
end
|
|
76
88
|
end
|
|
77
89
|
end
|
|
78
90
|
|
data/lib/poolparty/plugin.rb
CHANGED
|
@@ -2,11 +2,7 @@
|
|
|
2
2
|
Simply a stub class for documentation purposes
|
|
3
3
|
Plugins are all resources
|
|
4
4
|
=end
|
|
5
|
-
module PoolParty
|
|
6
|
-
class Plugin
|
|
7
|
-
end
|
|
8
|
-
end
|
|
9
5
|
|
|
10
|
-
%w(apache git rails).each do |plugin|
|
|
6
|
+
%w(apache git rails collectd hermes).each do |plugin|
|
|
11
7
|
require "plugins/#{plugin}"
|
|
12
8
|
end
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
module PoolParty
|
|
2
|
+
|
|
2
3
|
module Resources
|
|
3
4
|
|
|
4
5
|
class Apache < Resource
|
|
@@ -49,12 +50,12 @@ module PoolParty
|
|
|
49
50
|
passenger_configs
|
|
50
51
|
|
|
51
52
|
has_exec "install_passenger_script" do
|
|
52
|
-
command
|
|
53
|
+
command "passenger-install-apache2-module --auto"
|
|
53
54
|
notifies get_exec("restart-apache2"), :run
|
|
54
55
|
requires get_exec("restart-apache2")
|
|
55
56
|
requires get_package("apache2")
|
|
56
57
|
requires get_gem_package("passenger")
|
|
57
|
-
not_if "test -f /etc/apache2/mods-available/passenger.conf && test -s /etc/apache2/mods-available/passenger.conf"
|
|
58
|
+
not_if "test -f /etc/apache2/mods-available/passenger.conf && test -s /etc/apache2/mods-available/passenger.conf "
|
|
58
59
|
creates lambda { "@node[:apache][:passenger_module_path]" }
|
|
59
60
|
end
|
|
60
61
|
|
|
@@ -156,14 +157,16 @@ PassengerRuby <%= @node[:languages][:ruby][:ruby_bin] %>
|
|
|
156
157
|
end
|
|
157
158
|
|
|
158
159
|
def install_site(name, opts={})
|
|
159
|
-
|
|
160
|
+
sitename = name
|
|
161
|
+
|
|
162
|
+
opts.merge!(:name => "/etc/apache2/sites-available/#{sitename}")
|
|
160
163
|
has_directory(:name => "/etc/apache2/sites-available")
|
|
161
164
|
has_file(opts) unless opts[:no_file]
|
|
162
|
-
has_exec(:name => "/usr/sbin/a2ensite #{
|
|
165
|
+
has_exec(:name => "/usr/sbin/a2ensite #{sitename}") do
|
|
163
166
|
notifies get_exec("reload-apache2"), :run
|
|
164
167
|
requires get_exec("reload-apache2")
|
|
165
|
-
requires get_file("/etc/apache2/sites-available/#{
|
|
166
|
-
not_if "/bin/sh -c '[ -L /etc/apache2/sites-enabled/#{
|
|
168
|
+
requires get_file("/etc/apache2/sites-available/#{sitename}")
|
|
169
|
+
not_if "/bin/sh -c '[ -L /etc/apache2/sites-enabled/#{sitename} ] && [ /etc/apache2/sites-enabled/#{sitename} -ef /etc/apache2/sites-available/#{sitename} ]'"
|
|
167
170
|
end
|
|
168
171
|
end
|
|
169
172
|
|
|
@@ -201,4 +204,4 @@ end
|
|
|
201
204
|
$:.unshift(File.dirname(__FILE__))
|
|
202
205
|
%w(php5 virtual_host passenger_site).each do |lib|
|
|
203
206
|
require "apache2/#{lib}"
|
|
204
|
-
end
|
|
207
|
+
end
|
|
@@ -162,10 +162,10 @@ LogFormat "%h %l %u %t \"%r\" %>s %b" common
|
|
|
162
162
|
LogFormat "%{Referer}i -> %U" referer
|
|
163
163
|
LogFormat "%{User-agent}i" agent
|
|
164
164
|
|
|
165
|
-
DocumentRoot /var/www
|
|
165
|
+
#DocumentRoot /var/www
|
|
166
166
|
|
|
167
167
|
# Listen <%= @node[:apache][:port] %>
|
|
168
|
-
NameVirtualHost *:<%= @node[:apache][:port] %>
|
|
168
|
+
#NameVirtualHost *:<%= @node[:apache][:port] %>
|
|
169
169
|
|
|
170
170
|
|
|
171
171
|
# NEW CONFIG FILE
|
|
@@ -32,9 +32,9 @@ module PoolParty
|
|
|
32
32
|
if !File.exists?("#{dir}/#{name}/current")
|
|
33
33
|
|
|
34
34
|
# setup an initial symlink so apache will start even if there have not been any deploys yet
|
|
35
|
-
has_site_directory "releases/initial/public"
|
|
35
|
+
#has_site_directory "releases/initial/public"
|
|
36
36
|
#FIXME the following line is chef specific. It will fail with puppet
|
|
37
|
-
|
|
37
|
+
has_link(:target_file => "#{dir}/#{name}/current", :to => "#{dir}/#{name}/releases/initial")
|
|
38
38
|
end
|
|
39
39
|
log_dir = "#{site_directory}/shared/log"
|
|
40
40
|
appended_path "current"
|
|
@@ -0,0 +1,369 @@
|
|
|
1
|
+
# Config file for collectd(1).
|
|
2
|
+
#
|
|
3
|
+
# Some plugins need additional configuration and are disabled by default.
|
|
4
|
+
# Please read collectd.conf(5) for details.
|
|
5
|
+
#
|
|
6
|
+
# You should also read /usr/share/doc/collectd/README.Debian.plugins before
|
|
7
|
+
# enabling any more plugins.
|
|
8
|
+
|
|
9
|
+
#Hostname "localhost"
|
|
10
|
+
FQDNLookup true
|
|
11
|
+
#BaseDir "/var/lib/collectd"
|
|
12
|
+
#PluginDir "/usr/lib/collectd"
|
|
13
|
+
#TypesDB "/usr/lib/collectd/types.db" "/etc/collectd/my_types.db"
|
|
14
|
+
#Interval 10
|
|
15
|
+
#ReadThreads 5
|
|
16
|
+
|
|
17
|
+
#LoadPlugin logfile
|
|
18
|
+
LoadPlugin syslog
|
|
19
|
+
|
|
20
|
+
#<Plugin logfile>
|
|
21
|
+
# LogLevel "info"
|
|
22
|
+
# File STDOUT
|
|
23
|
+
# Timestamp true
|
|
24
|
+
#</Plugin>
|
|
25
|
+
|
|
26
|
+
<Plugin syslog>
|
|
27
|
+
LogLevel info
|
|
28
|
+
</Plugin>
|
|
29
|
+
|
|
30
|
+
#LoadPlugin apache
|
|
31
|
+
#LoadPlugin apcups
|
|
32
|
+
#LoadPlugin ascent
|
|
33
|
+
#LoadPlugin battery
|
|
34
|
+
LoadPlugin cpu
|
|
35
|
+
#LoadPlugin cpufreq
|
|
36
|
+
LoadPlugin csv
|
|
37
|
+
# LoadPlugin df
|
|
38
|
+
LoadPlugin disk
|
|
39
|
+
#LoadPlugin dns
|
|
40
|
+
#LoadPlugin email
|
|
41
|
+
#LoadPlugin entropy
|
|
42
|
+
#LoadPlugin exec
|
|
43
|
+
#LoadPlugin hddtemp
|
|
44
|
+
LoadPlugin interface
|
|
45
|
+
#LoadPlugin ipmi
|
|
46
|
+
LoadPlugin iptables
|
|
47
|
+
#LoadPlugin ipvs
|
|
48
|
+
#LoadPlugin irq
|
|
49
|
+
LoadPlugin libvirt
|
|
50
|
+
LoadPlugin load
|
|
51
|
+
#LoadPlugin mbmon
|
|
52
|
+
#LoadPlugin memcached
|
|
53
|
+
LoadPlugin memory
|
|
54
|
+
#LoadPlugin multimeter
|
|
55
|
+
#LoadPlugin mysql
|
|
56
|
+
#LoadPlugin netlink
|
|
57
|
+
LoadPlugin network
|
|
58
|
+
# LoadPlugin nfs
|
|
59
|
+
#LoadPlugin nginx
|
|
60
|
+
#LoadPlugin ntpd
|
|
61
|
+
#LoadPlugin nut
|
|
62
|
+
#LoadPlugin perl
|
|
63
|
+
#LoadPlugin ping
|
|
64
|
+
#LoadPlugin powerdns
|
|
65
|
+
# LoadPlugin processes
|
|
66
|
+
LoadPlugin rrdtool
|
|
67
|
+
#LoadPlugin sensors
|
|
68
|
+
#LoadPlugin serial
|
|
69
|
+
#LoadPlugin snmp
|
|
70
|
+
# LoadPlugin swap
|
|
71
|
+
#LoadPlugin tail
|
|
72
|
+
LoadPlugin tcpconns
|
|
73
|
+
#LoadPlugin teamspeak2
|
|
74
|
+
#LoadPlugin unixsock
|
|
75
|
+
LoadPlugin users
|
|
76
|
+
LoadPlugin uuid
|
|
77
|
+
#LoadPlugin vmem
|
|
78
|
+
#LoadPlugin vserver
|
|
79
|
+
#LoadPlugin wireless
|
|
80
|
+
|
|
81
|
+
#<Plugin apache>
|
|
82
|
+
# URL "http://localhost/status?auto"
|
|
83
|
+
# User "www-user"
|
|
84
|
+
# Password "secret"
|
|
85
|
+
# VerifyPeer false
|
|
86
|
+
# VerifyHost false
|
|
87
|
+
# CACert "/etc/ssl/ca.crt"
|
|
88
|
+
#</Plugin>
|
|
89
|
+
|
|
90
|
+
#<Plugin apcups>
|
|
91
|
+
# Host "localhost"
|
|
92
|
+
# Port "3551"
|
|
93
|
+
#</Plugin>
|
|
94
|
+
|
|
95
|
+
#<Plugin ascent>
|
|
96
|
+
# URL "http://localhost/ascent/status/"
|
|
97
|
+
# User "www-user"
|
|
98
|
+
# Password "secret"
|
|
99
|
+
# CACert "/etc/ssl/ca.crt"
|
|
100
|
+
#</Plugin>
|
|
101
|
+
|
|
102
|
+
#<Plugin csv>
|
|
103
|
+
# DataDir "/var/lib/collectd/csv"
|
|
104
|
+
# StoreRates false
|
|
105
|
+
#</Plugin>
|
|
106
|
+
|
|
107
|
+
#<Plugin df>
|
|
108
|
+
# Device "/dev/sda1"
|
|
109
|
+
# Device "192.168.0.2:/mnt/nfs"
|
|
110
|
+
# MountPoint "/home/eucalyptus"
|
|
111
|
+
# FSType "ext3"
|
|
112
|
+
# IgnoreSelected false
|
|
113
|
+
# </Plugin>
|
|
114
|
+
|
|
115
|
+
#<Plugin disk>
|
|
116
|
+
# Disk "hda"
|
|
117
|
+
# Disk "/sda[23]/"
|
|
118
|
+
# IgnoreSelected false
|
|
119
|
+
#</Plugin>
|
|
120
|
+
|
|
121
|
+
#<Plugin dns>
|
|
122
|
+
# Interface "eth0"
|
|
123
|
+
# IgnoreSource "192.168.0.1"
|
|
124
|
+
#</Plugin>
|
|
125
|
+
|
|
126
|
+
#<Plugin email>
|
|
127
|
+
# SocketGroup "collectd"
|
|
128
|
+
# SocketPerms "0770"
|
|
129
|
+
# MaxConns 5
|
|
130
|
+
#</Plugin>
|
|
131
|
+
|
|
132
|
+
#<Plugin exec>
|
|
133
|
+
# Exec user "/path/to/exec"
|
|
134
|
+
# Exec "user:group" "/path/to/exec"
|
|
135
|
+
# NotificationExec user "/path/to/exec"
|
|
136
|
+
#</Plugin>
|
|
137
|
+
|
|
138
|
+
#<Plugin hddtemp>
|
|
139
|
+
# Host "127.0.0.1"
|
|
140
|
+
# Port 7634
|
|
141
|
+
# TranslateDevicename false
|
|
142
|
+
#</Plugin>
|
|
143
|
+
|
|
144
|
+
#<Plugin interface>
|
|
145
|
+
# Interface "eth0"
|
|
146
|
+
# IgnoreSelected false
|
|
147
|
+
#</Plugin>
|
|
148
|
+
|
|
149
|
+
#<Plugin iptables>
|
|
150
|
+
# Chain "table" "chain"
|
|
151
|
+
#</Plugin>
|
|
152
|
+
|
|
153
|
+
#<Plugin irq>
|
|
154
|
+
# Irq 7
|
|
155
|
+
# Irq 8
|
|
156
|
+
# Irq 9
|
|
157
|
+
# IgnoreSelected true
|
|
158
|
+
#</Plugin>
|
|
159
|
+
|
|
160
|
+
<Plugin libvirt>
|
|
161
|
+
Connection "qemu:///system"
|
|
162
|
+
# Connection "xen:///"
|
|
163
|
+
RefreshInterval 10
|
|
164
|
+
# Domain "name"
|
|
165
|
+
# BlockDevice "name:device"
|
|
166
|
+
# InterfaceDevice "name:device"
|
|
167
|
+
# IgnoreSelected false
|
|
168
|
+
HostnameFormat hostname name
|
|
169
|
+
</Plugin>
|
|
170
|
+
|
|
171
|
+
#<Plugin mbmon>
|
|
172
|
+
# Host "127.0.0.1"
|
|
173
|
+
# Port 411
|
|
174
|
+
#</Plugin>
|
|
175
|
+
|
|
176
|
+
#<Plugin memcached>
|
|
177
|
+
# Host "127.0.0.1"
|
|
178
|
+
# Port "11211"
|
|
179
|
+
#</Plugin>
|
|
180
|
+
|
|
181
|
+
#<Plugin mysql>
|
|
182
|
+
# Host "database.serv.er"
|
|
183
|
+
# User "db_user"
|
|
184
|
+
# Password "secret"
|
|
185
|
+
# Database "db_name"
|
|
186
|
+
#</Plugin>
|
|
187
|
+
|
|
188
|
+
#<Plugin netlink>
|
|
189
|
+
# Interface "All"
|
|
190
|
+
# VerboseInterface "All"
|
|
191
|
+
# QDisc "eth0" "pfifo_fast-1:0"
|
|
192
|
+
# Class "ppp0" "htb-1:10"
|
|
193
|
+
# Filter "ppp0" "u32-1:0"
|
|
194
|
+
# IgnoreSelected false
|
|
195
|
+
#</Plugin>
|
|
196
|
+
|
|
197
|
+
<Plugin network>
|
|
198
|
+
<%= "Server #{@node[:collectd][:server]}" %>
|
|
199
|
+
Listen "<%= @node.ipaddress %>"
|
|
200
|
+
# Server "ff18::efc0:4a42" "25826"
|
|
201
|
+
# Server "239.192.74.66" "25826"
|
|
202
|
+
# Listen "ff18::efc0:4a42" "25826"
|
|
203
|
+
# Listen "239.192.74.66" "25826"
|
|
204
|
+
# TimeToLive "128"
|
|
205
|
+
# Forward false
|
|
206
|
+
# CacheFlush 1800
|
|
207
|
+
</Plugin>
|
|
208
|
+
|
|
209
|
+
#<Plugin nginx>
|
|
210
|
+
# URL "http://localhost/status?auto"
|
|
211
|
+
# User "www-user"
|
|
212
|
+
# Password "secret"
|
|
213
|
+
# VerifyPeer false
|
|
214
|
+
# VerifyHost false
|
|
215
|
+
# CACert "/etc/ssl/ca.crt"
|
|
216
|
+
#</Plugin>
|
|
217
|
+
|
|
218
|
+
#<Plugin ntpd>
|
|
219
|
+
# Host "localhost"
|
|
220
|
+
# Port 123
|
|
221
|
+
# ReverseLookups false
|
|
222
|
+
#</Plugin>
|
|
223
|
+
|
|
224
|
+
#<Plugin nut>
|
|
225
|
+
# UPS "upsname@hostname:port"
|
|
226
|
+
#</Plugin>
|
|
227
|
+
|
|
228
|
+
#<Plugin perl>
|
|
229
|
+
# IncludeDir "/my/include/path"
|
|
230
|
+
# BaseName "Collectd::Plugin"
|
|
231
|
+
# EnableDebugger ""
|
|
232
|
+
# LoadPlugin "foo"
|
|
233
|
+
# LoadPlugin "bar"
|
|
234
|
+
#</Plugin>
|
|
235
|
+
|
|
236
|
+
#<Plugin ping>
|
|
237
|
+
# Host "host.foo.bar"
|
|
238
|
+
# Host "host.baz.qux"
|
|
239
|
+
# TTL 255
|
|
240
|
+
#</Plugin>
|
|
241
|
+
|
|
242
|
+
#<Plugin powerdns>
|
|
243
|
+
# <Server "server_name">
|
|
244
|
+
# Collect "latency"
|
|
245
|
+
# Collect "udp-answers" "udp-queries"
|
|
246
|
+
# Socket "/var/run/pdns.controlsocket"
|
|
247
|
+
# </Server>
|
|
248
|
+
# <Recursor "recursor_name">
|
|
249
|
+
# Collect "questions"
|
|
250
|
+
# Collect "cache-hits" "cache-misses"
|
|
251
|
+
# Socket "/var/run/pdns_recursor.controlsocket"
|
|
252
|
+
# </Recursor>
|
|
253
|
+
# LocalSocket "/opt/collectd/var/run/collectd-powerdns"
|
|
254
|
+
#</Plugin>
|
|
255
|
+
|
|
256
|
+
#<Plugin processes>
|
|
257
|
+
# Process "name"
|
|
258
|
+
#</Plugin>
|
|
259
|
+
|
|
260
|
+
<Plugin rrdtool>
|
|
261
|
+
DataDir "/var/lib/collectd/rrd"
|
|
262
|
+
# CacheTimeout 120
|
|
263
|
+
# CacheFlush 900
|
|
264
|
+
#
|
|
265
|
+
# The following settings are rather advanced
|
|
266
|
+
# and should usually not be touched:
|
|
267
|
+
# StepSize 10
|
|
268
|
+
# HeartBeat 20
|
|
269
|
+
# RRARows 1200
|
|
270
|
+
# RRATimespan 158112000
|
|
271
|
+
# XFF 0.1
|
|
272
|
+
</Plugin>
|
|
273
|
+
|
|
274
|
+
#<Plugin sensors>
|
|
275
|
+
# Sensor "it8712-isa-0290/temperature-temp1"
|
|
276
|
+
# Sensor "it8712-isa-0290/fanspeed-fan3"
|
|
277
|
+
# Sensor "it8712-isa-0290/voltage-in8"
|
|
278
|
+
# IgnoreSelected false
|
|
279
|
+
#</Plugin>
|
|
280
|
+
|
|
281
|
+
# See /usr/share/doc/collectd/examples/snmp-data.conf.gz for a
|
|
282
|
+
# comprehensive sample configuration.
|
|
283
|
+
#<Plugin snmp>
|
|
284
|
+
# <Data "powerplus_voltge_input">
|
|
285
|
+
# Type "voltage"
|
|
286
|
+
# Table false
|
|
287
|
+
# Instance "input_line1"
|
|
288
|
+
# Values "SNMPv2-SMI::enterprises.6050.5.4.1.1.2.1"
|
|
289
|
+
# </Data>
|
|
290
|
+
# <Data "hr_users">
|
|
291
|
+
# Type "users"
|
|
292
|
+
# Table false
|
|
293
|
+
# Instance ""
|
|
294
|
+
# Values "HOST-RESOURCES-MIB::hrSystemNumUsers.0"
|
|
295
|
+
# </Data>
|
|
296
|
+
# <Data "std_traffic">
|
|
297
|
+
# Type "if_octets"
|
|
298
|
+
# Table true
|
|
299
|
+
# Instance "IF-MIB::ifDescr"
|
|
300
|
+
# Values "IF-MIB::ifInOctets" "IF-MIB::ifOutOctets"
|
|
301
|
+
# </Data>
|
|
302
|
+
#
|
|
303
|
+
# <Host "some.switch.mydomain.org">
|
|
304
|
+
# Address "192.168.0.2"
|
|
305
|
+
# Version 1
|
|
306
|
+
# Community "community_string"
|
|
307
|
+
# Collect "std_traffic"
|
|
308
|
+
# Inverval 120
|
|
309
|
+
# </Host>
|
|
310
|
+
# <Host "some.server.mydomain.org">
|
|
311
|
+
# Address "192.168.0.42"
|
|
312
|
+
# Version 2
|
|
313
|
+
# Community "another_string"
|
|
314
|
+
# Collect "std_traffic" "hr_users"
|
|
315
|
+
# </Host>
|
|
316
|
+
# <Host "some.ups.mydomain.org">
|
|
317
|
+
# Address "192.168.0.3"
|
|
318
|
+
# Version 1
|
|
319
|
+
# Community "more_communities"
|
|
320
|
+
# Collect "powerplus_voltge_input"
|
|
321
|
+
# Interval 300
|
|
322
|
+
# </Host>
|
|
323
|
+
#</Plugin>
|
|
324
|
+
|
|
325
|
+
#<Plugin "tail">
|
|
326
|
+
# <File "/var/log/exim4/mainlog">
|
|
327
|
+
# Instance "exim"
|
|
328
|
+
# <Match>
|
|
329
|
+
# Regex "S=([1-9][0-9]*)"
|
|
330
|
+
# DSType "CounterAdd"
|
|
331
|
+
# Type "ipt_bytes"
|
|
332
|
+
# Instance "total"
|
|
333
|
+
# </Match>
|
|
334
|
+
# <Match>
|
|
335
|
+
# Regex "\\<R=local_user\\>"
|
|
336
|
+
# DSType "CounterInc"
|
|
337
|
+
# Type "counter"
|
|
338
|
+
# Instance "local_user"
|
|
339
|
+
# </Match>
|
|
340
|
+
# </File>
|
|
341
|
+
#</Plugin>
|
|
342
|
+
|
|
343
|
+
#<Plugin tcpconns>
|
|
344
|
+
# ListeningPorts false
|
|
345
|
+
# LocalPort "25"
|
|
346
|
+
# RemotePort "25"
|
|
347
|
+
#</Plugin>
|
|
348
|
+
|
|
349
|
+
#<Plugin teamspeak2>
|
|
350
|
+
# Host "127.0.0.1"
|
|
351
|
+
# Port "51234"
|
|
352
|
+
# Server "8767"
|
|
353
|
+
#</Plugin>
|
|
354
|
+
|
|
355
|
+
#<Plugin unixsock>
|
|
356
|
+
# SocketFile "/var/run/collectd-unixsock"
|
|
357
|
+
# SocketGroup "collectd"
|
|
358
|
+
# SocketPerms "0660"
|
|
359
|
+
#</Plugin>
|
|
360
|
+
|
|
361
|
+
#<Plugin uuid>
|
|
362
|
+
# UUIDFile "/etc/uuid"
|
|
363
|
+
#</Plugin>
|
|
364
|
+
|
|
365
|
+
#<Plugin vmem>
|
|
366
|
+
# Verbose false
|
|
367
|
+
#</Plugin>
|
|
368
|
+
|
|
369
|
+
Include "/etc/collectd/thresholds.conf"
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
module PoolParty
|
|
2
|
+
module Resources
|
|
3
|
+
|
|
4
|
+
class Collectd < Resource
|
|
5
|
+
|
|
6
|
+
PoolParty::Resources::FileResource.has_searchable_paths(:prepend_paths=> [File.dirname(__FILE__)+'/collectd/templates'])
|
|
7
|
+
|
|
8
|
+
def after_loaded
|
|
9
|
+
has_package 'collectd'
|
|
10
|
+
%w(rrdtool librrd-dev librrd-ruby libsensors-dev libsnmp-dev collectd collectd-dev).each{|pkg|
|
|
11
|
+
has_package pkg
|
|
12
|
+
}
|
|
13
|
+
has_gem_package "astro-collectd"
|
|
14
|
+
|
|
15
|
+
has_variable 'server', "localhost"
|
|
16
|
+
has_file '/etc/collectd/collectd.conf' do
|
|
17
|
+
template 'collectd.conf.erb'
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
end
|
|
24
|
+
end
|