<commit_before>#
# Cookbook Name:: vmware-tools
# Recipe:: default
#
# Copyright 2011, <NAME> <<EMAIL>>
#
# Apache v2.0
#

if node['virtualization']['system'] == 'vmware'

  bash "remove_vmware_tools" do
    code <<-EOH
    yum remove -y 'vmware*'
    if [ -f /etc/yum.repos.d/vmware-tools.repo ]; then
      rm -f /etc/yum.repos.d/vmware-tools.repo
    fi
    if [ -d /usr/lib/vmware-tools ]; then
      rm -rf /usr/lib/vmware-tools
    fi
    if [ -d /etc/vmware-tools ]; then
      rm -rf /etc/vmware-tools
    fi
    EOH
    only_if "yum -C list installed 'vmware-tool*'"
  end

  unless File.directory?('/usr/lib/vmware-tools')

    # get the file
    remote_file "#{Chef::Config[:file_cache_path]}/#{node['esx']['tarball']}" do
      source "#{node['esx']['repo']}/#{node['esx']['tarball']}"
      checksum "#{node['esx']['checksum']}"
      mode 00644
    end
  
    # extract tarball
    execute 'extract' do
      command "tar xzf #{Chef::Config[:file_cache_path]}/#{node['esx']['tarball']}"
      cwd '/tmp'
    end
  
    # run uninstall script
    execute 'vmware-uninstall-tools.pl' do
      command '/tmp/vmware-tools-distrib/bin/vmware-uninstall-tools.pl'
      ignore_failure true
    end
  
    # run install script<commit_msg>added path for uninstall script<commit_after>#
# Cookbook Name:: vmware-tools
# Recipe:: default
#
# Copyright 2011, <NAME> <<EMAIL>>
#
# Apache v2.0
#

if node['virtualization']['system'] == 'vmware'

  bash "remove_vmware_tools" do
    code <<-EOH
    yum remove -y 'vmware*'
    if [ -f /etc/yum.repos.d/vmware-tools.repo ]; then
      rm -f /etc/yum.repos.d/vmware-tools.repo
    fi
    if [ -d /usr/lib/vmware-tools ]; then
      rm -rf /usr/lib/vmware-tools
    fi
    if [ -d /etc/vmware-tools ]; then
      rm -rf /etc/vmware-tools
    fi
    EOH
    only_if "yum -C list installed 'vmware-tool*'"
  end

  unless File.directory?('/usr/lib/vmware-tools')

    # get the file
    remote_file "#{Chef::Config[:file_cache_path]}/#{node['esx']['tarball']}" do
      source "#{node['esx']['repo']}/#{node['esx']['tarball']}"
      checksum "#{node['esx']['checksum']}"
      mode 00644
    end
  
    # extract tarball
    execute 'extract' do
      command "tar xzf #{Chef::Config[:file_cache_path]}/#{node['esx']['tarball']}"
      cwd '/tmp'
    end
  
    # run uninstall script
    execute 'vmware-uninstall-tools.pl' do
      command 'vmware-uninstall-tools.pl'
      path ['/tmp/vmware-tools-distrib/bin']
      ignore_failure true
    end
  
    # run install script
{'fraction_non_alphanumeric': 0.16937723125743753, 'fraction_numerical': 0.00872669575565252, 'mean_word_length': 2.708823529411765, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 9, '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': '2753569', 'n_tokens_mistral': 953, 'n_tokens_neox': 928, 'n_words': 199}