<commit_before>---
- hosts: teamcity
  vars:
    teamcity_user: teamcity
    teamcity_user_home: "/home/{{teamcity_user}}"
    version: 8.0.3
    download_path: "{{teamcity_user_home}}/TeamCity-{{version}}.tar.gz"
    install_dir: "{{teamcity_user_home}}"
    install_path: "{{install_dir}}/TeamCity"
    data_path: "{{teamcity_user_home}}/TeamCityData"
  tasks:
    - name: update cache
      apt: update_cache=yes
    - name: install curl
      apt: pkg=curl

    - name: install java
      apt: pkg=openjdk-7-jre

    - name: create user running teamcity
      user: name={{teamcity_user}} home=$teamcity_user_home comment="User running TeamCity" generate_ssh_key=yes

    - name: download teamcity
      get_url: url=http://download.jetbrains.com/teamcity/TeamCity-{{version}}.tar.gz dest=$download_path

    - name: unpack archive
      command: tar -xvzf "{{download_path}}" --directory "{{install_dir}}" creates=$install_path

    - name: set install directory owner
      file: path=$install_path owner=$teamcity_user group=$teamcity_user recurse=yes state=directory

    - name: copy teamcity startup script
      template: src=./templates/teamcity_service_script.sh.j2 dest=/etc/init.d/teamcity mode=755

    - name: install teamcity as a service
      service: name=teamcity enabled=yes state=started

    # Install git and hg
    - name: install hg
      apt: pkg=mercurial
    - name: install git
      apt: pkg=git-core<commit_msg>Start teamcity on startup<commit_after>---
- hosts: teamcity
  vars:
    teamcity_user: teamcity
    teamcity_user_home: "/home/{{teamcity_user}}"
    version: 8.0.3
    download_path: "{{teamcity_user_home}}/TeamCity-{{version}}.tar.gz"
    install_dir: "{{teamcity_user_home}}"
    install_path: "{{install_dir}}/TeamCity"
    data_path: "{{teamcity_user_home}}/TeamCityData"
  tasks:
    - name: update cache
      apt: update_cache=yes
    - name: install curl
      apt: pkg=curl

    - name: install java
      apt: pkg=openjdk-7-jre

    - name: create user running teamcity
      user: name={{teamcity_user}} home=$teamcity_user_home comment="User running TeamCity" generate_ssh_key=yes

    - name: download teamcity
      get_url: url=http://download.jetbrains.com/teamcity/TeamCity-{{version}}.tar.gz dest=$download_path

    - name: unpack archive
      command: tar -xvzf "{{download_path}}" --directory "{{install_dir}}" creates=$install_path

    - name: set install directory owner
      file: path=$install_path owner=$teamcity_user group=$teamcity_user recurse=yes state=directory

    - name: copy teamcity startup script
      template: src=./templates/teamcity_service_script.sh.j2 dest=/etc/init.d/teamcity mode=755

    - name: configure teamcity to start on startup
      command: update-rc.d teamcity defaults
    - name: start teamcity now
      service: name=teamcity state=started

    # Install git and hg
    - name: install hg
      apt: pkg=mercurial
    - name: install git
      apt: pkg=git-core
{'fraction_non_alphanumeric': 0.11630252100840337, 'fraction_numerical': 0.005378151260504202, 'mean_word_length': 3.4550898203592815, 'pattern_counts': {'":': 0, '<': 3, '<?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': 10, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '303390', 'n_tokens_mistral': 986, 'n_tokens_neox': 935, 'n_words': 222}