<commit_before>#
# Resource:: kernel_module
#
# The MIT License (MIT)
#
# Copyright 2016-2018, Shopify Inc.
# Copyright 2018, Chef Software, Inc.

require_relative "../resource"

class Chef
  class Resource
    class KernelModule < Chef::Resource
      resource_name :kernel_module

      description "Use the kernel_module resource to manage kernel modules on Linux systems. This resource can load, unload, blacklist, disable, install, and uninstall modules."
      introduced "14.3"

      property :modname, String,
        description: "An optional property to set the kernel module name if it differs from the resource block's name.",
        name_property: true, identity: true

      property :options, Array,
        description: "An optional property to set options for the kernel module."

      property :load_dir, String,
        description: "The directory to load modules from.",
        default: "/etc/modules-load.d"

      property :unload_dir, String,
        description: "The modprobe.d directory.",
        default: "/etc/modprobe.d"

      action :install do
        description "Load kernel module, and ensure it loads on reboot."

        # create options file before loading the module
        file "#{new_resource.unload_dir}/options_#{new_resource.modname}.conf" do
          content "options #{new_resource.modname} #{new_resource.options.join(" ")}\n"
          not_if { new_resource.options.nil? }<commit_msg>Add introduced flag for new parameter<commit_after>#
# Resource:: kernel_module
#
# The MIT License (MIT)
#
# Copyright 2016-2018, Shopify Inc.
# Copyright 2018, Chef Software, Inc.

require_relative "../resource"

class Chef
  class Resource
    class KernelModule < Chef::Resource
      resource_name :kernel_module

      description "Use the kernel_module resource to manage kernel modules on Linux systems. This resource can load, unload, blacklist, disable, install, and uninstall modules."
      introduced "14.3"

      property :modname, String,
        description: "An optional property to set the kernel module name if it differs from the resource block's name.",
        name_property: true, identity: true

      property :options, Array,
        description: "An optional property to set options for the kernel module."
        introduced: "15.4"

      property :load_dir, String,
        description: "The directory to load modules from.",
        default: "/etc/modules-load.d"

      property :unload_dir, String,
        description: "The modprobe.d directory.",
        default: "/etc/modprobe.d"

      action :install do
        description "Load kernel module, and ensure it loads on reboot."

        # create options file before loading the module
        file "#{new_resource.unload_dir}/options_#{new_resource.modname}.conf" do
          content "options #{new_resource.modname} #{new_resource.options.join(" ")}\n"
          not_if { new_resource.options.nil? }
{'fraction_non_alphanumeric': 0.08945032434277911, 'fraction_numerical': 0.011266643905769888, 'mean_word_length': 3.1325811001410435, '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': '2251049', 'n_tokens_mistral': 800, 'n_tokens_neox': 753, 'n_words': 291}