---
- name: update apt package lists
  apt:
      update_cache: yes
  tags:
    - apt
    - development

# TODO: this is copied from roles/common/tasks/create_users.yml
# A more DRY solution would be better. This task is necessary
# to ensure that the default user exists in DigitalOcean instances,
# which are used for testing. It's also simply a good idea
# to ensure an assumed user account does actually exist, even though
# Vagrant VirtualBox images come with the "vagrant" user already configured.
- name: ensure SecureDrop admin user accounts exist
  user:
    name: "{{ item }}"
    shell: /bin/bash
    groups: sudo,ssh
  with_items: ssh_users
  tags:
    - users
    - sudoers

- name: install apt package deps for dev environment
  apt:
    pkg: "{{ item }}"
    state: latest
  with_items: dev_deps
  tags:
    - apt
    - development

- name: install pip dependencies for securedrop
  pip:
    requirements: "{{ securedrop_pip_requirements }}"
  tags:
    - pip
    - development

- name: set SECUREDROP_ENV in bashrc
  lineinfile:
    dest: /home/{{ securedrop_user }}/.bashrc
    state: present
    insertafter: EOF
    line: "export SECUREDROP_ENV=dev"
  tags:
    - environment
    - development

---
- name: update apt package lists
  apt:
      update_cache: yes
  tags:
    - apt
    - development

- name: install apt package deps for dev environment
  apt:
    pkg: "{{ item }}"
    state: latest
  with_items: dev_deps
  tags:
    - apt
    - development

- name: install pip dependencies for securedrop
  pip:
    requirements: "{{ securedrop_pip_requirements }}"
  tags:
    - pip
    - development

- name: set SECUREDROP_ENV in bashrc
  lineinfile:
    dest: /home/{{ securedrop_user }}/.bashrc
    state: present
    insertafter: EOF
    line: "export SECUREDROP_ENV=dev"
  tags:
    - environment
    - development

Revert "ensure "ssh_users" account exists in development"
Revert "ensure "ssh_users" account exists in development"

In order to keep the development playbook clean, the user
provisioning specific to DigitalOcean droplets has been
moved into the Vagrantfile.

This reverts commit f179503239aba4c8f7d32dfdddc795ce1093b342.
