<commit_before>module PoolParty
  class Base
    plugin :haproxy do
      
      def before_configure
        # We need the haproxy package
        ::Suitcase::Zipper.add("#{::File.dirname(__FILE__)}/../../../vendor/chef/apache2", "chef/cookbooks")
      end
      
      def enable
        has_chef_recipe 'apache2'
        
        has_package "haproxy" do
          # stops get_service("apache2")
        end
        
        has_service "apache2"
    
        # Restart sysklogd after we update the haproxy.log
        has_service(:name => "sysklogd")    
        # Template variables
        has_variable("haproxy_name", :value => "#{cloud.name}")
        has_variable("listen_ports", :value => [ "8080" ], :namespace => "apache")
        
        has_variable("ports_haproxy", :value => ([(self.respond_to?(:port) ? port : Default.port)].flatten))        
        has_variable("forwarding_port", :value => (respond_to?(:forwarding_port) ? forwarding_port : Default.forwarding_port))
        has_variable("proxy_mode", :value => (respond_to?(:proxy_mode) ? proxy_mode : Default.proxy_mode))
    <commit_msg>Updating haproxy to move apache2 service first<commit_after>module PoolParty
  class Base
    plugin :haproxy do
      
      def before_configure
        # We need the haproxy package
        ::Suitcase::Zipper.add("#{::File.dirname(__FILE__)}/../../../vendor/chef/apache2", "chef/cookbooks")
      end
      
      def enable
        has_chef_recipe 'apache2'
        
        has_service "apache2"
        
        has_package "haproxy" do
          stops get_service("apache2")
        end        
    
        # Restart sysklogd after we update the haproxy.log
        has_service(:name => "sysklogd")    
        # Template variables
        has_variable("haproxy_name", :value => "#{cloud.name}")
        has_variable("listen_ports", :value => [ "8080" ], :namespace => "apache")
        
        has_variable("ports_haproxy", :value => ([(self.respond_to?(:port) ? port : Default.port)].flatten))        
        has_variable("forwarding_port", :value => (respond_to?(:forwarding_port) ? forwarding_port : Default.forwarding_port))
        has_variable("proxy_mode", :value => (respond_to?(:proxy_mode) ? proxy_mode : Default.proxy_mode))
    
{'fraction_non_alphanumeric': 0.1303579319487406, 'fraction_numerical': 0.007512152010605391, 'mean_word_length': 2.54858934169279, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3384351', 'n_tokens_mistral': 711, 'n_tokens_neox': 690, 'n_words': 132}