<commit_before># Install ElasticSearch plugin
#
define :install_plugin do

  bash "/usr/local/bin/plugin -install #{params[:name]}" do
    user "root"
    code "/usr/local/bin/plugin -install #{params[:name]}"

    notifies :restart, resources(:service => 'elasticsearch')

    not_if do
      Dir.entries("#{node.elasticsearch[:dir]}/elasticsearch-#{node.elasticsearch[:version]}/plugins/").any? do |plugin|
        params[:name].include? plugin
      end
    end

  end
  
end
<commit_msg>[FIX] Fix a failed provisioning where `$ES_HOME/plugins` does not exist on the first run<commit_after># Install ElasticSearch plugin
#
define :install_plugin do

  bash "/usr/local/bin/plugin -install #{params[:name]}" do
    user "root"
    code "/usr/local/bin/plugin -install #{params[:name]}"

    notifies :restart, resources(:service => 'elasticsearch')

    not_if do
      Dir.entries("#{node.elasticsearch[:dir]}/elasticsearch-#{node.elasticsearch[:version]}/plugins/").any? do |plugin|
        params[:name].include? plugin
      end rescue false
    end

  end
  
end

{'fraction_non_alphanumeric': 0.14579439252336449, 'fraction_numerical': 0.0, 'mean_word_length': 3.7180616740088106, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '2619445', 'n_tokens_mistral': 326, 'n_tokens_neox': 324, 'n_words': 81}