<commit_before># resources/install.rb

# Resource for InfluxDB install

property :arch_type, kind_of: String
property :include_repository, kind_of: [TrueClass, FalseClass], default: true
property :influxdb_key, kind_of: String, default: 'https://repos.influxdata.com/influxdb.key'
property :install_version, [String, nil], default: nil
property :install_type, String, default: 'package'
default_action :install

include InfluxdbCookbook::Helpers

action :install do
  if node.platform_family? 'rhel'
    yum_repository 'influxdb' do
      description 'InfluxDB Repository - RHEL \$releasever'
      baseurl node['influxdb']['upstream_repository']
      gpgkey influxdb_key
      only_if { include_repository }
    end
  elsif node.platform_family? 'debian'
    # see if we should auto detect
    unless new_resource.arch_type
      new_resource.arch_type determine_arch_type(new_resource, node)
    end

    package 'apt-transport-https' do
      action :install
    end

    apt_repository 'influxdb' do
      uri node['influxdb']['upstream_repository']
      distribution node['lsb']['codename']
      components ['stable']
      arch_type new_resource.arch_type
      key influxdb_key
      only_if { include_repository }
    end
  else
    # NOTE: should raise to exit, instead of warn, since we failed to install InfluxDB
    raise "I do not support your platform: #{node.platform_family}"
  end

  package 'influxdb' do
    version node['influxdb']['version']
  end
end

action :remove do
  if node.platform_family? 'rhel'
    yum_repository 'influxdb' do
      action :delete
      only_if { include_repository }
    end
  elsif node.platform_family? 'debian'
    apt_repository 'influxdb' do
      action :delete
      only_if { include_repository }
    end
  else
    Chef.Log.warn "I do not support your platform: #{node.platform_family}"
  end

  package 'influxdb' do
    action :remove
  end<commit_msg>case statement for install_type<commit_after># resources/install.rb

# Resource for InfluxDB install

property :arch_type, kind_of: String
property :include_repository, kind_of: [TrueClass, FalseClass], default: true
property :influxdb_key, kind_of: String, default: 'https://repos.influxdata.com/influxdb.key'
property :install_version, [String, nil], default: nil
property :install_type, String, default: 'package'
default_action :install

include InfluxdbCookbook::Helpers

action :install do
  case install_type
  when 'package'
    if node.platform_family? 'rhel'
      yum_repository 'influxdb' do
        description 'InfluxDB Repository - RHEL \$releasever'
        baseurl node['influxdb']['upstream_repository']
        gpgkey influxdb_key
        only_if { include_repository }
      end
    elsif node.platform_family? 'debian'
      # see if we should auto detect
      unless new_resource.arch_type
        new_resource.arch_type determine_arch_type(new_resource, node)
      end

      package 'apt-transport-https' do
        action :install
      end

      apt_repository 'influxdb' do
        uri node['influxdb']['upstream_repository']
        distribution node['lsb']['codename']
        components ['stable']
        arch_type new_resource.arch_type
        key influxdb_key
        only_if { include_repository }
      end
    else
      # NOTE: should raise to exit, instead of warn, since we failed to install InfluxDB
      raise "I do not support your platform: #{node.platform_family}"
    end

    package 'influxdb' do
      version node['influxdb']['version']
    end
  end
end

action :remove do
  if node.platform_family? 'rhel'
    yum_repository 'influxdb' do
      action :delete
      only_if { include_repository }
    end
  elsif node.platform_family? 'debian'
    apt_repository 'influxdb' do
      action :delete
      only_if { include_repository }
    end
  else
    Chef.Log.warn "I do not support your platform: #{node.platform_family}"
  end

  package 'influxdb' do
    action :remove
  end
{'fraction_non_alphanumeric': 0.08246901087781432, 'fraction_numerical': 0.0, 'mean_word_length': 3.488081725312145, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, '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': '6052007', 'n_tokens_mistral': 1207, 'n_tokens_neox': 1176, 'n_words': 343}