---

- name: Install required packages
  apt: name={{ item }} update_cache=yes state=installed force=yes
  with_items:
    - apt-transport-https
    - ca-certificates
    - openssl

- name: Add docker.io repo
  apt_repository: repo='deb https://apt.dockerproject.org/repo debian-jessie main' state=present

- name: Install docker
  apt: name=docker-engine update_cache=yes state=installed force=yes

- name: Remove docker rc
  file: path=/etc/init.d/docker state=absent

- name: Create folder for containers logs
  file: path=/var/log/containers/ state=directory

- name: Install python library
  pip: name=docker-py version=1.9.0

- include: certs.yml

- name: Create systemd config
  template: src=docker.service.j2 dest=/etc/systemd/system/docker.service mode=0644
  notify: "restart docker service"

---

- name: Install required packages
  apt: name={{ item }} update_cache=yes state=installed force=yes
  with_items:
    - apt-transport-https
    - ca-certificates
    - openssl
    - python-pip

- name: Add docker.io repo
  apt_repository: repo='deb https://apt.dockerproject.org/repo debian-jessie main' state=present

- name: Install docker
  apt: name=docker-engine update_cache=yes state=installed force=yes

- name: Remove docker rc
  file: path=/etc/init.d/docker state=absent

- name: Create folder for containers logs
  file: path=/var/log/containers/ state=directory

- name: Install python library
  pip: name=docker-py version=1.9.0

- include: certs.yml

- name: Create systemd config
  template: src=docker.service.j2 dest=/etc/systemd/system/docker.service mode=0644
  notify: "restart docker service"

Add pip to required packages
Add pip to required packages

Fixes `Unable to find any of pip2, pip to use.  pip needs to be installed.` when the target node has no `pip` yet.