Sha256: a429a25124c284240c15f4aeff8d2e3de7be5084fc8676a14f00531de9b1a2ae
Contents?: true
Size: 1.98 KB
Versions: 1
Compression:
Stored size: 1.98 KB
Contents
module PoolParty class Base plugin :haproxy do def enable execute_on_master do has_package({:name => "haproxy"}) # Service is required has_service(:name => "haproxy", :ensures => "running") # Restart sysklogd after we update the haproxy.log has_service(:name => "sysklogd", :notify => get_service("haproxy")) # Template variables has_variable(:name => "name_haproxy", :value => "#{cloud.name}") has_variable(:name => "nodenames_haproxy", :value => "generate('/usr/bin/env', '/usr/bin/server-list-active', '-c', 'name', '-n', '#{cloud.name}')") has_variable(:name => "node_ips_haproxy", :value => "generate('/usr/bin/env', '/usr/bin/server-list-active', '-c', 'ip', '-n', '#{cloud.name}')") has_variable(:name => "ports_haproxy", :value => ([(self.respond_to?(:port) ? port : Base.port)].flatten)) has_variable(:name => "forwarding_port", :value => (respond_to?(:forwarding_port) ? forwarding_port : Base.forwarding_port)) has_variable(:name => "proxy_mode", :value => (respond_to?(:proxy_mode) ? proxy_mode : Base.proxy_mode)) # Startup haproxy and enable it has_line_in_file("ENABLED=1", "/etc/default/haproxy") has_line_in_file("SYSLOGD=\"-r\"", "/etc/default/syslogd") has_line_in_file("local0.* /var/log/haproxy.log", "/etc/syslog.conf", {:notify => get_service("sysklogd")}) # has_exec(:name => "reloadhaproxy", :command => "/etc/init.d/haproxy reload", :requires => get_package("haproxy")) # These can also be passed in via hash has_remotefile(:name => "/etc/haproxy.cfg") do mode 644 requires get_package("haproxy") notify get_service("haproxy") template File.join(File.dirname(__FILE__), "..", "templates/haproxy.conf") end end end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
auser-poolparty-0.2.88 | lib/poolparty/base_packages/haproxy.rb |