<commit_before>---
  - hosts: localhost
    connection: local
    sudo: no

    vars:
      apt_package_list:
        - wget
        - curl
        - gzip
        - pbzip2
        - unzip
        - network-manager-openconnect
        - vim
        - git
        - byobu

      personal_bin: '{{ansible_env.HOME}}/bin'

    tasks:
    - name: Remove old Docker.io
      sudo: yes
      apt: pkg=docker.io state=absent
      when: ansible_distribution_version == '14.04'

    - name: Install docker apt repo key
      sudo: yes
      apt_key: keyserver=hkp://p80.pool.sks-keyservers.net:80 id=58118E89F3A912897C070ADBF76221572C52609D
      when: ansible_distribution_version == '14.04'

    - name: Install docker apt repo
      sudo: yes
      apt_repository: repo='deb https://apt.dockerproject.org/repo ubuntu-trusty main' update_cache=yes
      when: ansible_distribution_version == '14.04'

    - name: Install docker.io for Ubuntu 15,16 vms
      sudo: yes
      apt: pkg=docker.io state=latest 
      when: ansible_distribution_version >= '15.04'

    - name: Install docker-engine for Ubuntu 14 vms
      sudo: yes
      apt: pkg=docker-engine state=latest 
      when: ansible_distribution_version == '14.04'

    - name: Install apt packages
      sudo: yes
      apt: pkg={{ item }} state=present 
      with_items: "{{apt_package_list}}"

    - name: Copy gitconfig file
      sudo: yes
      copy: src=files/gitconfig dest=/etc/gitconfig

    - name: Start Docker service
      sudo: yes
      service: name=docker state=started

    - name: Add local bin folder for helper scripts
      file: path={{personal_bin}} state=directory

    - name: Copy xgrep
      copy: src={{ item }} dest={{ansible_env.HOME}}/bin/ mode=u=rwx
      with_fileglob:
      - files/*grep

    - name: Make sure ~/bin is in PATH
      lineinfile: dest={{ansible_env.HOME}}/.bashrc regexp="^export PATH=.*{{personal_bin}}" line='export PATH={{personal_bin}}:$PATH'

    - name: Copy inputrc file
      copy: src=files/inputrc dest={{ansible_env.HOME}}/.inputrc

    - name: Install gitconfig for user from template.
      template: src=templates/gitconfig.j2 dest={{ansible_env.HOME}}/.gitconfig

    - name: Passwordless sudo (it's a VM, relax)
      lineinfile:
        dest: /etc/sudoers.d/me
        create: yes
        regexp: "{{ ansible_user_id }}        ALL=(ALL:ALL) NOPASSWD: ALL"
        line: "{{ ansible_user_id }}        ALL=(ALL:ALL) NOPASSWD: ALL"
      become: yes<commit_msg>Updates for ansible2; passwordless sudo.<commit_after>---
  - hosts: localhost
    connection: local
    become: no

    vars:
      apt_package_list:
        - wget
        - curl
        - gzip
        - pbzip2
        - unzip
        - network-manager-openconnect
        - vim
        - git
        - byobu

      personal_bin: '{{ansible_env.HOME}}/bin'

    tasks:
    - name: Remove old Docker.io
      become: yes
      apt: pkg=docker.io state=absent
      when: ansible_distribution_version == '14.04'

    - name: Install docker apt repo key
      become: yes
      apt_key: keyserver=hkp://p80.pool.sks-keyservers.net:80 id=58118E89F3A912897C070ADBF76221572C52609D
      when: ansible_distribution_version == '14.04'

    - name: Install docker apt repo
      become: yes
      apt_repository: repo='deb https://apt.dockerproject.org/repo ubuntu-trusty main' update_cache=yes
      when: ansible_distribution_version == '14.04'

    - name: Install docker.io for Ubuntu 15,16 vms
      become: yes
      apt: pkg=docker.io state=latest 
      when: ansible_distribution_version >= '15.04'

    - name: Install docker-engine for Ubuntu 14 vms
      become: yes
      apt: pkg=docker-engine state=latest 
      when: ansible_distribution_version == '14.04'

    - name: Install apt packages
      become: yes
      apt: pkg={{ item }} state=present 
      with_items: "{{apt_package_list}}"

    - name: Copy gitconfig file
      become: yes
      copy: src=files/gitconfig dest=/etc/gitconfig

    - name: Start Docker service
      become: yes
      service: name=docker state=started

    - name: Add local bin folder for helper scripts
      file: path={{personal_bin}} state=directory

    - name: Copy xgrep
      copy: src={{ item }} dest={{ansible_env.HOME}}/bin/ mode=u=rwx
      with_fileglob:
      - files/*grep

    - name: Make sure ~/bin is in PATH
      lineinfile: dest={{ansible_env.HOME}}/.bashrc regexp="^export PATH=.*{{personal_bin}}" line='export PATH={{personal_bin}}:$PATH'

    - name: Copy inputrc file
      copy: src=files/inputrc dest={{ansible_env.HOME}}/.inputrc

    - name: Install gitconfig for user from template.
      template: src=templates/gitconfig.j2 dest={{ansible_env.HOME}}/.gitconfig

    - name: Passwordless sudo (it's a VM, relax)
      lineinfile:
        dest: "/etc/sudoers.d/{{ ansible_user_id }}"
        create: yes
        regexp: "^.*ALL=(ALL:ALL) NOPASSWD: ALL"
        line: "{{ ansible_user_id }}        ALL=(ALL:ALL) NOPASSWD: ALL"
        validate: 'visudo -cf %s'
      become: yes
{'fraction_non_alphanumeric': 0.11362733412793008, 'fraction_numerical': 0.024831148192292412, 'mean_word_length': 2.453360768175583, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '44830', 'n_tokens_mistral': 1785, 'n_tokens_neox': 1608, 'n_words': 403}