<commit_before>require 'chef/provider/lwrp_base'

class Chef
  class Provider
    class HttpdModule
      class Rhel < Chef::Provider::HttpdModule
        use_inline_resources if defined?(use_inline_resources)

        def whyrun_supported?
          true
        end

        action :create do
          #
          # local variables
          #
          case node['kernel']['machine']
          when 'x86_64'
            libarch = 'lib64'
          when 'i686'
            libarch = 'lib'
          end

          # paths
          module_name = new_resource.name
          module_path = "/usr/#{libarch}/httpd/modules/mod_#{module_name}.so"

          # support multiple instances
          new_resource.httpd_instance == 'default' ? apache_name = 'httpd' : apache_name = "httpd-#{new_resource.name}"

          #
          # resources
          #
          package "#{new_resource.name} create #{new_resource.package_name}" do
            package_name new_resource.package_name
            notifies :run, "execute[#{new_resource.name} create remove_package_config]", :immediately
            action :install
          end

          execute "#{new_resource.name} create remove_package_config" do
            user 'root'
            command "rm -f /etc/#{apache_name}/conf.d/*"
            only_if "test -f /etc/#{apache_name}/conf.d/README"
            action :nothing
          end

          directory "#{new_resource.name} create /usr/#{libarch}/httpd/modules" do
            path "/usr/#{libarch}/httpd/modules"
            user 'root'
            group 'root'
            mode '0755'
            recursive true
            action :create<commit_msg>savegame: fixing apache_name bug in httpd_module<commit_after>require 'chef/provider/lwrp_base'

class Chef
  class Provider
    class HttpdModule
      class Rhel < Chef::Provider::HttpdModule
        use_inline_resources if defined?(use_inline_resources)

        def whyrun_supported?
          true
        end

        action :create do
          #
          # local variables
          #
          case node['kernel']['machine']
          when 'x86_64'
            libarch = 'lib64'
          when 'i686'
            libarch = 'lib'
          end

          # paths
          module_name = new_resource.name
          module_path = "/usr/#{libarch}/httpd/modules/mod_#{module_name}.so"

          # support multiple instances
          new_resource.httpd_instance == 'default' ? apache_name = 'httpd' : apache_name = new_resource.httpd_instance

          #
          # resources
          #
          package "#{new_resource.name} create #{new_resource.package_name}" do
            package_name new_resource.package_name
            notifies :run, "execute[#{new_resource.name} create remove_package_config]", :immediately
            action :install
          end

          execute "#{new_resource.name} create remove_package_config" do
            user 'root'
            command "rm -f /etc/#{apache_name}/conf.d/*"
            only_if "test -f /etc/#{apache_name}/conf.d/README"
            action :nothing
          end

          directory "#{new_resource.name} create /usr/#{libarch}/httpd/modules" do
            path "/usr/#{libarch}/httpd/modules"
            user 'root'
            group 'root'
            mode '0755'
            recursive true
            action :create
{'fraction_non_alphanumeric': 0.095763723150358, 'fraction_numerical': 0.007756563245823389, 'mean_word_length': 1.7964970809007506, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, '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': '4027817', 'n_tokens_mistral': 957, 'n_tokens_neox': 920, 'n_words': 204}