<commit_before>define "fabricapply" do
  copyboot

  run("run apt-update ") {
    chroot "apt-get -y --force-yes update"
  }
  run("git clone puppet") {
    cmd "rm -Rf #{spec[:temp_dir]}/etc/puppet/*"
    cmd "git clone http://git.youdevise.com/git/puppet #{spec[:temp_dir]}/etc/puppet"
  }
  run("temporary route to existing fabric") {
    open("#{spec[:temp_dir]}//etc/network/if-up.d/routes_mgmt", "w") {|f|
      f.puts """
ip route add 10.108.0.0/16 via 172.19.0.3
"""
    }
    open("#{spec[:temp_dir]}/etc/hosts", 'a') { |f|
      f.puts "10.108.11.237 aptproxy deb\n"
    }
  }
  run("fabricapply") {
    cmd "mkdir #{spec[:temp_dir]}/seed"
    cmd "cp -r #{File.dirname(__FILE__)}/seed  #{spec[:temp_dir]}/"

    open("#{spec[:temp_dir]}/seed/puppet.yaml", "w") {|f|
      f.puts YAML.dump(spec[:enc])
    }

    open("#{spec[:temp_dir]}/seed/puppet.sh", 'w') { |f|
      f.puts """#!/bin/sh -e
puppet apply -v --pluginsync --modulepath=/etc/puppet/modules /etc/puppet/manifests/site.pp 2>&1 | tee /seed/init.log
      """
    }

    cmd "chmod 700 #{spec[:temp_dir]}/seed/puppet.sh"

    open("#{spec[:temp_dir]}/etc/rc.local", 'w') { |f|
      f.puts """#!/bin/sh -e
echo 'Running seed puppet'
/seed/puppet.sh
echo \"#!/bin/sh -e\nexit 0\" > /etc/rc.local
echo 'Finished running fabric puppet'
exit 0
      """
    }
  }
end
<commit_msg>Adding apt install of hiera. Remove un-needed yaml stuff<commit_after>define "fabricapply" do
  copyboot

  run("run apt-update ") {
    chroot "apt-get -y --force-yes update"
  }
  run("install misc packages") {
    apt_install "rubygem-hiera"
  }
  run("git clone puppet") {
    cmd "rm -Rf #{spec[:temp_dir]}/etc/puppet/*"
    cmd "git clone http://git.youdevise.com/git/puppet #{spec[:temp_dir]}/etc/puppet"
  }
  run("temporary route to existing fabric") {
    open("#{spec[:temp_dir]}//etc/network/if-up.d/routes_mgmt", "w") {|f|
      f.puts """
ip route add 10.108.0.0/16 via 172.19.0.3
"""
    }
    open("#{spec[:temp_dir]}/etc/hosts", 'a') { |f|
      f.puts "10.108.11.237 aptproxy deb\n"
    }
  }
  run("fabricapply") {
    cmd "mkdir #{spec[:temp_dir]}/seed"

    open("#{spec[:temp_dir]}/seed/puppet.sh", 'w') { |f|
      f.puts """#!/bin/sh -e
puppet apply -v --pluginsync --modulepath=/etc/puppet/modules /etc/puppet/manifests/site.pp 2>&1 | tee /seed/init.log
      """
    }

    cmd "chmod 700 #{spec[:temp_dir]}/seed/puppet.sh"

    open("#{spec[:temp_dir]}/etc/rc.local", 'w') { |f|
      f.puts """#!/bin/sh -e
echo 'Running seed puppet'
/seed/puppet.sh
echo \"#!/bin/sh -e\nexit 0\" > /etc/rc.local
echo 'Finished running fabric puppet'
exit 0
      """
    }
  }
end

{'fraction_non_alphanumeric': 0.2146101438304315, 'fraction_numerical': 0.02498107494322483, 'mean_word_length': 2.8471615720524017, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 6, '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': '2867938', 'n_tokens_mistral': 1160, 'n_tokens_neox': 1080, 'n_words': 207}