---
- hosts: vagrant
  user: vagrant
  vars:
    pelican_dir: /vagrant/pelican/
  tasks: 

  - name: upgrade
    apt: upgrade=dist update_cache=yes cache_valid_time=3600
    sudo: yes

  - name: specific packages (apt)
    apt: pkg={{item}} state=latest update_cache=yes cache_valid_time=3600
    sudo: yes
    with_items:
    - python-pip
    - vim
    - make
  
  - name: virtualenv via pip
    pip: name={{item}}
    sudo: yes
    with_items:
    - virtualenv
  
  - file: path={{pelican_dir}} state=directory
  - command: virtualenv env chdir={{pelican_dir}}
  
  - name: specific packages (pip) 
    pip: name={{item}} virtualenv={{pelican_dir}}/env 
    with_items:
    - pelican
    - markdown
  
