- hosts: all
  vars_files: ['secret_vars.yml']
  sudo: yes
  tasks:
    - apt: update_cache=yes

    - name: install dependencies
      apt: name={{ item }}
      with_items:
        - python2.7
        - python-pip
        - redis-server

    - pip: name=file:///vagrant extra_args='-e'
    - pip: name=pytest

    - user: name=pydrill

    - name: create directories
      file: path={{ item }} state=directory owner=pydrill
      with_items:
        - /etc/pydrill      # directory with configs
        - /var/lib/pydrill  # directory with .sqlite3 database

    - template: src=templates/flask_config.j2 dest=/etc/pydrill/pydrill.cfg owner=pydrill
    - service: name=redis-server state=started

- hosts: all
  vars_files: ['secret_vars.yml']
  sudo: yes
  tasks:
    - name: update aptitude cache
      apt: update_cache=yes

    - name: install dependencies
      apt: name={{ item }}
      with_items:
        - python2.7
        - python-pip
        - redis-server

    - name: install pydrill as .egg-link
      pip: name=file:///vagrant extra_args='-e'
    - name: install pytest
      pip: name=pytest

    - name: ensure user pydrill exists
      user: name=pydrill

    - name: create directories
      file: path={{ item }} state=directory owner=pydrill
      with_items:
        - /etc/pydrill      # directory with configs
        - /var/lib/pydrill  # directory with .sqlite3 database

    - name: copy pydrill.cfg to /etc/pydrill
      template: src=templates/flask_config.j2 dest=/etc/pydrill/pydrill.cfg owner=pydrill
    - name: start redis server
      service: name=redis-server state=started

Add names to ansible tasks
Add names to ansible tasks
