---

# Run this whenever you want the latest code pulled and loaded.

- hosts: all
  tasks:
  - include: set_vars.yml
  - name: git pull
    git:
      repo=git@github.com:freelawproject/courtlistener.git
      dest={{ INSTALL_ROOT.stdout }}
      clone=no
  - name: update python dependencies
    pip:
      virtualenv={{ VIRTUALENV_ROOT.stdout }}
      requirements={{ INSTALL_ROOT.stdout }}/requirements.txt
    tags:
     - dependencies

  - name: update seals
    command: "{{ VIRTUALENV_ROOT.stdout }}/bin/update-seals"

- hosts: web
  tasks:
  - include: set_vars.yml
  - name: collectstatic
    django_manage:
      app_path={{ INSTALL_ROOT.stdout }}
      command=collectstatic
      virtualenv={{ VIRTUALENV_ROOT.stdout }}
  - name: touch apache
    file:
      path=apache/django.wsgi
      state=touch

- hosts: db, dev
- tasks:
  - include: set_vars.yml
  - name: migrate database
    django_manage:
      app_path={{ INSTALL_ROOT.stdout }}
      command=migrate
      virtualenv={{ VIRTUALENV_ROOT.stdout }}

- hosts: celery
- tasks:
  - name: restart celery
    service:
      name=celeryd
      state=restarted

---

# Run this whenever you want the latest code pulled and loaded.

- hosts: all
  tasks:
  - include: set_vars.yml
  - name: git pull
    git:
      repo=https://github.com:freelawproject/courtlistener.git
      dest={{ INSTALL_ROOT.stdout }}
      clone=no
  - name: update python dependencies
    pip:
      virtualenv={{ VIRTUALENV_ROOT.stdout }}
      requirements={{ INSTALL_ROOT.stdout }}/requirements.txt
    tags:
     - dependencies

  - name: update seals
    command: "{{ VIRTUALENV_ROOT.stdout }}/bin/update-seals"

- hosts: web
  tasks:
  - include: set_vars.yml
  - name: collectstatic
    django_manage:
      app_path={{ INSTALL_ROOT.stdout }}
      command=collectstatic
      virtualenv={{ VIRTUALENV_ROOT.stdout }}
  - name: touch apache
    file:
      path=apache/django.wsgi
      state=touch

- hosts: db, dev
- tasks:
  - include: set_vars.yml
  - name: migrate database
    django_manage:
      app_path={{ INSTALL_ROOT.stdout }}
      command=migrate
      virtualenv={{ VIRTUALENV_ROOT.stdout }}

- hosts: celery
- tasks:
  - name: restart celery
    service:
      name=celeryd
      state=restarted

Fix github path in ansible.
Fix github path in ansible.
